Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Map coord selection in 3d


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
No replies to this topic

#1 Kudaba   Members   -  Reputation: 100

Like
Likes
Like

Posted 19 June 2001 - 06:30 AM

I''m trying to easily use OpenGL selection buffer to pick out points on a map. I''m not sure how easy this is as I''ve never made selection to work but basically I found a little page that said what I was doing should work, here''s the code: glSelectBuffer(128, buffer); /* initialize */ glRenderMode(GL_SELECT); glInitNames(); glPushName(-1); glGetIntegerv(GL_VIEWPORT,viewport); /* set up pick view */ glMatrixMode(GL_PROJECTION); glPushMatrix(); glLoadIdentity(); gluPickMatrix(Ms[X_],viewport[3] - Ms[Y_], 2, 2,viewport); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); glRotatef(rt[Y_], 0.0f, 1.0f, 0.0f); GlRotatef(rt[X_], 1.0f, 0.0f, 0.0f); glRotatef(rt[Z_], 0.0f, 0.0f, 1.0f); glTranslatef(-loc[X_], -loc[Y_] - 2.0f, -loc[Z_]); glBegin(GL_POINTS); for (int y = 0; y < MAXMAPSIZE - 1; y++) { glPushName(y + 1); for (int x = 0; x < MAXMAPSIZE - 1; x++) { glPushName(x + 1); glLoadName(1); // not 100% sure about this one glVertex3fv(Points[x][y]); glPopName(); } glPopName(); } glEnd(); glMatrixMode(GL_PROJECTION); glPopMatrix(); glMatrixMode(GL_MODELVIEW); hits = glRenderMode(GL_RENDER); Hits is always 0. If anyone, can help me, is there some huge important step that I''m missing and no one ever explains or something.

Sponsor:



Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS