spite / THREE.MeshLine

Mesh replacement for THREE.Line
MIT License
2.14k stars 381 forks source link

How to control the line changes when the camera changes #35

Open AmosJJ opened 7 years ago

AmosJJ commented 7 years ago

Now, i draw a line with MeshLine, and when i pull the camera , the line becomes larger,but i want the line tapering, what should i do? thanks !

spite commented 7 years ago

I'm sorry, I'm not really following. By line tapering you mean attenuated with distance, like it's thinner the farther it is?

AmosJJ commented 7 years ago

Yes,as you understand the same.Can you help me?

Simon-wu commented 7 years ago

help him please! if he can not do it his boss will fire him

spite commented 7 years ago

Set the material's sizeAttenuation value to true

AmosJJ commented 7 years ago

@spite thanks!

AmosJJ commented 7 years ago

@spite now,the lines on the object when i move the camera !

http://p.ckiosk.cn/map/n/sources/map20170216.png

spite commented 7 years ago

I'm sorry, what's the issue here?

AmosJJ commented 7 years ago

Yes,the line is float when i rotated camera!

inear commented 7 years ago

I think I have the same problem. When camera moves, the line nodes is not longer connected to the positions they suppose to follow, if I for example have a mesh at each point that the line should connect to.

spite commented 7 years ago

Do you have an example to show the problem?

inear commented 7 years ago

I solved my problem, and it was not cause of your code. I displace the positions (curr,prev,next) in the vertex-shader, and forgot to work in model-space. Once I applied the projection and view matrix after my manipulations it worked fine.