How to smoothly rotate the camera using up down left and right keys in 3d space on a tilted camera.

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By stubbsy345
:warning: Old Version Published before Godot 3 was released.

My camera is tilted to look at the characters feet. I want to be able to rotate the camera around the axis without moving the character using keys. I can get it to rotate but it tilts around the cameras tilted axis which isn’t what I want. I am not a programmer but trying to learn so I would appreciate some help in this.

Thanks

I’m not sure but by my understandings of physics and mathematics it involves movement via a circular path( aka (x - a)² + (y - b)² + (z-c)² = r² ) and a rotation to the center point( aka (a,b,c))

rustyStriker | 2017-05-09 15:06

Any advice on how to set the axis around which to rotate in code? I want it to rotate around the glodal axis. I’ve just started with 3d and only used 2d up until now so on a steep learning curve.

stubbsy345 | 2017-05-09 15:08

I’m not sure about “tilt” (sorry I’m not english^^) so… do you want to be able to rotate the camera left, right, up and down, like in an FPS but with keys?

Zylann | 2017-05-09 22:59

Not sure if applies to the effect you are looking for but you can use a spatial node as parent of the camera, with the camera on the desired position.
Make the camera look at it and rotate the parent instead of the camera so the later will stay on the same relative position.

eons | 2017-05-10 14:31

:bust_in_silhouette: Reply From: rredesigns

I might be wrong, but I think you can use rotate_x / rotate_y / rotate_z to rotate in local axis and set_rotation() / set_rotation_deg() to rotate around global axis.