View Full Version : Center on point
11-01-2004, 05:25 AM
I have an OpenGL view, and I want to center the view
on point where the user click.
If I click on Point(50,50) -> I want to center on point(50,50).
Someone can help me ?
11-02-2004, 05:18 AM
It's not that simple, if you are using 2D only it's no big geal, but in 3D, what are you clicking on ? the X,Y coordinates for the point depends on the depth.
So normally you need "something" to click on so you can get a depth value (have a look at gluProject and gluUnProject).
11-02-2004, 06:01 AM
I have an object for clicking on it.
I use both 2D and 3D.
I use "gluUnProject" for obtain my position when
But if I set the Pan with the position, it don't
center correctly my object.
Powered by vBulletin® Version 4.2.2 Copyright © 2014 vBulletin Solutions, Inc. All rights reserved.