|
@@ -13,14 +13,13 @@
|
|
|
<h1>[name]</h1>
|
|
|
|
|
|
<p class="desc">
|
|
|
- Camera that uses [link:https://en.wikipedia.org/wiki/Perspective_(graphical) perspective projection].<br /><br />
|
|
|
+ 使用[link:https://en.wikipedia.org/wiki/Perspective_(graphical) perspective projection]的摄像机。<br /><br />
|
|
|
|
|
|
- This projection mode is designed to mimic the way the human eye sees. It is the most
|
|
|
- common projection mode used for rendering a 3D scene.
|
|
|
+ 这种投影模式旨在模仿人眼看到的方式。它是用于渲染3D场景的最常见投影模式。
|
|
|
</p>
|
|
|
|
|
|
|
|
|
- <h2>Example</h2>
|
|
|
+ <h2>例子</h2>
|
|
|
|
|
|
<p>[example:canvas_geometry_birds geometry / birds ]</p>
|
|
|
<p>[example:canvas_geometry_cube geometry / cube ]</p>
|
|
@@ -34,126 +33,119 @@
|
|
|
scene.add( camera );</code>
|
|
|
|
|
|
|
|
|
- <h2>Constructor</h2>
|
|
|
+ <h2>构造函数</h2>
|
|
|
|
|
|
<h3>[name]( [param:Number fov], [param:Number aspect], [param:Number near], [param:Number far] )</h3>
|
|
|
<p>
|
|
|
- fov — Camera frustum vertical field of view.<br />
|
|
|
- aspect — Camera frustum aspect ratio.<br />
|
|
|
- near — Camera frustum near plane.<br />
|
|
|
- far — Camera frustum far plane.<br /><br />
|
|
|
+ fov — 摄像机视锥体垂直视野。<br />
|
|
|
+ aspect — 摄像机视锥体宽高比。<br />
|
|
|
+ near — 摄像机视锥体近平面。<br />
|
|
|
+ far — 摄像机视锥体远平面。<br /><br />
|
|
|
|
|
|
- Together these define the camera's [link:https://en.wikipedia.org/wiki/Viewing_frustum viewing frustum].
|
|
|
+ 这些一起定义了摄像机的[link:https://en.wikipedia.org/wiki/Viewing_frustum viewing frustum]。
|
|
|
</p>
|
|
|
|
|
|
|
|
|
- <h2>Properties</h2>
|
|
|
+ <h2>属性</h2>
|
|
|
<p>
|
|
|
- See the base [page:Camera] class for common properties.<br>
|
|
|
- Note that after making changes to most of these properties you will have to call
|
|
|
- [page:PerspectiveCamera.updateProjectionMatrix .updateProjectionMatrix] for the changes to take effect.
|
|
|
+ 参阅基类[page:Camera]的公共属性。<br>
|
|
|
+ 请注意,在对大多数这些属性进行更改后,必须调用[page:PerspectiveCamera.updateProjectionMatrix .updateProjectionMatrix]才能使更改生效。.
|
|
|
</p>
|
|
|
|
|
|
<h3>[property:Float aspect]</h3>
|
|
|
- <p>Camera frustum aspect ratio, usually the canvas width / canvas height. Default is *1* (square canvas).</p>
|
|
|
+ <p>摄像机视锥体宽高比。默认是画布宽度/画布高度。默认值为*1*(方形画布)。</p>
|
|
|
|
|
|
<h3>[property:Float far]</h3>
|
|
|
<p>
|
|
|
- Camera frustum far plane. Default is *2000*.<br /><br />
|
|
|
+ 摄像机视锥体远平面。 默认值为*2000*。<br /><br />
|
|
|
|
|
|
- The valid range is between the current value of the [page:.near near] plane and infinity.
|
|
|
+ 有效范围介于[page:.near]平面的当前值和无穷远之间。
|
|
|
</p>
|
|
|
|
|
|
<h3>[property:Float filmGauge]</h3>
|
|
|
- <p>Film size used for the larger axis. Default is 35 (millimeters). This parameter does not influence the projection matrix unless .filmOffset is set to a nonzero value.</p>
|
|
|
+ <p>用于较大轴的胶片尺寸。默认值为35 (毫米)。 除非.filmOffset设置为非零值,否则此参数不会影响投影矩阵。</p>
|
|
|
|
|
|
<h3>[property:Float filmOffset]</h3>
|
|
|
- <p>Horizontal off-center offset in the same unit as .filmGauge. Default is *0*.</p>
|
|
|
+ <p>与.filmGauge相同单位的水平偏中心偏移。默认值为0。</p>
|
|
|
|
|
|
<h3>[property:Float focus]</h3>
|
|
|
- <p>Object distance used for stereoscopy and depth-of-field effects.
|
|
|
- This parameter does not influence the projection matrix unless a [page:StereoCamera] is being used.
|
|
|
- Default is *10*.
|
|
|
+ <p>用于立体视觉和景深效果的物距。
|
|
|
+ 除非使用[page:StereoCamera],否则此参数不会影响投影矩阵。默认值为*10*。
|
|
|
</p>
|
|
|
|
|
|
<h3>[property:Float fov]</h3>
|
|
|
- <p>Camera frustum vertical field of view, from bottom to top of view, in degrees. Default is *50*.</p>
|
|
|
+ <p>摄像机视锥体垂直视野,从底部到顶部,以度为单位。默认值为*50*。</p>
|
|
|
|
|
|
<h3>[property:Boolean isPerspectiveCamera]</h3>
|
|
|
<p>
|
|
|
- Used to test whether this or derived classes are PerspectiveCameras. Default is *true*.<br /><br />
|
|
|
+ 用于测试此类或派生类是否为透视摄像机。默认为*true*。<br /><br />
|
|
|
|
|
|
- This should not be changed as it is used internally by the renderer for optimisation.
|
|
|
+ 这不应该更改,因为渲染器在内部使用它进行优化。
|
|
|
</p>
|
|
|
|
|
|
|
|
|
<h3>[property:Float near]</h3>
|
|
|
<p>
|
|
|
- Camera frustum near plane. Default is *0.1*.<br /><br />
|
|
|
+ 摄像机视锥体的近平面,默认值为*0.1*。<br /><br />
|
|
|
|
|
|
- The valid range is greater than 0 and less than the current value of the [page:.far far] plane.
|
|
|
- Note that, unlike for the [page:OrthographicCamera], *0* is <em>not</em> a valid value
|
|
|
- for a PerspectiveCamera's near plane.
|
|
|
+ 有效范围大于0且小于远平面的当前值。需要注意的是,与正交摄像机不同,对于透视摄像机的近平面,0不是一个有效值。
|
|
|
</p>
|
|
|
|
|
|
<h3>[property:Object view]</h3>
|
|
|
<p>
|
|
|
- Frustum window specification or null.
|
|
|
- This is set using the [page:PerspectiveCamera.setViewOffset .setViewOffset] method
|
|
|
- and cleared using [page:PerspectiveCamera.clearViewOffset .clearViewOffset].
|
|
|
+ 视锥体窗口规范或null。这是使用[page:PerspectiveCamera.setViewOffset .setViewOffset]方法设置,
|
|
|
+ 并使用[page:PerspectiveCamera.clearViewOffset .clearViewOffset]清除。
|
|
|
</p>
|
|
|
|
|
|
<h3>[property:number zoom]</h3>
|
|
|
- <p>Gets or sets the zoom factor of the camera. Default is *1*.</p>
|
|
|
+ <p>获取或设置摄像机的缩放系数。默认值为*1*。</p>
|
|
|
|
|
|
|
|
|
- <h2>Methods</h2>
|
|
|
- <p>See the base [page:Camera] class for common methods.</p>
|
|
|
+ <h2>方法</h2>
|
|
|
+ <p>参阅基类[page:Camera]的公共方法。</p>
|
|
|
|
|
|
<h3>[method:null clearViewOffset]()</h3>
|
|
|
- <p>Removes any offset set by the [page:PerspectiveCamera.setViewOffset .setViewOffset] method.</p>
|
|
|
+ <p>删除[page:PerspectiveCamera.setViewOffset .setViewOffset]方法设置的任何偏移量。</p>
|
|
|
|
|
|
<h3>[method:Float getEffectiveFOV]()</h3>
|
|
|
- <p>Returns the current vertical field of view angle in degrees considering .zoom.</p>
|
|
|
+ <p>考虑.zoom,返回当前垂直视角范围(以度为单位)。</p>
|
|
|
|
|
|
<h3>[method:Float getFilmHeight]()</h3>
|
|
|
<p>
|
|
|
- Returns the height of the image on the film. If .aspect is less than or equal to one
|
|
|
- (portrait format), the result equals .filmGauge.
|
|
|
+ 返回胶片上图像的高度。如果.aspect小于或等于1(纵向格式),则结果等于.filmGauge。
|
|
|
</p>
|
|
|
|
|
|
<h3>[method:Float getFilmWidth]()</h3>
|
|
|
<p>
|
|
|
- Returns the width of the image on the film. If .aspect is greater than or equal to one
|
|
|
- (landscape format), the result equals .filmGauge.
|
|
|
+ 返回胶片上图像的宽度。如果.aspect大于或等于1(横向格式),则结果等于.filmGauge。
|
|
|
</p>
|
|
|
|
|
|
<h3>[method:Float getFocalLength]()</h3>
|
|
|
- <p>Returns the focal length of the current .fov in respect to .filmGauge.</p>
|
|
|
+ <p>返回.filmGauge当前.fov的焦距。</p>
|
|
|
|
|
|
<h3>[method:null setFocalLength]( [param:Float focalLength] )</h3>
|
|
|
<p>
|
|
|
- Sets the FOV by focal length in respect to the current [page:PerspectiveCamera.filmGauge .filmGauge].<br /><br />
|
|
|
-
|
|
|
- By default, the focal length is specified for a 35mm (full frame) camera.
|
|
|
+ 根据当前[page:PerspectiveCamera.filmGauge .filmGauge]的焦距设置FOV。<br /><br />
|
|
|
+ 默认情况下,焦距是为35mm(全画幅)摄像机指定的。
|
|
|
</p>
|
|
|
|
|
|
<h3>[method:null setViewOffset]( [param:Float fullWidth], [param:Float fullHeight], [param:Float x], [param:Float y], [param:Float width], [param:Float height] )</h3>
|
|
|
<p>
|
|
|
- fullWidth — full width of multiview setup<br />
|
|
|
- fullHeight — full height of multiview setup<br />
|
|
|
- x — horizontal offset of subcamera<br />
|
|
|
- y — vertical offset of subcamera<br />
|
|
|
- width — width of subcamera<br />
|
|
|
- height — height of subcamera
|
|
|
+ fullWidth — 多视图设置的全宽度<br />
|
|
|
+ fullHeight — 多视图设置的全高度<br />
|
|
|
+ x — 子摄像机的水平偏移<br />
|
|
|
+ y — 子摄像机的竖直偏移<br />
|
|
|
+ width — 子摄像机宽度<br />
|
|
|
+ height — 子摄像机高度
|
|
|
</p>
|
|
|
|
|
|
<p>
|
|
|
- Sets an offset in a larger frustum. This is useful for multi-window or multi-monitor/multi-machine setups.
|
|
|
+ 在较大的视锥体中设置偏移。
|
|
|
+ 这对于多窗口或多显示器/多机器设置很有用。
|
|
|
</p>
|
|
|
|
|
|
<p>
|
|
|
- For example, if you have 3x2 monitors and each monitor is 1920x1080 and the monitors are in grid like this:<br />
|
|
|
+ 例如,如果你有3x2显示器,每个显示器是1920x1080,显示器是这样的网格:<br />
|
|
|
|
|
|
<pre>
|
|
|
+---+---+---+
|
|
@@ -163,7 +155,7 @@ scene.add( camera );</code>
|
|
|
+---+---+---+
|
|
|
</pre>
|
|
|
|
|
|
- then for each monitor you would call it like this:<br />
|
|
|
+ 然后对于每个监视器,你会这样调用它: <br />
|
|
|
|
|
|
<code>var w = 1920;
|
|
|
var h = 1080;
|
|
@@ -184,20 +176,20 @@ camera.setViewOffset( fullWidth, fullHeight, w * 1, h * 1, w, h );
|
|
|
camera.setViewOffset( fullWidth, fullHeight, w * 2, h * 1, w, h );
|
|
|
</code>
|
|
|
|
|
|
- Note there is no reason monitors have to be the same size or in a grid.
|
|
|
+ 注意监视器没有理由必须是相同的大小或在一个网格中。
|
|
|
</p>
|
|
|
|
|
|
<h3>[method:null updateProjectionMatrix]()</h3>
|
|
|
<p>
|
|
|
- Updates the camera projection matrix. Must be called after any change of parameters.
|
|
|
+ 更新摄像机的投影矩阵。必须在更改参数后调用。
|
|
|
</p>
|
|
|
|
|
|
<h3>[method:JSON toJSON]()</h3>
|
|
|
<p>
|
|
|
- Return camera data in JSON format.
|
|
|
+ 以JSON格式返回摄像机的数据。
|
|
|
</p>
|
|
|
|
|
|
- <h2>Source</h2>
|
|
|
+ <h2>源代码</h2>
|
|
|
|
|
|
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
|
|
|
</body>
|