PDA

View Full Version : object to screen center



pakito
10-13-2009, 07:51 AM
i try to translate an object in an opengl scene from its current position to the screen center. i dont want to set modelview and projection matrix to identity cuz i want to animate the translation.

atm i calculate the screen center position in space with gluUnproject then try to calculate the vector between the gravity center of the object and the screen center in space. unfortunately when i apply the translation the objet is not at the center of the screen.

anyone would know a code example here or there, or would paste some code doing this ?