Acrobat User Community

Adding views using the CameraRotate JavaScript

By Tony DeYoungJanuary 24, 2006

By default, the CameraRotate.js [JS: 16 KB] script overrides the camera movement and view management in Acrobat 3D. For example, if you activate the selected view from a button and move the object (with CameraRotate.js enabled), the view will return to the position set from the camera before the button is clicked.

If you want to save views you have to set the parameters yourself using the following examples:

//Example code (untested) 
//Add this to the cameraRotate.js 
//Angles should be in radians 
var CameraView1 = new CameraPosition(new Vector3(0,0,0), 0.7, 0, 10); 
//Add this code to a button 
var context = getAnnots3D(0)[0].context3D; 
context.CameraController.setCameraPos(CameraView1);