spite / THREE.MeshLine

Mesh replacement for THREE.Line
MIT License
2.13k stars 379 forks source link

flat lines restricted to a plane instead of billboarding #100

Open trusktr opened 4 years ago

trusktr commented 4 years ago

In some cases it'd be nice to restrict the faces of the line to remain parallel to a given plane instead of billboarding. Is this possible?

F.e., I'd like a line (with the same simplicity as MeshLine), that will be flat on the ground, so as I move the camera the line stays flat on the ground (the ground being a big flat brown plane for example, and the line being some other color).

tartavull commented 3 years ago

https://github.com/spite/THREE.MeshLine/blob/master/src/THREE.MeshLine.js#L441

If you change it to vec4 normal = vec4( -1., 0., 0., 1. ); you'll get your desired behavior.

nate-peters commented 3 years ago

I think this is a duplicate of #49

I'm facing the same issue. Thanks for the tip @tartavull - I'll give that a shot.

vas4oo commented 3 years ago

https://github.com/spite/THREE.MeshLine/blob/master/src/THREE.MeshLine.js#L441

If you change it to vec4 normal = vec4( -1., 0., 0., 1. ); you'll get your desired behavior.

this does not help @tartavull :/