1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- <h1>PerspectiveCamera ← <a href="javascript:goTo('cameras/Camera')">Camera</a> ← <a href="javascript:goTo('core/Object3D')">Object3D</a></h1>
- <div>Camera with perspective projection.</div>
- <h2>Example</h2>
- <code>var camera = new THREE.PerspectiveCamera( 45, window.innerWidth / window.innerHeight, 1, 1000 );
- scene.add( camera );
- </code>
- <h2>Constructor</h2>
- <h3>PerspectiveCamera( fov <a href="javascript:goTo('core/Number')">Number</a>, aspect <a href="javascript:goTo('core/Number')">Number</a>, near <a href="javascript:goTo('core/Number')">Number</a>, far <a href="javascript:goTo('core/Number')">Number</a> )</h3>
- <h2>Properties</h2>
- <h3>fov <a href="javascript:goTo('core/Number')">Number</a></h3>
- <div>Camera frustum vertical field of view.</div>
- <h3>aspect <a href="javascript:goTo('core/Number')">Number</a></h3>
- <div>Camera frustum aspect ratio.</div>
- <h3>near <a href="javascript:goTo('core/Number')">Number</a></h3>
- <div>Camera frustum near plane.</div>
- <h3>far <a href="javascript:goTo('core/Number')">Number</a></h3>
- <div>Camera frustum far plane.</div>
- <h2>Methods</h2>
- <h3>setLens( focalLength <a href="javascript:goTo('core/Number')">Number</a>, frameSize <a href="javascript:goTo('core/Number')">Number</a> )</h3>
- <div>
- Uses focal length (in mm) to estimate and set FOV 35mm (fullframe) camera is used if frame size is not specified.<br />
- Formula based on <a href="http://www.bobatkins.com/photography/technical/field_of_view.html" target="_blank">http://www.bobatkins.com/photography/technical/field_of_view.html</a>
- </div>
- <h3>setViewOffset( fullWidth <a href="javascript:goTo('core/Number')">Number</a>, fullHeight <a href="javascript:goTo('core/Number')">Number</a>, x <a href="javascript:goTo('core/Number')">Number</a>, y <a href="javascript:goTo('core/Number')">Number</a>, width <a href="javascript:goTo('core/Number')">Number</a>, height <a href="javascript:goTo('core/Number')">Number</a> )</h3>
- <div>
- Sets an offset in a larger frustum. This is useful for multi-window or multi-monitor/multi-machine setups.<br /><br />
- For example, if you have 3x2 monitors and each monitor is 1920x1080 and the monitors are in grid like this:<br /><br />
- <pre>+---+---+---+
- | A | B | C |
- +---+---+---+
- | D | E | F |
- +---+---+---+
- </pre>
- then for each monitor you would call it like this:<br /><br />
- <code>var w = 1920;
- var h = 1080;
- var fullWidth = w * 3;
- var fullHeight = h * 2;
- // --A--
- camera.setOffset( fullWidth, fullHeight, w * 0, h * 0, w, h );
- //--B--
- camera.setOffset( fullWidth, fullHeight, w * 1, h * 0, w, h );
- //--C--
- camera.setOffset( fullWidth, fullHeight, w * 2, h * 0, w, h );
- //--D--
- camera.setOffset( fullWidth, fullHeight, w * 0, h * 1, w, h );
- //--E--
- camera.setOffset( fullWidth, fullHeight, w * 1, h * 1, w, h );
- //--F--
- camera.setOffset( fullWidth, fullHeight, w * 2, h * 1, w, h );
- </code><br />
- Note there is no reason monitors have to be the same size or in a grid.
- </div>
- <h3>updateProjectionMatrix()</h3>
- <div>
- Updates camera's projection matrix. Must be called after change of parameters.
- </div>
- <h2>Source</h2>
- <div><a href="https://github.com/mrdoob/three.js/blob/master/src/cameras/PerspectiveCamera.js" target="_blank">src/cameras/PerspectiveCamera.js</a></div>
|