5

As per Blender documentation the center in the Vector Rotate node is the Point to rotate around, which, I assume, means the pivot point for rotation. However when I tried with an example, changing the center of the Vector Rotate node seems to merely change the rotation angle and not the pivot point.

Am I missing something?

enter image description here

Loma Harshana
  • 597
  • 2
  • 9

3 Answers3

8

This is what is happening.

The grey arrow is the vector (0,0,1) in object space. The red ball is the 'Center' of the Vector Rotate node.The green arrow is (0,0,1), Vector Rotated by 90° about the axis (0,1,0) (into the screen), passing through 'Center'.

As 'Center' is moved along the X axis, for example, the rotated (0,0,1) changes length and direction as shown:

enter image description here

The green arrow is where you have asked the X of your plane to be directed.

Robin Betts
  • 76,260
  • 8
  • 77
  • 190
  • 1
    Oh man, thanks for that... I was a bit confused and thought about it more like the vector like being a line which is rotated around an off-center pivot point, and keeping the same length while doing so... of course it's different. – Gordon Brinkmann Nov 04 '22 at 10:44
  • 1
    @GordonBrinkmann Well... it is a vector, but it's given an origin by the Transform at the end of the chain, so it becomes a point. (At least, that's the way I'm thinking about it, until tomorrow, when my head starts spinning again) – Robin Betts Nov 04 '22 at 11:04
  • 1
    Maybe the way to think about this is you're not rotating the vector; you're rotating the tip of the vector. – Markus von Broady Nov 04 '22 at 12:00
  • Sorry but I still don't understand this too well. How is the grey and green arrows both (0,0,1)? And I can't visualise the green arrow rotating 90° - is this because the centre is moving? – Neil Nov 10 '22 at 14:55
  • 1
    Hi, @Neil ! The tip of the grey arrow, the point (0,0,1), (which is the vector (0,0,1) from the object origin), is being rotated by 90° anticlockwise about the Y axis passing into the screen through center. The 'Rotation' requested in the Transform node is about the object origin, which is the moment the vector (0,0,1) acquires an origin, and is considered a definite point in object-space, rather than just a length and a direction. – Robin Betts Nov 10 '22 at 17:11
  • 1
    @RobinBetts It took a while, but it finally hit me. Thank you for explaining what is probably for most already well explained in your answer – Neil Nov 11 '22 at 10:19
  • 1
    @Neil.. you're not the only one.. I don't seem to be able to tell the difference between clockwise and anticlockwise .. sorry if that added to your confusion! 8/ – Robin Betts Nov 11 '22 at 11:08
6

Yes, the Center is the pivot point around which the vector is rotated. That is correct.

But in your example, you use a vector pointing from $(0,0,0)$ in the direction $(0,0,1)$.

Then you rotate it around a certain center.

If you then align a geometry on a certain axis to this rotated vector, you get the direction in which the rotated vector points.

And with it you unfortunately do not reach your goal.


To solve the problem you have (at least) two possibilities:

Either you rotate the positions of the individual points of your geometry and set their positions:

enter image description here

Or you convert the geometry into an instance and use the node Rotate Instances:

enter image description here

quellenform
  • 35,177
  • 10
  • 50
  • 133
  • 1
    Although I saw immediately that Loma was using the Vector Rotate wrong or misunderstood what it does, I have a hard time figuring out how the rotation it creates together with the Align Euler to Vector node is calculated... for example when take a simple line to display a vectorwith two vertices 0/0/0 to 0/0/1 with origin at 0/0/0 and rotate it e.g. 45° on the Y axis around the 3D Cursor at 0.3/1.3/0.7, I get exactly what I calculate with a rotation matrix for this case. But the Vector Rotate and Align Euler to Vector get a different result... – Gordon Brinkmann Nov 03 '22 at 15:05
  • @GordonBrinkmann This is probably due to the fact that although Align Euler to Vector produces a correct rotation, this rotation is always applied at the object origin/center, no matter which center you have previously rotated the vector around. – quellenform Nov 03 '22 at 18:05
  • I thought of something like that, but I just can't wrap my head around it. I thought the Align Euler to Vector would still point in the same direction, only at a different origin. But they are different angles as well. – Gordon Brinkmann Nov 03 '22 at 18:14
  • @GordonBrinkmann the Align Euler to Vector and Vector Rotate both output an array of 3 floats - for the former those are XYZ rotations in radians, for the latter XYZ components of the vector. There's no origin location information bundled there. – Markus von Broady Nov 03 '22 at 22:52
  • @MarkusvonBroady I misphrased that one, I didn't mean a stored origin information but something like the orientation would be the same, only at a different location. But it doesn't matter, I thought wrong about it anyway :D – Gordon Brinkmann Nov 04 '22 at 09:50
  • 1
    @quellenform There's always a lot to learn from your answers. Thank you! – Loma Harshana Nov 05 '22 at 10:52
3

Quellenform's Set Position solution is what I would go for too, but to further clarify: normally when operating on matrices, you rotate around a point different than origin by "moving the origin" - by translating the object, rotating and translating back. For example, below I do 3 operations:

  1. Rotate by $-100°$ around the 3D cursor.
  2. Move the 3D cursor to $(-0.5, 0, 0)$ and rotate around this point in space.
  3. Pretend I can't actually do as in p. 2., so I move the 3D cursor back to the world origin and instead use the translate-rotate-translate technique.

In geonodes:

Keep in mind you can merge 2 last Translate nodes, because rotation is done before translation.

Markus von Broady
  • 36,563
  • 3
  • 30
  • 99