View Full Version : Opengl camera control GUI instead of mouse control

04-16-2013, 03:48 AM
I have tried to find everywhere any information or code on how to implement a GUI in a 3d enviroment to control the camera (zoom, pan, left, right, forward, backward, rotate) just as seen in places like google earth (navigation controls) but i cant find anything at all, could someone help me find resources in implenenting such a feature?

Thank you.

04-17-2013, 06:24 AM
While I am fairly new at OpenGL myself, as far as I know OpenGL has nothing to do with how you change/move things in your scene it is only meant to render/draw the scene you give it. I'd assume this type of control would be based in your model update loop just as if you would be directly controlling the camera. But instead you would adjust the scene with input based on your mouse position when you click with your mouse button. As for how you handle this it shouldn't be too hard to create some form of Axis aligned bouding boxes for your buttons (assuming they are rectangular in shape) and then simply finding which box the mouse is above when you click and updating the scene based on that.

As I said, I am by no means an expert on this stuff so I might be totally off.

04-17-2013, 08:35 AM
I think this (http://www.codeproject.com/Articles/35139/Interactive-Techniques-in-Three-dimensional-Scenes)page and the reference mentioned on it might help.