找回密碼
 注冊帳號

掃一掃,訪問微社區

camera 攝像機

2015-1-4 03:07| 發布者: 楊炎| 查看: 2435| 評論: 0|原作者: 蠻牛|來自: unity3d腳本manual

摘要: camera 攝像機inherits frombehavioura camera is a device through which the player views the world.camera是一個設備,玩家通過它看世界。a screen space point is defined in pixels. the bottom-left of the s ...

camera 攝像機

inherits frombehaviour

a camera is a device through which the player views the world.

camera是一個設備,玩家通過它看世界。

a screen space point is defined in pixels. the bottom-left of the screen is (0,0); the right-top is (pixelwidth,pixelheight). the z position is in world units from the camera.

屏幕空間點用像素定義,屏幕的左下為(0,0);右上是(pixelwidth,pixelheight).z的位置是以世界單位衡量的到相機的距離。

a viewport space point is normalized and relative to the camera. the bottom-left of the camera is (0,0); the top-right is (1,1). the z position is in world units from the camera.

視口空間點是歸一化的并相對于相機的。相機的左下為(0,0);右上是(1,1);z的位置是以世界為單位衡量的到相機的距離。

a world space point is defined in global coordinates (eg.transform.position).

世界空間點是以全局坐標定義的(例如:transform.position)

variables變量

fieldofview

the field of view of the camera in degrees.

相機的視野,以度為單位。

nearclipplane

the near clipping plane distance.

裁剪面的距離。

farclipplane

the far clipping plane distance.

遠裁剪面的距離。

renderingpath

rendering path.

渲染路徑。

actualrenderingpath

actually used rendering path (read only).

實際使用的渲染路徑(只讀)。

orthographicsize

camera's half-size when in orthographic mode.

在正交模式下相機的一半尺寸。

orthographic

is the camera orthographic (true) or perspective (false)?

相機是正交的(true),是透視的(false)?

depth

camera's depth in the camera rendering order.

相機在渲染順序上的深度。

aspect

the aspect ratio (width divided by height).

長寬比(寬度除以高度)。

cullingmask

this is used to render parts of the scene selectively.

這個用來選擇性的渲染部分場景。

backgroundcolor

the color with which the screen will be cleared.

屏幕將被清理為這個顏色。

rect

where on the screen is the camera rendered in normalized coordinates.

相繼被渲染到屏幕規范化坐標中的位置。

pixelrect

where on the screen is the camera rendered in pixel coordinates.

相機被渲染到屏幕像素中的位置。

targettexture

destination render texture (unity pro only).

描述渲染紋理(僅unity專業版)。

pixelwidth

how wide is the camera in pixels (read only).

相機有多寬,以像素單位(只讀)。

pixelheight

how tall is the camera in pixels (read only).

相機有多高,以像素單位(只讀)。

cameratoworldmatrix

matrix that transforms from camera space to world space (read only).

從相機空間到世界空間的變換矩陣(只讀)。

worldtocameramatrix

matrix that transforms from world to camera space.

從世界到相機空間的變換矩陣。

projectionmatrix

set a custom projection matrix.

設置自定義的投影矩陣。

velocity

get the world-space speed of the camera (read only).

獲取世界空間中相機的速度(只讀)。

clearflags

how the camera clears the background.

相機如何清除背景。

layerculldistances

per-layer culling distances.

每層的消隱距離。

depthtexturemode

how and if camera generates a depth texture.

相機生成怎樣的一個深度紋理。

functions函數

resetworldtocameramatrix

make the rendering position reflect the camera's position in the scene.

在場景中讓渲染位置反映相機的位置。

resetprojectionmatrix

make the projection reflect normal camera's parameters.

讓投影反映正常的相機參數。

resetaspect

revert the aspect ratio to the screen's aspect ratio.

恢復長寬比為屏幕的長寬比。

worldtoscreenpoint

transforms position from world space into screen space.

從世界空間到屏幕空間變換位置。

worldtoviewportpoint

transforms position from world space into viewport space.

從世界空間到視窗空間的變換位置。

viewporttoworldpoint

transforms position from viewport space into world space.

從視窗空間到世界空間的變換位置。

screentoworldpoint

transforms position from screen space into world space.

從屏幕空間到世界空間的變化位置。

screentoviewportpoint

transforms position from screen space into viewport space.

從屏幕空間到視窗空間的變換位置。

viewporttoscreenpoint

transforms position from viewport space into screen space.

從視口空間到屏幕空間的變換位置。

viewportpointtoray

returns a ray going from camera through a viewport point.

返回從相機出發穿過視點的一個射線。

screenpointtoray

returns a ray going from camera through a screen point.

返回一條射線從攝像機通過一個屏幕點。

render

render the camera manually.

手動渲染相機。

renderwithshader

render the camera with shader replacement.

用shader替代渲染相機。

setreplacementshader

make the camera render with shader replacement.

使相機渲染用shader替換。

resetreplacementshader

remove shader replacement from camera.

從相機上移除shader替換。

rendertocubemap

render into a cubemap from this camera.

從這個相機渲染到一個立方貼圖。

copyfrom

makes this camera's settings match other camera.

使這個相機的設置與其他相機相同。

messages sent發送消息

onprecull

onprecull is called before a camera culls the scene.

onprecull在相機開始裁剪場景之前調用。

onprerender

onprerender is called before a camera starts rendering the scene.

onprerender在相機開始渲染場景之前調用。

onpostrender

onpostrender is called after a camera has finished rendering the scene.

onpostrender

相關閱讀

文章點評
相關文章
女校游泳队彩金