New Vector is added twice to scene

I’ve added a html element to a perspectivecamera scene but the element is duplicated in the scene…demo at . Please advice how to prevent this? I only want 1 element in the scene…not duplicated…it seems that the element is duplicated in the opposite.
Thanks in advance!

I guess you need something like this in your code: three.js/CSS2DRenderer.js at 3c7d51552114e792bbdf2b77f1466416c0902f17 · mrdoob/three.js · GitHub

More information here: CSS2DRenderer: properly clip objects outside frustum by Chabam · Pull Request #15921 · mrdoob/three.js · GitHub

I suggest you are using one of the CSS renderers to avoid such glitches in the first place.

Thanks for your answer, found the solution on your second link: = ( vector.z < - 1 || vector.z > 1 ) ? ‘none’ : ‘’;
This prevents the element being duplicated!

1 Like