0

well i wants to reset the position and the rotation, when i am using the PointerLockControls. Currently i use

controls.getObject().position.set( -30, 10, 80 );
controls.getObject().position.y = 10; 

for the position. But how can i reset the rotation?

I tried different things like:

camera.lookAt(new THREE.Vector3(1,0,0));
camera.rotation.x = - Math.PI / 2;
controls.getObject().rotation.x = 0;
controls.getObject().rotation.y = 0;
controls.updateProjectionMatrix();
...

Have you an idea?

Greeting, Johannes

1
  • You can now accept your own answer by clicking on the check mark. Commented Nov 16, 2013 at 13:51

1 Answer 1

3

I figured it out

controls.getObject().rotation.y = 0; // Rotates Yaw Object
controls.getObject().children[0].rotation.x = 0; // Rotates the Pitch Object

Now, the Camera is looking in the original direction!

three.js r.62

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.