Precise camera location and focal length?

 From:  Michael Gibson
8476.3 In reply to 8476.1 
Hi Dejan, try setting the following script on a shortcut key, under Options > Shortcut keys:

script: /* set view position and angle */ var vm = moi.vectorMath; var eye = vm.createPoint( 4, 0, 1.75 ); var lookat = vm.createPoint( 0, 0, 0 ); vp = moi.ui.mainWindow.viewpanel.getViewport('3D'); vp.setCameraAndTarget( eye, lookat ); var focal_length = 45; var angle = Math.atan2(12,focal_length) * 360.0 / Math.PI; vp.fieldOfViewAngle = angle;

Copy/paste the entire script above into the "command" part of the shortcut key. Then you can trigger it by pushing that key.

You may need to adjust the coordinates for the eye point, it's set to x = 4, y = 0, z = 1.75 in the script there, modify it to whatever location you need.

To set that as the default for when you initially start up MoI, save out a .3dm file with the view set up how you want it and then set that .3dm file as the startup template under Options > General > Template file. Then MoI should get the initial views from that file when you start up MoI or do a File > New.

- Michael