1

I've a demo with a 3D model, work with webGL and Three.js, i import orbit, set it and everything work with it. Now i've the problem to restore a camera position after i've change it with orbit gesture.

The problem is that i want a button that on click repositioning the camera in a way that the model seems to be in a isometric position.

3
  • 1
    Have you tried camera.position.set() + controls.target.set() and then animate() ? An isometric view would have angles of 60/120° (you can also use rotation), but 'isometry' means ortho mode ... Commented Jan 22, 2014 at 18:50
  • Yes i've found the solution and the problem is only geometric. I use position set and callculate the axys delta rotation angle to reset the rotation. Commented Jan 30, 2014 at 10:45
  • I post my solution below. Commented Jan 31, 2014 at 9:44

1 Answer 1

2

I found that the best solution is the banal one.

  1. Position in the classic way the camera and object to lookAt a isonometric vector

    this.camera.position.set(x,y,z);
    
  2. Save this position as start position:

    this.startPosition = this.camera.position.clone();
    
  3. Use this vector to restore the initial position after Orbit had changed it:

    this.camera.position.set(this.startPosition.x, this.startPosition.y, this.startPosition.z);
    

This is more simple that calculate the rotation's angle computer by orbit and for my porpouse work pretty well.

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

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.