1

I'm trying to render lines (railroads, roads etc) onto a globe. At present, I'm using THREE.LineBasicMaterial and using the linewidth property to control thickness, but it would look much better if the thickness of the line at a given point was inversely proportional to the distance of that point from the camera.

Is such a thing possible (perhaps with a custom shader) or is the only way to construct a tube that follows the same path as the line? (And if so, what would the best approach be?)

Rich Harris
  • 28,091
  • 3
  • 84
  • 99
  • 1
    This isn't currently supported, but some brainstorming has happened at least: http://stackoverflow.com/questions/20738386/how-to-create-a-three-js-3d-line-series-with-width-and-thickness ... depending on your needs, building tubes might be the best approach. The biggest problem I have with such a solution is that it's difficult to animate. – Leeft Jul 23 '14 at 20:54
  • `TubeGeometry` looks like the answer, if I can figure it out - the lines are static, they don't need to animate. Thanks! – Rich Harris Jul 23 '14 at 21:09
  • 1
    I recently answered a question which may help: http://stackoverflow.com/questions/24868342/three-js-rotate-cylinder-into-vector3-direction/24868514#24868514 – Leeft Jul 23 '14 at 21:12

0 Answers0