Currently in my game, I have a 3D scene which centers in the middle of the screen. That is, my player is in the middle of the screen, and when I rotate the camera, it rotates around the center of the screen.
Because I have UI elements on the right, I want to shift things so that the scene appears to be centered 200 pixels or so to the left. So I want the player over there, and I want camera rotation to happen around that point also. I know that is a simple question but how do I do that? I am feeling very dumb today.
I have experimented, trying to translate my modelViewMatrix leftward, both before and/or after my camera rotation. Doing it afterward does shift the view, but then rotating the camera still happens around the center of the screen, not around the translated point. Do I have to add something in my camera rotation routines to shift the scene back to the center before rotation and then back leftward again afterward?
if you expect a specific answer - you should provide an example of your current camera math. but anyway, if you use opengl matrix stack and other deprecated functionality - check gluLookAt(…) function or if you don’t use deprecated stuff - take a look at GLM library, glm::lookAt(…) function. these functions allow you to set camera position and the point it looks at. it sounds like what you’re looking for.
i reported you for spamming your site, which requires either premium or registering and accessing tutorials in a very limited way(“200MB download credits; Download 1 VMK per 45 minutes; VMKs must be downloaded in order”). if you want to post a link to your site with tutorial - post it without attempting e-begging, and make sure it wasn’t a shitty exuse and it really contains answer to the question.