Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Orbit Controls does not use camera.lookAt value #26

Open
donpinkus opened this issue Oct 30, 2017 · 1 comment
Open

Orbit Controls does not use camera.lookAt value #26

donpinkus opened this issue Oct 30, 2017 · 1 comment

Comments

@donpinkus
Copy link

donpinkus commented Oct 30, 2017

Reproduce:

  1. Create a camera and set its lookAt value.
  2. Create orbit controls.

Issue:
After adding orbit controls, the camera is "looking at" the origin, not the camera's lookAt value.

How do you get the camera to lookAt a specific point when adding orbit controls?

Some example code:

  camera = new THREE.OrthographicCamera(
    globals.cameraDimensions.left,
    globals.cameraDimensions.right,
    globals.cameraDimensions.top,
    globals.cameraDimensions.bottom,
    1,
    2000
  );

  // Sets the position to a Vector3 angle, then sets the length.
  camera.position.set(0, 50, 100);
  camera.up = new THREE.Vector3(0, 1, 0);
  camera.lookAt(new THREE.Vector3(0, 50, 0));

  renderer = new THREE.WebGLRenderer({ alpha: true, antialias: true });
  renderer.setSize(window.innerWidth, window.innerHeight);
  document.body.appendChild(renderer.domElement);

  controls = new THREE.OrbitControls(camera, renderer.domElement);
@Place1
Copy link

Place1 commented Nov 30, 2017

just ran into this as well :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants