Rotate around a "custom" axis or rotate around an axis pointing away from sprite (SOLVED)

As discussed in the discord server, i need to make this flower rotate. Problem is, it is already rotated in the x axis by -30 degrees to be better with the camera and all. I would like to rotate it like this image:

rotating around the z axis gives a weird result:
image
image
image

i have tried many code attempts to rotate it properly. The main problem is that i need to make the flower rotate around a vector that points away from the sprite rectangle, which idk what is. If i had some way to know of a vector that points away from the sprite, i could do something like this:

go.animate('.', 'rotation', go.PLAYBACK_LOOP_FORWARD, vmath.quat_axis_angle(vmath.rotate(vmath.quat_rotation_x(math.rad(-30)), vmath.vector3(0, 1, 0)), math.rad(360)), go.EASING_LINEAR, 3, 0)

where the_vector is the vector that points away from the sprite.

one of the attempts was: suppose that the so called vector was originally pointing in the z axis. If that was true (it wasnt) i could just apply a rotation of -30 degrees in that vector’s x axis and use that vector as the pointing-away-vector, like this:

local the_vector = vmath.rotate(vmath.quat_rotation_x(math.rad(-30)), vmath.vector3(0, 0, 1))
go.animate('.', 'rotation', go.PLAYBACK_LOOP_FORWARD, vmath.quat_axis_angle(vmath.rotate(vmath.quat_rotation_x(math.rad(-30)), vmath.vector3(0, 1, 0)), math.rad(360)), go.EASING_LINEAR, 3, 0)

This didnt work.

How can i rotate this flower?

SOLVED!!!

JustAPotota helped me in the discord server, the solution was to make a second GO and put the flower sprite inside that GO that wasnt rotated att all. Then we just rotate that GO and boom, the flower is rotating properly!
image

3 Likes