Rotation of an Object: combination of three changing spatial angles around changing spatial axis

Hi There,

I like to resolve the following problem and I’m not quite sure how to (obviously):

Initial situation:
The explaination is gonna be messy, so this picture should clarify the situation :smiley:

I have a sphere with it’s own relative coordinates somewhere in the world. From the center of mass (point of Pivot) of that sphere, derive six vectors, which need to be handled in pairs. The vectors and the angles between each two of these vectors (so three angles in total) change every tick in all three spaial directions.

Problem/ Question:
I want to know how the sphere rotates in relation to the world coordinates, if all three rotation angles are combined.
I tried a bunch of stuff, but most of the time the sphere jitters in playmode, so I guess my combination of the spatial angles and the subsequent transformation onto the x-,y- and z- coordiantes is wrong. The following picture shows my latest creation as part of the spheres own blueprint.

I think I know what you mean, but need to check:

Are the vectors constrained to the X/Y/Z plane ( for the sphere )?

And you want to apply 3 axis rotations, locally, on the sphere, and know what the world effect of that is?

1 Like

Hey, thanks for your reply (again :smiley: )!

  1. I’m not sure if I know what you mean with constraint to… I get the vectors like this:

I have three vectors deriving from the world origin pivot (which change every tick). The green vector defines where the sphere and it’s relative pivot lies within the world. The orange vectors define the tips of vector t0 and t1. By using basic vector equation, I calculate the resulting vectors between that green arrow tip to the orange arrow tips → resulting in those yellow vectors (just two of the six necessary to get all three angles) and the angle lies between those to yellow vectors. Was this the answer to your question?

  1. That’s a good question, so far it somehow didn’t make a difference if I rotated the sphere around the relative pivot or in the world ( I tried both; this shouldn’t be possible?). But I actually want the sphere to rotate around itself, around it’s own pivot, which would mean around the “setrelativerotatiton” ? In the picture from my original post I cut of the part where I set the rotation.

In the BP extraction that I posted earlier, I also tried to work with only one angle and axis (upper part of the script), to see if the combination of all three angles creates the jitter. But it still jittered, so I think the problem is not the combination of the three rotators, but the changing and inconsist vectors and (therefore) angles?

Ok, that’s not what I thought, so good thing you explained it.

What I don’t get is why you’re doing this. If we forget about all the vectors for a moment, what do you want?

While it springs to mind, there are also these nodes:


which you can use to switch between an object’s local and world rotation.

Im workig with the Leap Motion plugin. This gives me the position and the rotation of the finger tips and I want to manipulate nd object acording to those changing fingertips.
The Position of my relative system changes all the time, so what do i have to insert into the orange Transform pin in order to get from world to relative?

Ah - got ya.

Those nodes will let you change between relative and world at will, for sure.

So your finger movements are meant to be applied to the ball.

This next question is probably because I haven’t thought it through, but why the need to translate? Does the plugin only provide world, and you want to use local?

To get from world to local, for the ball, use

Thinking about it, it’s local location will always be zero I guess, but it works for components.

Ok thanks, this might be really helpful!

This rotation-issue is only part of what I’m trying and I actually think it shouldn’t be this hard. The plugin provides the vectors, but also rotations for each fingertip, so I’m trying both approaches, this one where I calculate the angles and another one where I “just” use the given rotations and try to combine them, but this whole combination thing is’t really working for me :smiley:

But the transform part might be interesting for both approaches!

What about this:

If both fingers are present, treat it as a single rotation.

If only one finger, read location.

So they can move and rotate the object.

Ok, now you’ve lost me :smiley:
what do you mean by “treat it as a single rotation”? This is the data i get from the plugin:

the rotations on the far right are the ones of the finger tips. How can I treat three relevant rotations as one?

The location is no problem. Before I concern with the rotation in BP, I get the location for the object and this works fine. The green arrow from my second drawing is the location of the object which i calculate.

Trouble is, I have no idea what those nodes give you when you noodle around on the interface.

I think you might be taking too large a leap, trying to immediately map what’s coming out of the controller to local object rotation.

Can you set the world rotation of an object?

Can you just make a BP that tells you what’s going on?

Once you get that sorted, then you can use the translation nodes to turn it into local rotation and it will be a cinch.