Noob need help with Cameras

Hi Guys,

I’m just starting out with threejs and having a difficult time understanding how to position camera properly to get the effects I’m looking for. I’m trying to create simple views like Top, Left, Right, Front, SW Iso, SE Iso. Looking for some help to cut down my learning curve so i can get to building instead of being here with a flat tire.

I’m trying to create a floor plan for like a home and then have the user place objects within it. But the dimensions of the floor plan is always different so the view size cannot be static

Thanks
Joe

The two primary elements of animating the camera are

  1. Position
  2. Orientation

With those 2 in mind, you can easily set your camera any way you want:

var cam = new THREE.PerspectiveCam...

// Places camera in the place you want
var camPos = new THREE.Vector3(0, 10, 0);
cam.position.copy(camPos);

// Points camera to look at position you want
var lookPos = new THREE.Vector3(0, 0, 0);
cam.lookAt(lookPos);

The above coordinates will give you a top-down view, because camera is placed up 10 in the y-axis, and looking at 0, 0, 0

These links might be helpful:




You can try out the basic examples right away and view the code:

directly http://discourse.threejs.hofk.de/

2 Likes