art3mis Posted October 1, 2018 Share Posted October 1, 2018 (edited) Hi Trying to implement several of these rotation formulas with simple geometry https://sites.google.com/site/fujitarium/technical-note/basic-math/rotation for instance the first example Quote add rotation X (x, y*cos(rx) + z*sin(rx), y*-sin(rx) + z*cos(rx)) (x, y*cos(rx) + z*sin(Rx), y*-sin(rx) + z*cos(rx)) x = x y = y*cos(rx) + z*sin(Rx) z = y*-sin(rx) + z*cos(rx) How would you implement this as Vex within a Point Wrangle? Edited October 1, 2018 by art3mis Quote Link to comment Share on other sites More sharing options...
sankeerthgs Posted October 5, 2018 Share Posted October 5, 2018 Hi, While rotating an object, we are essentially changing the position of the points of the Geo. So, the above mentioned formula changes the point position along y and z axis but not x axis. To implement it in a point wrangle, just drop in a test object on to the grid followed by a point wrangle and enter the following code in the wrangle : float angleX = ch("xRad"); float posY = @P.y*cos(angleX) + @P.z*sin(angleX); float posZ = @P.y*(-sin(angleX)) + @P.z*cos(angleX); @P = set(@P.x, posY, posZ); Change the "xRad" parameter, the object "appears" to be rotating along the X-Axis, but in reality, it is just changing the point positions along Y and Z axis. Hope it helps! S 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.