Calculate position ahead by x units

Hi,

I have a question which may be very simple for those good at quaternions.

I want to get to calculate a position ahead by 5 units of my camera.

Given camera’s position and quaternion, I am interested to know what is the position if my camera would travel 5 units in the direction it is currently facing.

Thanks for pointers.

Do it like so:

const direction = new THREE.Vector3( 0, 0, 1 ).applyQuaternion( mesh.quaternion );
mesh.position.add( direction.multiplyScalar( 5 ) );

(0, 0, 1) is the default forward vector of 3D objects (except cameras).