Hi, I always struggle with 3d transformation vector so I need some help to figure this out.
how to make atan2 operation in patch editor? I know we have that operation in script but I want this operation to be available in patch editor so I could make some patch asset with it.
My reference
I tried to create this atan2 patch based on this description from wikipedia:
and also from this video
The patch that I’m trying to create is a patch to make an object to always rotate/facing the forward direction based on the input position.
I get the direction vector by subtracting the current position by the previous frame position.
But now I need to use the atan2 to get the radian that will be converted to degree and pass it to the rotation transform of that object. (forward vector = Z positive, Up vector = Y positive, Right vector = X positive.)
My attempt:
I connected the conditional logic/rules to an option switch that drives the option slot for an option picker that picks the corresponding solution/calculation for each quadrant/conditional logics. Then the result goes to a radian to degree conversion to get the orientation but it didn’t work.
what confuses me is that i can’t tell whether i put the wrong formula, or it’s some inverted coordinate system thingy in spark that makes it failed. Can someone help me figure this thing out?