gpt4 book ai didi

OpenGL/GLU : Is there a built-in function for drawing circles?

转载 作者:行者123 更新时间:2023-12-02 01:39:39 24 4
gpt4 key购买 nike

我知道有用于绘制矩形的内置函数(例如 glRecti()),并且认为圆也是一个非常基本的用法。

有没有这种画圆的内置函数?或者我应该总是自己实现它?

最佳答案

gluDisk() can be used to do so :

void gluDisk(GLUquadricObj *obj,
GLdouble innerRadius, GLdouble outerRadius,
GLint slices, GLint loops)

innerRadius and outerRadius control the size of the hole and disk.

Set innerRadius to 0.0 to render a solid circle.
slices: number of sides to disk (eg. 3 for equilateral triangle, 6 for a washer 20 for a circle).
loops: number of concentric rings rendered eg. 1 for circles 2 for washers. Using larger values for loops improves specular lighting and the effect of spotlights.



Official manpage .

关于OpenGL/GLU : Is there a built-in function for drawing circles?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29176841/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com