# Align Particles by Object Normals

 05 May 2014 AlvaroMoreira Frequenter   portfolio Alvaro Moreira Brazil Align Particles by Object Normals Is there a way to align the particles by an objects normals and keep it aligned while the particles walk around? I'm trying to make some ants run over a cubes surface. They have to stay aligned by speed space follow while they walk all around the cube. I'm trying some RnD with teapots for now. I tried with data ops, getting the surface normal and the objects closest point but i have no idea on how to use it properly with the rotation. The scene can be downloaded here: http://www.4shared.com/rar/ew4J2pp2ba/ants.html And thats whats going on: Thank's in advance Alvaro __________________ Alvaro Moreira Particle-Skull.com share quote
 05 May 2014 Paradyce PRO   portfolio Robert Dyce 3D Designer / Post Production generalist Elara Systems Sacramento, United States Me too me too! Me too! I too would love some data op instruction on how to control speed / orientation based off of a surface. Something akin to speed by surface + orient to surface but with box 3. Anyone out on the interwebs willing to provide some insight? Thanks! Bob Dyce share quote
05 May 2014
Aligning to the normal is easy, everything else is a pain this the A.

https://vimeo.com/95621202
Attached Files
 max2014_PF_AnimatedAlignToNormal.zip (37.4 KB, 131 views)
__________________
poof ~>Vimeo<~

 05 May 2014 AlvaroMoreira Frequenter   portfolio Alvaro Moreira Brazil Thank's man! I'll check it later __________________ Alvaro Moreira Particle-Skull.com share quote
 05 May 2014 Paradyce PRO   portfolio Robert Dyce 3D Designer / Post Production generalist Elara Systems Sacramento, United States That is so cool! I just pulled down the file and was playing with the Box3 op - good stuff. Could you help me understand a couple things you did? Questions: 1. You are piping 'Objects Timing' into the point position, point normal and object TM - Why / What does this do? 2. It looks like you're aligning the particles initial XYZ rotations to the closest point normal, then from those three, switch (choosing z in this case) to align to single axis? Would/could you just wire of the Z axis, but by hooking up all three axis to a switch you can easily change orientation with the switch? 3. The functions that overwrites M2.T with point position vector - What is this for? Does this pipe particle position back into the transformation matrix? 4. Does adding the Object TM matrix (converted to Quat) with the normal aligned matrix (converted to Quat) allow you to move the chamfer box around/rotate it? It basically just adds whatever movement or rotation into the particles? Once again, that you so much. If you're going to Siggraph, beers are on me! Thanks, Bob Dyce share quote
 05 May 2014 JohnnyRandom Configurator   portfolio John Rand still wandering the binary void salt lake city, USA Originally Posted by Paradyce: That is so cool! I just pulled down the file and was playing with the Box3 op - good stuff. Could you help me understand a couple things you did? Thanks Glad it is helpful. You give me more credit than I deserve. I use this op all over I it gets things and looses things, LOL I have a dozen different versions of it. This operator isn't scene specific, all the excess in it were for other reasons/issues that I have run into in different circumstances. I will try and explain the best I can. Quote: 1. You are piping 'Objects Timing' into the point position, point normal and object TM - Why / What does this do? Timing doesn't really mean much in this case, the Lock and Bond takes care of it. If you turn the Lock and Bond off and disable the mP ops, disconnect the timing and disable the input, you will notice that the teapots will now spin on the set axis. It is simply making sure that the object timing and the particle normal/position timing are all in sync. Quote: 2. It looks like you're aligning the particles initial XYZ rotations to the closest point normal, then from those three, switch (choosing z in this case) to align to single axis? Would/could you just wire of the Z axis, but by hooking up all three axis to a switch you can easily change orientation with the switch? Well it currently matches the local particle axis of X, Y, or Z to the point normal and normals are z up in max. The exposed switch is so you can choose the particle object up axis. Maybe I don't exactly understand what you are asking? Quote: 3. The functions that overwrites M2.T with point position vector - What is this for? Does this pipe particle position back into the transformation matrix? The point position is redundant, it works without it. A holdover from maxscript maybe, in which you need to write your value to a matrix variable then write that into the particle matrix. EDIT: Ah the Point Position was wired to an Out Position Vector which was keeping on point, from another scene. Quote: 4. Does adding the Object TM matrix (converted to Quat) with the normal aligned matrix (converted to Quat) allow you to move the chamfer box around/rotate it? It basically just adds whatever movement or rotation into the particles? That again is from a different setup. I was having troubles aligning the particle to an object that was offset from world center and adding its transform to the particles transform had fixed it. BTW Khye has some really good tuts on vimeo that deal with rotation, really well done, a very solid approach: LookAt Operator series - https://vimeo.com/70794736 __________________ poof ~>Vimeo<~ Last edited by JohnnyRandom : 05 May 2014 at 04:27 AM. share quote
 06 June 2014 AlvaroMoreira Frequenter   portfolio Alvaro Moreira Brazil Hey John, just got some time to study it today. It's perfect, thank's! Im not sure about only one thing. The function Align M2.Z to V1, align all the Z components of the Matrix or just the Rotation ones to the vector? What does that vector values really means? It's like roll, pitch and yaw? I cleaned your system a little bit. If anyone else wants to study it, this one looks a bit simplier. https://www.dropbox.com/s/y24ho8y1r...ts%20Normal.rar https://www.dropbox.com/s/8e8rrjeg1...n-to-Normal.jpg and I ended up with this Thank's again John, i'm learning a lot with your content. __________________ Alvaro Moreira Particle-Skull.com Last edited by AlvaroMoreira : 06 June 2014 at 06:01 AM. share quote
 06 June 2014 JohnnyRandom Configurator   portfolio John Rand still wandering the binary void salt lake city, USA Oh you just removed the options to set the nodes up axis, the other stuff was for aligning still particles to a local offset object, something I was working on but never quite finished. The Align M2.Z is grabbing the point normal vector from the geometry and aligning the particle to it assuming that Z is the particle up axis. __________________ poof ~>Vimeo<~ share quote
 06 June 2014 AlvaroMoreira Frequenter   portfolio Alvaro Moreira Brazil Ah ok, thank's __________________ Alvaro Moreira Particle-Skull.com share quote

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts vB code is On Smilies are On [IMG] code is On HTML code is Off CGSociety Society of Digital Artists www.cgsociety.org Powered by vBulletinCopyright ©2000 - 2006, Jelsoft Enterprises Ltd.