Jump to content
  • Advertisement
Sign in to follow this  
OpenGL_Guru

OpenGL OpenGL picking in 2D and 3D at the same time..

This topic is 4462 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

DISCLAIMER -- i could explain my problem a lot better if someone might be so kind to PM me with their email address so i could send them a sample image of what i am trying to do. this will help everyone see clearly what i am talking about. thanks! problem is is that i am rendering a world in 3D, colored by a min and a max value through a 1D texture lookup. i have a 2D legend that corresponds to the coloring scheme with some slider bars on both ends of the legend. as of now i am using a picking scheme to retrieve the 3D (x, y, z) and i draw a glut sphere at that spot to show that the function is successful and it is. i also have a GUI class -- which tells main everything about the GUI as well as returns to main certain callbacks such as a screen(x, y)(from passivemotion) for the picking that i described above but for also a menu. what i want to do is be able to manipulate the slider bars on the 2D legend.. that is move them up and down across the 2D legend without interfering with manipulating the 3D world. i am using glutMotionFunc() to rotate the 3D world with the mouse(just a basic mouse function). i am also using glutPassiveMotionFunc() for the callback in main program for the onscreen menu that i mentioned. i simply return the x,y coordinate of the mouse real time using passivemotion. if button_down == true, then i activate the callback and if the x,y matches one the menus located on the screen -- then i do something. so back to my original problem -- i want to be able to manipulate the 2D legend without interfering with the other mouse functions. anyone have any suggestions or ideas? again if i could have an image on here it would make things much easier to explain. thanks in advance!!

Share this post


Link to post
Share on other sites
Advertisement
Ok my interpretation of the question:

You have multiple GUI elements, each one has separate mouse pointer data.
You want to be able to manipulate one of your GUI controls, without affecting the settings on the other.
Each responds to mouse motion and clicks, so the current problem is that manipulations to one messes up the settings on the other.

How about detect where the mouse is at the moment, and if its above one of your controls, disable changes to the other guy?
Details left as an exercise....

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!