Hi,
How i can put my camera in point the way it uses @orient attribute for camera rotations? I can move the camera in point using point() but camera rotations are in Euler angles.
Thank you
Mika
Camera and @orient attribute
2373 6 0- mihatsu
- Member
- 76 posts
- Joined: Aug. 2018
- Offline
- jsmack
- Member
- 7737 posts
- Joined: Sept. 2011
- Offline
You can create a custom constraint using a transform wrangle.
Heres an example vexpression using a quaternion representing a 45 degree rotation about the Y axis:
Heres an example vexpression using a quaternion representing a 45 degree rotation about the Y axis:
#include <voplib.h> // Fetch transform inputs chopTRS c0 = c->fetchInput(0); float yrot = radians(45); vector4 orient = set(0, sin(yrot/2), 0, cos(yrot/2)); vector4 rot = eulertoquaternion(radians(c0.r), XFORM_XYZ); rot = qmultiply(orient, rot); // Compute transform @t = c0.t; @r = degrees(quaterniontoeuler(rot, XFORM_XYZ)); @s = c0.s;
- mihatsu
- Member
- 76 posts
- Joined: Aug. 2018
- Offline
jsmack
You can create a custom constraint using a transform wrangle.
Heres an example vexpression using a quaternion representing a 45 degree rotation about the Y axis:#include <voplib.h> // Fetch transform inputs chopTRS c0 = c->fetchInput(0); float yrot = radians(45); vector4 orient = set(0, sin(yrot/2), 0, cos(yrot/2)); vector4 rot = eulertoquaternion(radians(c0.r), XFORM_XYZ); rot = qmultiply(orient, rot); // Compute transform @t = c0.t; @r = degrees(quaterniontoeuler(rot, XFORM_XYZ)); @s = c0.s;
Ok this seems to be what I need but how I can import attributes from geometry node? I tried point() trick but it doesn't seems to work as in normal point wrangle?
- jsmack
- Member
- 7737 posts
- Joined: Sept. 2011
- Offline
- tamte
- Member
- 8514 posts
- Joined: July 2007
- Online
- jsmack
- Member
- 7737 posts
- Joined: Sept. 2011
- Offline
- mihatsu
- Member
- 76 posts
- Joined: Aug. 2018
- Offline
-
- Quick Links