Hi!
I often use a matrix to rotate vectors but I'd like to do the same thing to an @orient. I just need it to rotate around the Y axis over time.
-Olivier
Vex: rotate orient attribute? [{SOLVED]}
440 4 1-
- olivierth
- Member
- 1035 posts
- Joined: April 2017
- Offline
-
- olivierth
- Member
- 1035 posts
- Joined: April 2017
- Offline
Arg! I found how to rotate the @orient with this:
... but it wasn't rotating the geo in the viewport. It's an instance so I think I need to rotate the intrinsic "transform" instead. I'll try to figure this out..
matrix3 m = ident(); rotate(m, chf("rotate"), set(0,1,0)); @orient = quaternion(m);
... but it wasn't rotating the geo in the viewport. It's an instance so I think I need to rotate the intrinsic "transform" instead. I'll try to figure this out..
Edited by olivierth - July 23, 2024 10:56:34
-
- olivierth
- Member
- 1035 posts
- Joined: April 2017
- Offline
Ah! ok, got it. The trick was to use this on a primitive wrangle:
That way, I start by reading the "transform" matrix from the primitive intrinsics. I rotate that matrix and finally I write the new matrix to override "transform".
matrix3 m = primintrinsic(0, "transform", @primnum); rotate(m, chf("rotate"), set(0,1,0)); setprimintrinsic(0, "transform", @primnum, m, "set");
That way, I start by reading the "transform" matrix from the primitive intrinsics. I rotate that matrix and finally I write the new matrix to override "transform".
Edited by olivierth - July 23, 2024 11:03:48
-
- Tanto
- Member
- 442 posts
- Joined: Nov. 2016
- Offline
-
- olivierth
- Member
- 1035 posts
- Joined: April 2017
- Offline
-
- Quick Links