gluProject与gluUnProject

gluProject

The gluProject function maps object coordinates to window coordinates.

int gluProject( GLdouble objx, GLdouble objy, GLdouble objz, const GLdouble modelMatrix[16], const GLdouble projMatrix[16], const GLint viewport[4], GLdouble *winx, GLdouble *winy, GLdouble *winz ); 
Parameters
objx, objy, objz
The object coordinates.
modelMatrix
The current modelview matrix (as from a glGetDoublev call).
projMatrix
The current projection matrix (as from a glGetDoublev call).
viewport
The current viewport (as from a glGetIntegerv call).
winx, winy, winz
The computed window coordinates.
Remarks

The gluProject function transforms the specified object coordinates into window coordinates using modelMatrix, projMatrix, and viewport. The result is stored in winx, winy, and winz. A return value of GL_TRUE indicates success, and GL_FALSE indicates failure.

 

gluUnProject

The gluUnProject function maps window coordinates to object coordinates.

int gluUnProject( GLdouble winx, GLdouble winy, GLdouble winz, const GLdouble modelMatrix[16], const GLdouble projMatrix[16], const GLint viewport[4], GLdouble *objx, GLdouble *objy, GLdouble *objz ); 
Parameters
winx, winy, winz
The window coordinates to be mapped.
modelMatrix
The modelview matrix (as from a glGetDoublev call).
projMatrix
The projection matrix (as from a glGetDoublev call).
viewport
The viewport (as from a glGetIntegerv call).
objx, objy, objz
The computed object coordinates.
Return Values

If the function succeeds, the return value is GL_TRUE.

If the function fails, the return value is GL_FALSE.

Remarks

The gluUnProject function maps the specified window coordinates into object coordinates using modelMatrix, projMatrix, and viewport. The result is stored in objx, objy, and objz.

Requirements

  Windows NT/2000: Requires Windows NT 3.5 or later.
  Windows 95/98: Requires Windows 95 or later. Available as a redistributable for Windows 95.
  Header: Declared in Glu.h.
  Library: Use Glu32.lib.


源自:http://blog.sina.com.cn/s/blog_4bb59dc401016gwr.html





  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值