I am developing now a 3d game engine (Very simple, just cubes and maybe few other simple 3d objects). I am using C++, and for the graphics SFML, it's 2d graphics library for C++.
I already have the formula for the perspective projection:
S will be the position of the point on the screen. P will be the position of the point in the 3d space. E is the position of the eye (camera).
Sx = ((Ez * (Px - Ex)) / (Ez + Pz)) + Ex
Sy = ((Ez * (Py - Ey)) / (Ez + Pz)) + Ey
Now, that is working great! what I want to do now is rotating the camera itself. I already thought about rotating everything else around the camera, because I can do that quickly with my current code, which includes a "rotateAroundPoint" function of a 3d point.
But is there anything faster and simpler then that? any addition to my formula/ a new one that allows me to rotate the camera itself?
Thanks for any help and hope someone has a solution ;D Arad Arble.