I am quite new to opengl programming. I have one scene in which I render a cube at the right bottom side. Now I want to move the cube to the center without changing my view. I know it’s possible to change the camera view and also the position of the object. But is it also possible to put somehow the object(cube,rectangle,sphere) from one place to another without changing the perspective?
Here is one example explaining my problem maybe in a more detailed way:
If I am sitting in a room on the right bottom side is a paper bin. From this position I am able to look inside the bin. Now I want to move this bin to the center, but keep the perspective that I still can look a little bit inside the bin.
glTranslate is moving the object completely and the perspective will be changed. Correct me if i am wrong.
So what i am looking for is a way to move the object, but don’t change the angle you watch to the object. This is what i mean by keeping the perspective.
Pardon my ignorance but I still can’t visualizing what you need to do… perhaps, some pics would help?
Re-reading your illustration with the paper bin, it comes to my mind this thing: Do you want something like billboard, something to keep the object facing a particular target like the camera? Sorry if I am thousand miles from your idea, I am sure a drawing of your idea would help!
I think heavenssake07 means the image of the bin stays exactly the same as it was when rendered in the corner, it is just shifted in 2D screen space from it’s corner to the center; As if done after the 3d rendering is finished.
One method is done perhaps by rendering your cube/bin as it is in the corner to a Frame Buffer Object or render it to screen and copy it out to a texture using glCopyTexSubImage (i think this is the right function).
Then render the texture you created to a screen aligned polygon, shifting either the texture coordinates or the actual polygon to align your image to the centre.