How to define one axis as a circle, so movement goes around 2pi radians

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By noisycicada

If I move along a circle position 2pi is the same as 0, how to i set it such that the character moves along the path of a circle, I would like to only constrain the one axis and leave the other free. ie move along a circle in xy plane (world space) press right to go clockwise, left to go counterclockwise. up and down press move in z axis, and achieving some
z (world space) requirement places you on a different concentric circle.

Have you tried looking into the first tutorial on making an FPS? It describes moving the camera via rotate_x() and rotate_y() functions in the _input() function.

Ertain | 2019-05-01 00:10

The camera is a totally separate system than what I mean.

just tying to find how to set up 1-4 players on circular path so left and right go around while up and down is for the z axis (normal to circle)

noisycicada | 2019-05-01 18:43

:bust_in_silhouette: Reply From: rafgp

You can move any body in a circular fashion by attributing the x, y pair as follows:

x = radius * sin(distance)
y = radius * cos(distance)

This, of course, is a circular movement around the origin of the xy-plane (0, 0). If you want for it to move around another point, just add the desired offset to each entry.

this is the trivial solution, I suppose there are 3 spaces (orthonormal basis) that i’m working with, world space (like the game engine level) game space (in my game) map space (level specific)

the game engine I assume uses Cartesian 3psace coordinates, as will the game space, but the map space should be achieved through some mapping from Cartesian 3space to what is really cylindrical 3space coordinate. so that I can move along some path at constant radius (ie move in theta 1space) or move up or down in z 1space and move in or out in r 1space. how do i make the full transform? or is this it?

noisycicada | 2019-05-01 18:52

:bust_in_silhouette: Reply From: Ruckus T-Boom

Another option could be to parent the object to a Spatial placed at the center of the circle, offset the object, then rotate the Spatial.