Align Particles by Object Normals

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

 
Thread Tools Search this Thread Display Modes
Old 05 May 2014   #1
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
 
Old 05 May 2014   #2
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
 
Old 05 May 2014   #3
Aligning to the normal is easy, everything else is a pain this the A.

https://vimeo.com/95621202
Attached Files
File Type: zip max2014_PF_AnimatedAlignToNormal.zip (37.4 KB, 119 views)
__________________
poof ~>Vimeo<~
 
Old 05 May 2014   #4


Thank's man! I'll check it later
__________________
Alvaro Moreira

Particle-Skull.com
 
Old 05 May 2014   #5
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
 
Old 05 May 2014   #6
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.
 
Old 06 June 2014   #7
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.
 
Old 06 June 2014   #8
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<~
 
Old 06 June 2014   #9
Ah ok, thank's
__________________
Alvaro Moreira

Particle-Skull.com
 
reply share thread



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 vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 06:12 PM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.