首页 > 文档 > sphereDetail()球面分辨率
2017
08-01

sphereDetail()球面分辨率

Name

sphereDetail()球面分辨率

   

Examples

void setup() {

size(100, 100, P3D);

}

 

void draw() {

background(200);

stroke(255, 50);

translate(50, 50, 0);

rotateX(mouseY * 0.05);

rotateY(mouseX * 0.05);

fill(mouseX * 2, 0, 160);

sphereDetail(mouseX / 4);

sphere(40);

}

Description

Controls the detail used to render a sphere by adjusting the number of vertices of the sphere mesh. The default resolution is 30, which creates a fairly detailed sphere definition with vertices every 360/30 = 12 degrees. If you’re going to render a great number of spheres per frame, it is advised to reduce the level of detail using this function. The setting stays active until sphereDetail() is called again with a new parameter and so should not be called prior to every sphere() statement, unless you wish to render spheres with different settings, e.g. using less detail for smaller spheres or ones further away from the camera. To control the detail of the horizontal and vertical resolution independently, use the version of the functions with two parameters.

通过调整球面网格的顶点数来控制用于呈现球体的细节。默认分辨率为 30, 它创建一个相当详细的球体定义, 每个顶点每 360/30 = 12 度。如果要在每个帧中呈现大量的球体, 建议使用此函数降低细节级别。该设置保持活动状态, 直到 sphereDetail () 再次用新参数调用, 因此不应在每个球体 () 语句之前调用, 除非您希望渲染具有不同设置的球体, 例如对较小的球体使用更少的细节, 或远离摄像机的部分。要独立控制水平和垂直分辨率的细节, 请使用具有两个参数的函数的版本。

Syntax

sphereDetail(res)

sphereDetail(ures, vres)

Parameters

res

int: number of segments (minimum 3) used per full circle revolution

整数型:每圈使用的段数(最少3)

ures

int: number of segments used longitudinally per full circle revolution

整数型:纵向每圈使用的段数

vres

int: number of segments used latitudinally from top to bottom

整数型:从上到下使用的段数

Returns

void

Related

sphere()



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

留下一个回复

你的email不会被公开。