2D Rotating Bouncing box

Started by
1 comment, last by CD579 18 years, 8 months ago
Okay, I'm doing a little physics playtest app. I have this little box that I can bounce around the screen. I am currently using a single point to determine the box's location, and render from that one point. I wanted to add in rotation to the box, so it would correctly bounce around with gravity correctly affecting each vertex, so I changed my lil physics routine to calculate gravity for each vertex, instead of just the one box point. Now the problem I'm having is trying to keep the box a "box". When a vertex hits the side of the screen, it's velocity is reversed, which in turn makes the box shrink(one side of the box is going one way, the other side is going the opposite). How would I go about adding in rigidity to my physics playtest app? Anyone have any good formulas or sites I could take a look at? Should I keep using the single point formula, and just add a rotation velocity as well, or should I keep calcutating by each vertex? Thanks! CD
Jesus is Lord!!
Advertisement
look for jakobsen's articles.

http://www.gamasutra.com/resource_guide/20030121/jacobson_01.shtml

Everything is better with Metal.

Wow, thanks a lot! This is exactly what I was looking for!

Thanks again!
CD
Jesus is Lord!!

This topic is closed to new replies.

Advertisement