首页 > 文档 > beginCamera()开始相机
2017
08-05

beginCamera()开始相机

Name

beginCamera()开始相机

   

Examples

beginCamera()开始相机 - 第1张  | Processing编程艺术beginCamera()开始相机 - 第2张  | Processing编程艺术beginCamera()开始相机 - 第3张  | Processing编程艺术

size(100, 100, P3D);

noFill();

 

beginCamera();

camera();

rotateX(-PI/6);

endCamera();

 

translate(50, 50, 0);

rotateY(PI/3);

box(45);

Description

The beginCamera() and endCamera() functions enable advanced customization of the camera space. The functions are useful if you want to more control over camera movement, however for most users, the camera() function will be sufficient.

The camera functions will replace any transformations (such as rotate() or translate()) that occur before them in draw(), but they will not automatically replace the camera transform itself. For this reason, camera functions should be placed at the beginning of draw() (so that transformations happen afterwards), and the camera() function can be used after beginCamera() if you want to reset the camera before applying transformations.

This function sets the matrix mode to the camera matrix so calls such as translate()rotate(), applyMatrix() and resetMatrix() affect the camera. beginCamera() should always be used with a following endCamera() and pairs of beginCamera() and endCamera() cannot be nested.

beginCamera () endCamera () 函数允许对照相机空间进行高级自定义。如果你想对相机的运动有更多的控制, 这些函数是很有用的, 但是对于大多数用户来说, 相机 () 功能就足够了。

 

照相机功能将替换在绘图 () 中发生的任何转换 (例如旋转 () 或平移 ()), 但它们不会自动替换照相机转换本身。由于这个原因, 相机的功能应该放在开始的绘图 () (使转换发生后), 和相机 () 功能可以使用后, beginCamera (), 如果你想重置相机前应用转换。

 

此函数将矩阵模式设置为照相机矩阵, 这样调用 ()、旋转 ()applyMatrix () resetMatrix () 会影响相机。beginCamera () 应始终与以下 endCamera () 和对 beginCamera () endCamera () 不能嵌套。

Syntax

beginCamera()

Returns

void

Related

camera()
endCamera()
applyMatrix()
resetMatrix()
translate()
scale()



最后编辑:
作者:卡萨布兰卡
这个作者貌似有点懒,什么都没有留下。

留下一个回复

你的email不会被公开。