Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

gashad

Help needed w/ sphere deforrmation

This topic is 5894 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, I am writing a "bouncy-ball" program that outputs renderman code to be rendered. I can get the ball to bounce fine, but there are no deformations. There are three parameters of a sphere centered around (0,0,0)that I have complete control of: it''s radius, the positive height, and the negative height. In my program now, I have a velocity vector (where the ball is going) which is affected by gravity. The ball is bouncing off of the floor, so for collision detection, I check if the ball is below a certain point--if it is, I get the inverse of the velocity vector about the y-axis (y is up in my program) I also have a coefficient of restitution, which is basically how much energy the ball loses as it hits the ground. Anyway, I am looking for help with making the ball deform as it hits the ground, any ideas? Thanks! -Pete

Share this post


Link to post
Share on other sites
Advertisement
You might consider modelling the internal pressure of the ball in small internal volume elements. If external pressures applied to the ball (like a reaction force distributed over a small surface patch) are greater than the internal pressure on that patch, then the balls surface will deform to balance the pressures. If you simulate this well enough, the result is that the ball bounces upward away from the surface as the pressure distribution on the inside and outside of the ball is different at all points that aren''t in contact with the ground. You''d also need to model the surface of the ball as an elastic medium... perhaps a set of 2D patches connected by springs?

Good luck with whatever you decide...

Timkin

Share this post


Link to post
Share on other sites
It depends on what your goals are. If you want to use this in a fast realtime environment, you're probably better off just scaling the ball in the direction of the hitnormal. This makes the ball squeeze a little bit, and gives the impression of a rubber ball. You might want to control the scaling factors in each direction and make them a little 'springy' so that the ball keeps deforming for a while after the collision.

If you want more realistic movement (for a simulation for example), the idea TimKin presented sounds ok.

Hmm i just read that your goals are to render it in renderman. I guess Timkin's Idea would be better than.. sorry..

Cheers!
Nick

[edited by - NickWaanders on June 2, 2002 5:39:36 PM]

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!