# Anim8or Community

## General Category => ASL Scripts => Topic started by: Nate_Bro on January 08, 2008, 08:47:55 pm

Title: I'm haveing trouble with some geometry
Post by: Nate_Bro on January 08, 2008, 08:47:55 pm
I'm working on a particle system, but I'm haveing trouble with reflections. I have colision detection, but when the particles need to change direction, my formula is not very good.

all i'm doing now is fliping the axis...

like (4,5) == (-4,5)

Title: Re: I'm haveing trouble with some geometry
Post by: Steve on January 11, 2008, 06:20:33 pm
You need to reflect the incomming vector off the plane of reflection.  Your computation assumes that the plane is x=0.  In general the direction of the outgoing vector is:

Vout = Vin + 2N*Dot(Vin, N)

where N is the plane normal, Vin is the normalized incomming direction and Vout is the outgoing direction,  (You need to normalize Vout after this computation.)

Here is a detailed description.  See equation (3) (but not that the normal is reversed from my formula so the subtract the terms instead of adding them).

http://mathworld.wolfram.com/Reflection.html (http://mathworld.wolfram.com/Reflection.html)
Title: Re: I'm haveing trouble with some geometry
Post by: sciwizeh on January 11, 2008, 11:22:45 pm
when i read the first post i wasn't sure what you were asking, but now i get it.

had i known i would have said: to make bouncing realistic would require a bit of vector math, i don't know the specifics.

i believe steve has put it in pretty good terms
Title: Re: I'm haveing trouble with some geometry
Post by: Nate_Bro on January 11, 2008, 11:37:44 pm
Thank you Steve, that helps a lot! I'm still new to vector math and normals, but I'm slowly learning :)
Title: Re: I'm haveing trouble with some geometry
Post by: lppena on February 07, 2013, 06:24:13 pm
Thank you Steve, that helps a lot! I'm still new to vector math and normals, but I'm slowly learning :)

I hear what you're saying about vector math and it's role in 3D modeling software like Anim8or. I wish that someone would post some articles on how Anim8or uses this information to do stuff in Anim8or. Steve, you created a quite awesome product with some very advanced features. I use Anim8or all the time now and seem to grow more fond of it the more that I play with it. Leroy.