SFML community forums

Help => General => Topic started by: BagOfBones on August 27, 2016, 03:23:19 pm

Title: 360 degree camera
Post by: BagOfBones on August 27, 2016, 03:23:19 pm
Hi! In next couple of days Im starting to work on first big project and I want to ask about some tips and advices on how to correctly implement 360 degree camera (not sure about terminology). I want to achieve camera similar to adventures like Scratches, Process or Nikopol. Thanks!
Title: Re: 360 degree camera
Post by: Hapax on August 27, 2016, 09:33:50 pm
With what exactly are you having problem?

The assumption would be that your camera would be stationary so there's no need to store a position whereas the camera would be able to be rotated. You would need to store values for each axis that you allow rotation. For example, you'll almost definitely want yaw, which is the 360 degress rotation (heading/direction) and maybe the pitch (tilt up and down) but very unlikely that you'll need roll (like leaning your head to a side).

How you move it is up to you; you can use mouse, keyboard or some other device to control those rotations.

That is all you need to implement the camera. The next step would be implementing the image in front of the camera!

One way to do all of this is to use OpenGL. You could create a cylinder (for 360 degree direction rotation only) that would circle the camera and then map the image to the cylinder and rotate the 3D camera, or create a sphere and map the image to that and keep the camera in the centre of the sphere and rotate it.