This project is read-only.

Moving the camera

To move the camera to a specific location use

sheetengine.scene.setCenter(targetp, targetpuv);
Parameters are:
  • targetp: target viewpoint of camera in world coordinates. JSON with x,y,z keys.
  • targetpuv: target viewpoint of camera in camera coordinates. JSON with u,v keys.
Either of the parameters can be omitted. To move the camera with a displacement vector use

sheetengine.scene.moveCenter(displacement, displacementuv);
Parameters are:
  • displacement: displacement vector in world coordinates. JSON with x,y,z keys.
  • displacementuv: displacement vector in camera coordinates. JSON with u,v keys.
Either of the parameters can be omitted.

Examples:

sheetengine.scene.setCenter({x:100, y:50, z:0});		// set xyz
sheetengine.scene.setCenter(null, {u:100, v:50});		// set uv
sheetengine.scene.moveCenter({x:10, y:10, z:0});		// displace with xyz
sheetengine.scene.moveCenter(null, {u:5, v:5});			// displace with uv

Last edited Dec 11, 2012 at 2:52 AM by dobsonl, version 1

Comments

No comments yet.