首页 > 文档 > frustum()截锥
2017
08-07

frustum()截锥

Name

frustum()截锥

   

Examples

frustum()截锥 - 第1张  | Processing编程艺术

size(100, 100, P3D);

noFill();

background(204);

frustum(-10, 0, 0, 10, 10, 200);

rotateY(PI/6);

box(45);

Description

Sets a perspective matrix as defined by the parameters.

A frustum is a geometric form: a pyramid with its top cut off. With the viewer’s eye at the imaginary top of the pyramid, the six planes of the frustum act as clipping planes when rendering a 3D view. Thus, any form inside the clipping planes is rendered and visible; anything outside those planes is not visible.

Setting the frustum has the effect of changing the perspective with which the scene is rendered. This can be acheived more simply in many cases by using perspective().

Note that the near value must be greater than zero (as the point of the frustum “pyramid” cannot converge “behind” the viewer). Similarly, the far value must be greater than the near value (as the “far” plane of the frustum must be “farther away” from the viewer than the near plane).

Works like glFrustum, except it wipes out the current perspective matrix rather than multiplying itself with it.

设置由参数定义的透视矩阵。

 

截锥是一种几何形式: 它的顶端被切断的金字塔。随着观众的眼睛在金字塔的假想顶部, 在渲染3D 视图时, 六个截锥的平面充当修剪平面。因此, 修剪平面内的任何形式都呈现和可见;那些飞机以外的东西是看不到的。

 

设置截锥具有改变场景渲染角度的效果。在许多情况下, 使用透视 () 可以更简单地实现这一点。

 

请注意, 近值必须大于零 (因为截锥棱锥图的点不能收敛于查看器后面)。同样, 远值必须大于近值 (因为的截锥的平面必须比近平面远离查看器)

 

工作像 glFrustum, 除了它擦除当前的透视矩阵, 而不是乘以它自己。

Syntax

frustum(left, right, bottom, top, near, far)

Parameters

left

float: left coordinate of the clipping plane

修剪平面的左坐标

right

float: right coordinate of the clipping plane

修剪平面的右坐标

bottom

float: bottom coordinate of the clipping plane

修剪平面的底部坐标

top

float: top coordinate of the clipping plane

修剪平面的顶部坐标

near

float: near component of the clipping plane; must be greater than zero

修剪平面的近分量;必须大于零

far

float: far component of the clipping plane; must be greater than the near value

修剪平面的远的组分;必须大于近值

   

Returns

void

Related

camera()
beginCamera()
endCamera()
perspective()



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

留下一个回复

你的email不会被公开。