Combine rotator and delta (rotator)

Heyho,

I’m back again with questions on the subject of rotation (I wonder when I’ll get it :D)

  1. How the heck does Combine Rotators work? I don’t get it. It only gets the information of two rotators, no position, nothing and still the output never adds up for my taste. If rotator A is (60,170,270) and B is (20,190,-15) i would consider the combination of the A and B to be either A+B (80,360/0,255/-90) or A+B/2 (40,180/0,127.5/-45) but this never seems to be the case… Why?

  2. Same question for Delta (Rotator). I got the rotators A (64,-81,39) and B (64,161,-36) and the Delta node gave me (-2,0.06,117)…I know it somehow normalizes, but this still doesn’t work?

The combine rotators node gives different results depending on which way round you wire it up.

Never used delta rotation, I assume it’s a nightmare.

2 Likes

Hi, combine rotators does not simply add rotators together. It first applies A, then B. For example with no rotation your vector faces in the X-Axis.

If you now rotate it 90 degrees by yaw it will face in Y-Axis, then 90 degrees by pitch it will still face in Y-Axis, you just rolled the vector by 90 degrees (end result in 90 degree yaw and 90 degree roll).

If you first rotate 90 degrees by pitch, then now it is facing in Z-Axis. Then 90 degrees by Yaw and it will still face in Z-Axis you have again rolled it now by -90 degree, so end result is 90 degree pitch and -90 degree roll.

1 Like

Hey,
thanks for the response! So what you are saying is that “combine Rotator” first applies the A rotation in x,y,z and after that the B rotation? Your example was good but it only concentrated on one rotator, doesn’t it?

It first applies rotation A, then rotation B.

Imagine you have something attached to a character (e. g. a weapon) and you have a vector in world space that you want to rotate into the weapon space. E. g. if the vector would point in (x=1, y=0, z=0) and you rotate it by CombineRotators A being character rotation, B being weapon rotation relative to character, this vector will now point in the forward direction of the weapon. You could ofc achieve the same result by just taking world rotation of the weapon and rotating the vector by that.

Or if you got a mesh that faces in Y direction (so has a rotation offset of -90 yaw, so with the actor having 0 rotation, the actors forward vector is in X-Axis, but the mesh points in Y-Axis). Now if you want that mesh to point at some location (e. g. FindLookAtRotation) and just use that rotation, your forward axis will face that direction. But since the mesh has an offset of -90 yaw to that forward axis, it will not face to that direction you want. To solve that you would use CombineRotators where you first apply that rotation offset, so -90 yaw and then the result of FindLookAtRotation.

So if you want to combine rotators, you cannot do that by adding or subtracting them, you need to use CombineRotators.

1 Like

I’ll explain delta rotator.

Imagine we’ve got the following rotators:

[5,10,-15]
[5,-90,-1]

Delta rotator is ‘normalized A - B’ so let’s do A - B:

5 - 5 = 0
10 + 90 = 100
-15 + 1 = -14

Now we’ve got:

[0,100,-14].

From the second rotator, only the last two differ from the pitch, so we will shift the values left by two:

0 becomes last.
100 becomes first
-14 becomes second.

So:

[100,-14,0]

image
image

Let’s do another:

[5,10,-15]
[5,5,-1]

Compute the difference : [0, 5, -14]

Only the last was different, so shift one left, leaving:

[5,-14,0]

image
image

At last, what if they’re all equal? We shift left one.

[5,10,15]
[5,5,5]

[0,5,10] → [5,10,0]

image
image

We took the second rotator as a reference for subtracting and shifting, the values in the first rotator doesn’t matter.

Weird tho it doesn’t normalize anything.

Following this rule, usually the first value become the last and the last the middle one, leaving the old middle be the first.

The way rotators work in this engine gives me depression

1 Like

It’s not the engine, I think you’ll find rotation is not a simple topic :slight_smile:

P Y R means Pitch Yaw Roll, rotation around axis Y Z X.

No shift thing in the delta rotator node