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:
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?