Skip to main content
gamedev.net
🔒 Locked

Picking an object / Object selection

Started by Meesa 2 replies 350+ views
Original Post
Meesa
Meesa
I am trying to implement object selection using gluPickMatrix(). I am developing my program using SDI application in .NET. OpenGL is drawn in CView. I have a problem of getting viewport value glGetIntegerv(GL_VIEWPORT,viewport). It does not return valid value. I skipped the above problem when using gluPickMatrix with the value of CView width and height gluPickMatrix((double)x,(double)(WindowCView.viewport[3]-y),5.0,5.0f,WindowCView.viewport); However, the hits returned (hits=glRenderMode(GL_RENDER)) is always zero. I have followed the steps described in the redbook. Any idea is really appreciated. Many thx in advanced
Xiachunyi
Xiachunyi
For the following function: "glGetIntegerv(GL_VIEWPORT,viewport)", is it suppose to be "viewport" or "WindowCView.viewport"?
Tree Penguin
Tree Penguin
Check these out, might be handy:
Article
Code

EDIT: bad link

[edited by - Tree Penguin on February 29, 2004 1:02:53 PM]
Meesa
Meesa
It is suppose to be WindowCView.viewport. Is it a problem when developing it in SDI application instead of glut application?

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.