We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.

First person camera strafe movement

Home Forums Puzzles First person camera strafe movement

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #30753
    core3d
    Customer

    Hi,
    I’m still trying to build a physics enabled FPS movement with puzzles. Forward and backward movement is working but i can’t figure it out how to calculate left-right vector calculations.
    i found how to calculate left vector on web but i’m not sure how to apply this with puzzles.

    var vectorUp = new THREE.Vector3(0, 1, 0);
    // Left vector
    var coefficient = Player.SPEED * delta * this.q;
    this.v.copy(new THREE.Vector3().crossVectors(vectorUp, cameraLookVector).normalize().multiplyScalar(coefficient));
    var coefficient = Player.SPEED * delta * this.q;
    
    // Right vector
    this.v.copy(new THREE.Vector3(1, 0, 0).applyQuaternion(camera.quaternion).multiplyScalar(coefficient));

    Three.JS FPS Controls Strafing Left and Right

    Help…

    #30832

    Hi,
    This is quite easy to do with Puzzles. First, get horizontal object direction vector with the get object direction puzzle, then apply 90/-90 degrees rotation with vector math and then add to current object position using the same puzzle.

    Soft8Soft Tech Chief
    X | FB | LinkedIn

    #30847
    core3d
    Customer

    Yes it’s works thank you.

    #30855

    :good:

    Chief 3D Verger | LinkedIn | Twitter

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.