I have screen with dimensions: 800x600.
The object that I want to rotate around is located at (400,300, -50) - center of the screen.
Orthogonal projection:
Near plan - 0.1f, far plane - 1000.0f
left - 0, bottom - 0, right - 800, top - 600
Camera:
position at (0,0,0)
look at (0,0,-50)
up vector (0,1,0)
Now what I'm doing to rotate is calculate the X of "look at" using: 0 + width * cos(A).
Y remains the same (0).
Z is calculated using: -50 + width * sin(A).
Now the problem that I'm facing is that after some angle the object starts to disappear, and it doesn't rotate around the object. What can be the problem?
0,0,-50with a radius ofwidth. But you are saying the object you wish to orbit is at400,300,-50. Correct? \$\endgroup\$