New Vector is added twice to scene

Hi,
I’ve added a html element to a perspectivecamera scene but the element is duplicated in the scene…demo at https://matox.nl/360/html/ . 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!
Chris

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: annotation.style.display = ( vector.z < - 1 || vector.z > 1 ) ? ‘none’ : ‘’;
This prevents the element being duplicated!
MISSION ACCOMPLISHED!
greets

1 Like