Anim8or Community

Please login or register.

Login with username, password and session length
Advanced search  

News:

An update to Anim8or, v1.00b, is available with a few bug fixes. Get your copy HERE. See the "ReadMe" file for details.

Author Topic: I'm haveing trouble with some geometry  (Read 4502 times)

Nate_Bro

  • Newbie
  • *
  • Posts: 31
    • View Profile
    • Set Apart Graphics
I'm haveing trouble with some geometry
« 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)

Thanks for any help you can provide,
Logged
My computer specs for Anim8or and other graphics:
1.  3.2 GHz Pent 4 HT 1 MB L2, with ATI 128 MB Vid Card
2.  3.0 GHz Pent D 4 MB L2, with ATI 512 MB Vid Card
3.  1.7 GHz Pent Celeron M, with ATI 64 MB Vid Card

Steve

  • Administrator
  • Hero Member
  • *****
  • Posts: 1532
    • View Profile
Re: I'm haveing trouble with some geometry
« Reply #1 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
Logged

sciwizeh

  • Newbie
  • *
  • Posts: 22
    • View Profile
Re: I'm haveing trouble with some geometry
« Reply #2 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
Logged
<a href="http://www.freewebs.com/sciwizehgames">My site</a>
<a href="http://matrixpeckham.googlepages.com">My other site</a>

Nate_Bro

  • Newbie
  • *
  • Posts: 31
    • View Profile
    • Set Apart Graphics
Re: I'm haveing trouble with some geometry
« Reply #3 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 :)
Logged
My computer specs for Anim8or and other graphics:
1.  3.2 GHz Pent 4 HT 1 MB L2, with ATI 128 MB Vid Card
2.  3.0 GHz Pent D 4 MB L2, with ATI 512 MB Vid Card
3.  1.7 GHz Pent Celeron M, with ATI 64 MB Vid Card

lppena

  • Sr. Member
  • ****
  • Posts: 299
  • Anim8or, does a body good.
    • View Profile
    • Truespace Anim8or Casual Modeling Forum.
Re: I'm haveing trouble with some geometry
« Reply #4 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.
Logged