I have a position vector:
var startPos = new THREE.Vector3(1.2, -2.34, 0.5);
A direction vector:
var direction = new THREE.Vector3(0.657873735, -0.2497291683, 0.71051916);
And a distance:
var distance = 1;
How to calculate a new position vector, starting from startPos
that is moved the distance
along the direction
?
var startPos = new THREE.Vector3(1.2, -2.34, 0.5);
var direction = new THREE.Vector3(0.6578737359955765, -0.24972916834682138, 0.710519166466616);
var distance = 1;
var newPos = new THREE.Vector3();
newPos.addVectors ( startPos, direction.multiplyScalar( distance ) );
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With