spite / THREE.MeshLine

Mesh replacement for THREE.Line
MIT License
2.18k stars 380 forks source link

Annoying shake when camera moves #98

Open mertselimb opened 4 years ago

mertselimb commented 4 years ago

Hi, i am using this as my camera and renderer.


        this.camera = new THREE.PerspectiveCamera(
            90,
            width / height,
            0.1,
            1000
        );

        this.renderer = new THREE.WebGLRenderer({
            alpha: true,
            antialias: true
        });

When i draw this line

            let geometry = new THREE.Geometry();
            this.coordinates.forEach((c) => (geometry.vertices.push(new THREE.Vector3(c.x, c.y + 0.015, c.z))));
            let line = new MeshLine();
            line.setGeometry(geometry);
            let material = new MeshLineMaterial({
                color:"#3a5d91",
                lineWidth: 0.015
            });
            const mesh = new THREE.Mesh(line.geometry, material); 
            this.directionObjects.add(mesh);

When i move camera in any direction line shakes a lot and nothing else shakes. Sometimes it becomes see through for some parts too like a glitch effect. I am suspecting low width causes this.

How can i solve it?

mahmodHammad commented 4 years ago

I am facing the same issue Could you please respond ?@spite

spite commented 4 years ago

If you could provide a working example illustrating the issue, on codepen or such, it would be a great help.