Mesh with TubeGeometry and LineCurve3

I am using TubeGeometry to show line between 2 points .

I am using LineCurve3 for path.

As you can see in below image , mesh is twisted along axis

below is code used to genrate mesh where firstPoint & secondPoint are Three.Vector3().

var path = new THREE.LineCurve3(firstPoint, secondPoint);
var tubegeometry = new THREE.TubeGeometry(path, 20, .2, 8, false);
var material = new THREE.MeshBasicMaterial({ color: 0x0000ff });
var line = new THREE.Mesh(tubegeometry, material);

I would use a different approach: with a cylinder, scaled on one dimension, and using of .lookAt():


1 Like