How can I render objects on top of other objects in a Three.js scene?
I am struggling to get the green torus knots to display above the red boxes and floor in my fiddle.
Despite trying various values like mesh.renderDepth = 0, 1, 1000
, nothing seems to work.
The material I have created is:
material = new THREE.MeshBasicMaterial( { color: 0x00ff00, transparent: true, opacity: 0.5 } );
Is there any way to achieve this using renderDepth? Am I overlooking any other settings?
Setting depthTest
to true
does sort of work, but it's not ideal for concave meshes like the torus as they end up with overlapping polygons, especially when opaque.
Although I have not been successful in getting this alternative solution involving two scenes to function properly, it appears to be more complex and less versatile than just using renderDepth
.
To see the issue in action, check out the fully operational JSFiddle: http://jsfiddle.net/QHssJ/
I appreciate any guidance or assistance you can provide. Thank you!