Can please someone help me in moving the camera along a geometry made of points from CurvePath()?
I am including the geometry code here:
curvePath = new THREE.CurvePath();
curvePath = findAPath(startingPoint, endingPoint, curvePath);
/* My curvePath actually ends up as an Object like this :
Object { arcLengthDivisions: 200, curves: Array[3], autoClose: false }
where curves contains three objects, each can be either of these two - LineCurve3, QuadraticBezierCurve3 */
curveGeometry = new THREE.Geometry();
curveGeometry.vertices = curvePath.getPoints( 100 );
const curveMaterial = new THREE.LineBasicMaterial( { color : 0xffff00, linewidth: 5 } );
const curveObject = new THREE.Line( curveGeometry, curveMaterial );
Till now I was moving the camera along this yellow line seen here in the screenshot by elementary operations in camera’s x, y, z positions in the render loop on different conditions for all the different curves inside the curvePath element.
But this makes it difficult to actually apply easing functions over the camera movement. Plus, this way I am not able to tilt the camera along the direction it is moving, it moves along the path but always faces forward.
Here they have one tubeGeometry and have moved the camera by utilising the geometry’s pre-defined properties like parameters, tangents, binormals in the render() loop.
Hey, thanks @Mugen87 !
Yes, I have worked with CatmullRomCurve3 and I know its easy to use a single curve for the entire path that way, but here requirements were bit different!
Yes, saw the new release, logs are still being written. Can’t wait to start working with the new R88, once all the changes are documented!
But this makes it difficult to actually apply easing functions over the camera movement.
Can you show some code what you want to achieve?
That thing is now working! Was treating the curves differently earlier, had to just use the curvePath to get the points for animating the camera!
You could place the camera into a Group object. In this way, you can animate the group and orientate the camera independently.
Hey, that thing was indeed helpful! Thanks!
One thing was not striking in my mind, this link helped me with that!
I am now able to move my camera over my yellow Line