You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<html><head><scriptsrc="https://cdnjs.cloudflare.com/ajax/libs/three.js/r119/three.min.js"></script><scriptsrc="https://unpkg.com/[email protected]/src/THREE.MeshLine.js"></script></head><body><script>constcontainer=document.createElement('div');document.body.appendChild(container);constcamera=newTHREE.PerspectiveCamera(45,window.innerWidth/window.innerHeight,1,10000);camera.position.set(0,0,150);constscene=newTHREE.Scene();scene.add(camera);constrenderer=newTHREE.WebGLRenderer({clearAlpha: 1});renderer.setSize(window.innerWidth,window.innerHeight);renderer.setClearColor(0x101010,1);document.body.appendChild(renderer.domElement);// A transparent red plane mesh at z=10:constplane=newTHREE.Mesh(newTHREE.PlaneGeometry(50,50),newTHREE.MeshBasicMaterial({color: 0xff0000,transparent: true,opacity: 0.9}));plane.position.set(0,0,10);plane.lookAt(camera.position);scene.add(plane);// A yellow dashed MeshLine that penetrates the plane:constline=newMeshLine();line.setPoints([-40,20,0,40,0,20]);constlineMaterial=newMeshLineMaterial({color: 0xffff00,transparent: true,dashArray: 0.05});constmesh=newTHREE.Mesh(line,lineMaterial);scene.add(mesh);// A blue dashed MeshLine fully in front of the plane:constline2=newMeshLine();line2.setPoints([-40,0,20,40,-20,20]);constline2Material=newMeshLineMaterial({color: 0x0080ff,transparent: true,dashArray: 0.05});scene.add(newTHREE.Mesh(line2,line2Material));renderer.render(scene,camera);animate();functionanimate(){requestAnimationFrame(animate);mesh.material.uniforms.dashOffset.value-=0.001renderer.render(scene,camera);}</script></body></html>
This renders like so:
Another angle:
Note the black "gaps" that have appeared in the red plane.
If I remove transparent: true, opacity: 0.9 from the plane material, it renders correctly:
The text was updated successfully, but these errors were encountered:
Minimal example (jsfiddle):
This renders like so:
Another angle:
Note the black "gaps" that have appeared in the red plane.
If I remove
transparent: true, opacity: 0.9
from the plane material, it renders correctly:The text was updated successfully, but these errors were encountered: