THREE.MeshLine icon indicating copy to clipboard operation
THREE.MeshLine copied to clipboard

How to control the line changes when the camera changes

Open AmosJJ opened this issue 8 years ago • 11 comments

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 !

AmosJJ avatar Feb 15 '17 06:02 AmosJJ

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

spite avatar Feb 16 '17 00:02 spite

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

AmosJJ avatar Feb 16 '17 03:02 AmosJJ

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

Simon-wu avatar Feb 16 '17 06:02 Simon-wu

Set the material's sizeAttenuation value to true

spite avatar Feb 16 '17 12:02 spite

@spite thanks!

AmosJJ avatar Feb 17 '17 02:02 AmosJJ

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

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

AmosJJ avatar Feb 17 '17 03:02 AmosJJ

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

spite avatar Mar 07 '17 23:03 spite

Yes,the line is float when i rotated camera!

AmosJJ avatar Mar 09 '17 09:03 AmosJJ

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.

inear avatar Jun 26 '17 06:06 inear

Do you have an example to show the problem?

spite avatar Jul 06 '17 16:07 spite

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.

inear avatar Jul 06 '17 16:07 inear