plazadelmar Posted September 14, 2020 Share Posted September 14, 2020 I copy the small grids to each point of the grid template and now I would like to rotate them in randomly so they snap to 90/180 and 270-degree intervals in Y-axis. Is there an easy way to solve it in VEX or with VOPS? Quote Link to comment Share on other sites More sharing options...
ikoon Posted September 14, 2020 Share Posted September 14, 2020 (edited) Hi Dominic, here is one possible way. File is attached. @zero_to_three = floor( 4 * rand(@ptnum)); float angle = @zero_to_three * radians( 90 ); vector axis = {0,1,0}; matrix3 m = ident(); rotate(m, angle, axis); @up = {0,1,0}; @N = m * {0,0,1}; 0-270.hiplcFetching info... Edited September 14, 2020 by ikoon 1 Quote Link to comment Share on other sites More sharing options...
plazadelmar Posted September 14, 2020 Author Share Posted September 14, 2020 On 9/14/2020 at 11:19 AM, ikoon said: Hi Dominic, here is one possible way. File is attached. @zero_to_three = floor( 4 * rand(@ptnum)); float angle = @zero_to_three * radians( 90 ); // 45 in 0 to 90 vector axis = {0,1,0}; matrix3 m = ident(); rotate(m, angle, axis); @N = m * {0,0,1}; 0-270.hiplcFetching info... Expand Thats amazing, thank you. Quote Link to comment Share on other sites More sharing options...
ikoon Posted September 14, 2020 Share Posted September 14, 2020 Here is the same result, but orientation is set by the @orient attribute: @zero_to_three = floor( 4 * rand(@ptnum)); float angle = @zero_to_three * radians( 90 ); vector axis = {0,1,0}; @orient = quaternion(angle,axis); quaternion.hiplc 3 Quote Link to comment Share on other sites More sharing options...
plazadelmar Posted September 14, 2020 Author Share Posted September 14, 2020 On 9/14/2020 at 11:33 AM, ikoon said: Here is the same result, but orientation is set by the @orient attribute: @zero_to_three = floor( 4 * rand(@ptnum)); float angle = @zero_to_three * radians( 90 ); vector axis = {0,1,0}; @orient = quaternion(angle,axis); quaternion.hiplcFetching info... Expand much cleaner, thank you 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.