Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / 3D Bounce question

Author
Message
Dangerous Dan
20
Years of Service
User Offline
Joined: 29th Jul 2004
Location: Oklahoma City, OK
Posted: 11th Jul 2006 23:38
Hi gang. I've searched and searched on this subject but I'm to dense to make use of anything I've found on the subject. I am not looking for real world rigid body physics, I am just wanting a descent approximation. I am using nuclear collision, but I have sparky's DLL as well. Any code based off either of these would be awesome. I'm just looking to find out once a collision occurs how I can simulate reflecting my object off of the wall via a believable angle. I've visited some very math intensive sites but they are way, way over my head. I can currently find out the collision x,y,z, I can find the normal of the collision occurence, but I just don't know how to code for the reflected angle rotation of my object. If anyone can help out on this, I would greatly appreciate it.
Thanks!
RUCCUS
19
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 12th Jul 2006 00:40
Sparky's dll gives you the BounceX() BounceY() and BounceZ() angles of an object, it calculates what the appropriate bounce angle would be after a collision. Just look in the readme with the dll for the command list, they're somewhere near the bottom of the list IIRC.

slicer 4 ever
18
Years of Service
User Offline
Joined: 11th Jul 2006
Location: currently: planet gamma3295
Posted: 12th Jul 2006 01:53
hmm well this won't be posted for a while(since i'm still a noobie) but haveing other program languages the folling should work to make it go in the opposit angle(of course due to my new learning of db you'll have to figure out how to implement it into db also i well work off of say an x and y axis)

first:

ballspeed = 10
ballangle = 5
if (collision with say left y wall)
ballangle = ballangle - (ballangle * 2)
endif

that should reverse the balls angle exactly

now apply it to the z value and all other collisions

my smiles love me =-)=-)=-)(-=(-=(-=

Login to post a reply

Server time is: 2024-11-27 15:54:29
Your offset time is: 2024-11-27 15:54:29