markmu Posted November 24, 2018 Share Posted November 24, 2018 (edited) in Houdini, how to rotate face along Normal thanks! how to rotate face along Normal.hipnc Edited November 26, 2018 by markmu Quote Link to comment Share on other sites More sharing options...
konstantin magnus Posted November 26, 2018 Share Posted November 26, 2018 To scale and rotate certain primitives take the group into a primitive wrangle: primpoints() and foreach() will process all points that are connected to the selected polygons instance() allows rotating and scaling around individual pivots. rotate() and quaternion() set up the orient attribute to be used in the instance() function. float amount = chf('amount') * M_PI; vector center = v@P; vector axis = prim_normal( 0, @primnum, vector(0.0) ); vector N = vector(0.0); vector rot_post = vector(0.0); vector scale = vector( chf('scale') ); matrix3 m_rot = ident(); rotate(m_rot, amount, axis); vector4 orient = quaternion(m_rot); matrix m = instance(center, N, scale, rot_post, orient, center); int prim_pts[] = primpoints(0, @primnum); foreach(int pt; prim_pts){ vector pos = point(0, 'P', pt); pos = pos * m; setpointattrib(0, 'P', pt, pos, 'set'); } prim_rot_scale.hip 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.