opengl渲染半个圆柱体
好的,我是 opengl 的新手,我仅使用核心 opengl 和 glut 创建一个台球游戏 我正在用 C++ 编写,
我知道如何绘制圆柱体:
{
GLUquadric *quadric = gluNewQuadric();
glBegin;
gluCylinder(quadric, 0.5f, 0.5f, 5.0f, 40, 40);
glEnd();
}
我想知道我是否可以将这个圆柱体减半,这样我就可以使用曲线来圆化我的桌子/口袋边缘 任何帮助伤口不胜感激谢谢
ok so im new to opengl and im creating a pool game using only the core opengl and glut
i am writing in c++
i know how to draw a cylinder:
{
GLUquadric *quadric = gluNewQuadric();
glBegin;
gluCylinder(quadric, 0.5f, 0.5f, 5.0f, 40, 40);
glEnd();
}
i want to know if i can half this cylinder so i can use the curve to round off my table/pocket edges
any help wound be appreciated thanks
函数 gluCylinder 过于具体,无法完成此操作。
glu 是作为 opengl 之上的一层构建的,因此如果高级绘图函数不能解决您的问题,您始终可以使用更低级的绘图函数。
本教程应该向您介绍 opengl 中的一些较低级别的绘图功能: http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=05
The function gluCylinder is too specific to accomplish this.
glu is built as a layer on top of opengl so you can always go to more low level drawing functions if the high level ones don't solve your problem.
This tutorial should give you an introduction to some of the lower level drawing functionality in opengl: http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=05