opengl高手请入

xcl293 2003-12-15 09:36:01
我利用vb开发opengl三维图形程序
opengl是用c开发的图形开发接口。
其中有个剖面命令glclipplane,
在c里面是这么实现的
gldouble equation[4]={0.0,1.0,0.0,0.0}
glclipplane(plane0,equation)

equation数组里面四个数是一个平面plane0,ax+by+cz+d=0的a,b,c,d四个系数
glclipplane命令把数组equation中四个数付给平面plane0,然后做出这个剖面

现在我不知道在vb里面怎么实现这个剖面命令,
vb里面也有glclipplane,但是这里面equation数组该怎么调用,我不会
我查资料,看到有这样的定义
declare sub glclipplane (glenum plane, const byval # * equation)
高人指点,我该怎么用这个命令
...全文
36 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
wangzi163 2003-12-15
  • 打赏
  • 举报
回复
学习

byry 2003-12-15
  • 打赏
  • 举报
回复
CSDN:
glGetClipPlane
The glGetClipPlane function returns the coefficients of the specified clipping plane.

void glGetClipPlane(
GLenum plane,
GLdouble *equation
);
Parameters
plane
A clipping plane. The number of clipping planes depends on the implementation, but at least six clipping planes are supported. They are identified by symbolic names of the form GL_CLIP_PLANEi where 0 ≤ i < GL_MAX_CLIP_PLANES.
equation
Returns four double-precision values that are the coefficients of the plane equation of plane in eye coordinates.
Remarks
The glGetClipPlane function returns in equation the four coefficients of the plane equation for plane.

It is always the case that GL_CLIP_PLANEi = GL_CLIP_PLANE0 + i.

If an error is generated, no change is made to the contents of equation.

Error Codes
The following are the error codes generated and their conditions.

Error code Condition
GL_INVALID_ENUM plane was not an accepted value.
GL_INVALID_OPERATION glGetClipPlane was called between a call to glBegin and the corresponding call to glEnd.
byry 2003-12-15
  • 打赏
  • 举报
回复
OPENGL下做剖切好像不是强项,在AUTOCAD下面编程做剖切我倒是刚做了一个
xcl293 2003-12-15
  • 打赏
  • 举报
回复
谢谢!
heavenchang 2003-12-15
  • 打赏
  • 举报
回复
vb我也不太清楚,
你可以看一看nehe 的教程,有翻译了一部分的,在中国游戏开发者,
你也可以看看 nehe的教程。
中文教程网址
http://www.chinagamedev.net/cgd/develop/opengl/200110/NeHeOpenGL.1.htm
还有E文的
http://nehe.gamedev.net/

呵呵,自己看看,希望对你有帮助!
xcl293 2003-12-15
  • 打赏
  • 举报
回复
我调用了,但是出现
byref参数类型不符
另外
问你一下opengl有没有别的做剖面的命令阿???
byry 2003-12-15
  • 打赏
  • 举报
回复
VB我不会,但是equation也应该是数组形式,该怎么定义这个数组你应该晓得
如果没错的话这样调用也应该可以
glclipplane(plane0,equation)

19,468

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 图形处理/算法
社区管理员
  • 图形处理/算法社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧