首页 > 文档 > camera()设置相机位置
2017
08-05

camera()设置相机位置

Name

camera()设置相机位置

   

Examples

camera()设置相机位置 - 第1张  | Processing编程艺术camera()设置相机位置 - 第2张  | Processing编程艺术camera()设置相机位置 - 第3张  | Processing编程艺术

size(100, 100, P3D);

noFill();

background(204);

camera(70.0, 35.0, 120.0, 50.0, 50.0, 0.0,

0.0, 1.0, 0.0);

translate(50, 50, 0);

rotateX(-PI/6);

rotateY(PI/3);

box(45);

Description

Sets the position of the camera through setting the eye position, the center of the scene, and which axis is facing upward. Moving the eye position and the direction it is pointing (the center of the scene) allows the images to be seen from different angles. The version without any parameters sets the camera to the default position, pointing to the center of the display window with the Y axis as up. The default values are camera(width/2.0, height/2.0, (height/2.0) / tan(PI*30.0 / 180.0), width/2.0, height/2.0, 0, 0, 1, 0). This function is similar to gluLookAt() in OpenGL, but it first clears the current camera settings.

设置相机的位置, 通过设置眼睛的位置, 场景的中心, 以及哪个轴朝上。移动眼睛位置和它指向的方向 (场景的中心) 允许从不同的角度看到图像。没有任何参数的版本将照相机设置为默认位置, 指向显示窗口的中心, 并将 Y 轴向上。默认值为照相机 (宽度/2.0、高度/2.0(高度/2.0)/tan (PI * 30.0/180.0)、宽度/2.0、高度/2.00010)。此函数与 OpenGL 中的 gluLookAt () 类似, 但它首先清除当前的照相机设置。

Syntax

camera()

camera(eyeX, eyeY, eyeZ, centerX, centerY, centerZ, upX, upY, upZ)

Parameters

eyeX

float: x-coordinate for the eye

眼睛的 x 坐标

eyeY

float: y-coordinate for the eye

眼睛的 y 坐标

eyeZ

float: z-coordinate for the eye

眼睛的 z 坐标

centerX

float: x-coordinate for the center of the scene

场景中心的 x 坐标

centerY

float: y-coordinate for the center of the scene

场景中心的 y 坐标

centerZ

float: z-coordinate for the center of the scene

场景中心的 z 坐标

upX

float: usually 0.0, 1.0, or -1.0

通常 0.0, 1.0, -10

upY

float: usually 0.0, 1.0, or -1.0

通常 0.0, 1.0, -10

upZ

float: usually 0.0, 1.0, or -1.0

通常 0.0, 1.0, -10

Returns

void

Related

beginCamera()
endCamera()
frustum()



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

留下一个回复

你的email不会被公开。