Collision Confusion

Blitz3D Forums/Blitz3D Beginners Area/Collision Confusion

Argh(Posted 2004) [#1]
Hi there folks. I'm brand-new to Blitz3D, and I'm already confused ;-)

I've dutifully gotten through the initial tutorial, starting with Hello World, and right now, I'm using Matt Davey's "Matts Balls" program as a way to get used to Entities, Collisions, gravity and other constants and expressions.

I got really far with editing the different constants, manipulating/creating lights, etc.... and then I ran into a set of problems:

1. When I declared that Collisions could exist between instances of CT_BALL, the compiled program exhibited the most bizarre behavior. Instead of the balls being repelled from one another as they were being created, they formed strange, grape-bunch like formations. I assumed that this was because the Entities were being created "on top" of one another, and I'll make some sort of FOR->NEXT loop that will fix that (I hope).

2. I substituted the simple 2-poly plane with a more complex 3DS, and collision detection suddenly went to... a bad place. With fire.

Instead of having the oblong collion zones colliding with the polygons and then ricocheting outwards in a logical manner, the balls tended to "stick", often defying common sense. This didn't seem to change no matter what I tried.

Sooo... I know that looking at a total newbie's source is prolly like pulling teeth, and I may or may not understand explanations as to what went wrong anyway (heh) but here's a link to the modified source and the .3DS used for this experiment.

http://www.wolfegames.com/Annoying_Newbie_Balls.zip


puki(Posted 2004) [#2]
Welcome to Blitz "Argh" - I put your demo in my 'Matts Balls' folder and it works perfectly - your code seems fine - I have only had a quick look - I'll play around with it. Somebody else may come up with the answer.

Edit: one thing I do notice is that most of your balls are missing the plane that they are supposed to bounce off. Scaling the mesh up seems to work better - for example (1.5, 1.5, 1.5)


puki(Posted 2004) [#3]
I don't know - I don't see much wrong with it - the sparks (splodges) are impacting incorrectly, but I don't see any bunching of balls - unless what I am seeing is not the effect you want from it?

Still, you've made a good start - it's always best to play around and modify other people's code.


Argh(Posted 2004) [#4]
You're not seeing balls get "hung up" on the polygons of the mesh? That's odd...


eBusiness(Posted 2004) [#5]
I don't see the ball to ball collision statement in your code.