ron2812 Posted August 14, 2020 Share Posted August 14, 2020 Hi everyone! Is there a way to calculate @N and @up from the @orient attribute? Basically the same as the orient to curve SOP does - it only outputs N and up, but i got all the Pitch/Yaw/Roll bells and whistles. I have everything layed out on my curve the way i want, but Unreal Engine doesn't seem to read the orient attribute. Thanks in advance! Quote Link to comment Share on other sites More sharing options...
tamagochy Posted August 14, 2020 Share Posted August 14, 2020 Convert quaternion to matrix3 and extract rotation vectors from it. Quote Link to comment Share on other sites More sharing options...
ikoon Posted August 14, 2020 Share Posted August 14, 2020 Hi Ronald, here is the extraction of axes from quaternion in vex: matrix3 m = qconvert(p@orient); v@xaxis = set(m.xx, m.xy, m.xz); v@yaxis = set(m.yx, m.yy, m.yz); v@zaxis = set(m.zx, m.zy, m.zz); The default orientation of v@N is zaxis, and @up is yaxis. So this is probably what you need: matrix3 m = qconvert(p@orient); v@up = set(m.yx, m.yy, m.yz); v@N = set(m.zx, m.zy, m.zz); Quote Link to comment Share on other sites More sharing options...
ron2812 Posted August 14, 2020 Author Share Posted August 14, 2020 Wonderful, thank you! Works like a charm 1 Quote Link to comment Share on other sites More sharing options...
toadstorm Posted August 14, 2020 Share Posted August 14, 2020 Another quick way to do this is to just rotate world N (+Z) and world up (+Y) by your orient quaternion. v@up = qrotate(p@orient, {0,1,0}); v@N = qrotate(p@orient, {0,0,1}); 2 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.