I have been searching on the internet for a while now, for a solution with nothing. What I want to know is how to implement a swing/bobbing motion in a 3D Camera in OpenGL(or DirectX) like you find in Minecraft, Call of Duty, etc. I tried cycloids, while they work I can’t get the direction to work correctly.
Share
What do you think about the following.
cam_pos,cam_dest,cam_upas usual.cam_rightas cross (cam_pos,cam_up)camera_time(if walking,camera_time += delta_time;)offset_factor = sin(camera_time);Then you can call
gluLookAtor similar function as follows.This will make the camera swing from right to left. You can add the same for the
cam_upvector with some tweaking.