magneto Posted April 3, 2012 Share Posted April 3, 2012 (edited) I know the Copy SOP uses point normals if they exist on the template. It seems like it's aligning +Z with the point normal, but how can I control this so I can align any other axis to this point normal? What if I want the model's +X to be aligned to the point normal? Or an arbitrary vector3? I know there is also the up vector but that only seems to control the roll along the point normal. Right now I use a Transform SOP, but feel like there is a better way to control this precisely. Any ideas? Thanks Edited April 3, 2012 by magneto Quote Link to comment Share on other sites More sharing options...
tjeeds Posted April 3, 2012 Share Posted April 3, 2012 (edited) Short answer: Use a vector called "up" as your y axis. Long answer: There's a help page on this if you search for "copying and instancing point attributes", but here's the main breakdown... orient float4 (quaternion) Orientation of the copy pscale float Uniform scale scale float3 Non-uniform scale N vector Normal (+Z axis of the copy, if no orient) up vector Up vector of the copy (+Y axis of the copy, if no orient) v vector Velocity of the copy (motion blur, and used as +Z axis of the copy if no orient or N) rot float4 (quaternion) Additional rotation (applied after the orientation attributes above) # If the orient attribute exists Use it to orient the copy/instance. If the orient attribute does not exist Orient the copy/instance using N as the +Z axis and up as +Y axis. If N does not exist, use v (velocity) if it exists. If the rot attribute exists, apply it after the above. Edited April 3, 2012 by tjeeds 2 Quote Link to comment Share on other sites More sharing options...
magneto Posted April 3, 2012 Author Share Posted April 3, 2012 Thanks tjeeds, I saw that page, very useful. I tried the up vector but when I change it the model is still fixed on the +Z. All it changed was the roll around the point normal. So should I be using orient? I haven't tried it. Basically mine is sort of a remapping of a single axis instead of always using +Z. Quote Link to comment Share on other sites More sharing options...
edward Posted April 3, 2012 Share Posted April 3, 2012 Rotate your model so that the axis you want is the +Z axis. ie. use a Transform SOP with an appropriate 90 degree rotation before feeding into the Copy SOP. 1 Quote Link to comment Share on other sites More sharing options...
magneto Posted April 3, 2012 Author Share Posted April 3, 2012 Thanks Edward, that's what I am doing I thought I was missing a crucial thing that could make this work via "orient" or "up", etc. Although this pre-rotating has a flaw. If the geometry that will be copied is offset, then you have to figure out the center of the rotation (pivot), whether centroid, or {0,0,0}, or another point. Quote Link to comment Share on other sites More sharing options...
edward Posted April 3, 2012 Share Posted April 3, 2012 Wouldn't you run into this problem even if you had a custom axis for aiming in the same direction as the normal? Wouldn't the rotation still be using (0,0,0) as the pivot in the Copy SOP? Note that if you want to centre the geometry using the Transform SOP, use -$CEX, -$CEY, -$CEZ for the Translate parameter value. 1 Quote Link to comment Share on other sites More sharing options...
magneto Posted April 3, 2012 Author Share Posted April 3, 2012 Thanks Edward, you are right What about using dihedral expression? Would this help you think? I tried it briefly but then it seemed to disrupt the other axis. In your -$CEX example, would using $CEX, etc for the pivot do the same thing? I guess yours actually translates the geometry where pivot only changes the pivot. Quote Link to comment Share on other sites More sharing options...
ryew Posted April 3, 2012 Share Posted April 3, 2012 Peter Quint's "Particle Leaves Instancing" video tutorial might be of some help for an overview of the various orientation methods for copied geometry 1 Quote Link to comment Share on other sites More sharing options...
magneto Posted April 3, 2012 Author Share Posted April 3, 2012 Thanks Ryew, I have been meaning to watch this for a while 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.