katosa Posted January 1, 2022 Share Posted January 1, 2022 (edited) hello I would like to ask about if i can use vector to make object rotate. here is the scene I am working on. I get vector from point 0 and 1. and want to use that to rotate tube along 0-1 line. I am not strong at math. and I want to know which function I should use to change vector to xyz degree. thank you for reading. pipe_generate_v02.hipnc Edited January 1, 2022 by katosa Quote Link to comment Share on other sites More sharing options...
animatrix Posted January 1, 2022 Share Posted January 1, 2022 Hi, You can use the dihedral function: vector p0 = point ( 1, "P", 0 ); vector p1 = point ( 1, "P", 1 ); @orient = dihedral ( { 0, 1, 0 }, normalize ( p1 - p0 ) ); Position wise it's up to you if you want the tube to sit on point 0 or point 1, be centered to the line, or just rotate. 1 Quote Link to comment Share on other sites More sharing options...
katosa Posted January 1, 2022 Author Share Posted January 1, 2022 hi thank you very much for the reply. I am trying to do so. How do you apply @orient for tube rotation?? Quote Link to comment Share on other sites More sharing options...
katosa Posted January 1, 2022 Author Share Posted January 1, 2022 thanksfully I could rotate tube. still wish to know if vector xyz can be converted to xyz rotation degrees so that I can use in parameters in transform node. Quote Link to comment Share on other sites More sharing options...
dleonhardt Posted January 1, 2022 Share Posted January 1, 2022 9 hours ago, katosa said: thanksfully I could rotate tube. still wish to know if vector xyz can be converted to xyz rotation degrees so that I can use in parameters in transform node. Yes, you can convert @orient with the quaterniontoeuler() function, which will give you the rotation values in radians. You can then convert them to degrees with the degrees() function. 1 Quote Link to comment Share on other sites More sharing options...
katosa Posted January 2, 2022 Author Share Posted January 2, 2022 7 hours ago, dleonhardt said: Yes, you can convert @orient with the quaterniontoeuler() function, which will give you the rotation values in radians. You can then convert them to degrees with the degrees() function. thank you very much. I could get the degrees. 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.