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 / Gravity 3d (DBC) help

Author
Message
Francesco
20
Years of Service
User Offline
Joined: 11th Apr 2004
Location: Milan, Italy
Posted: 22nd Apr 2004 23:16
How can I simulate a ball sliding down a random matrix, with inertia and stuff? Is it possible with darkbasic classic? Do you have source codes that could help me? I need advice!
Thanks in advance
Bye

Non si inalberi mica con me, sa!
Lei è venuto qui, lei ha il tombino intasato!
Siamo uno spurgo serio, noi!
Peter H
20
Years of Service
User Offline
Joined: 20th Feb 2004
Location: Witness Protection Program
Posted: 23rd Apr 2004 01:03
i made this codesnippet of a ball sliding down a matrix, but it doesn't work yet so maybe you can look at it and see the general concept...if i figure it out then i'll tell you


remember this is NOT working (well it is in THEORY )...
what i did is i got 8 points around the ball (and one point right where the ball is) and i check to see if any of them are the lowest, and if they are then i moved the ball down (gravity\nothing depending on the distance i had left to go) and repositioned its x and y coordinates accordingly...but for some reason it doesn't work , sorry


Formerly known as "DarkWing Duck"
comando 300
20
Years of Service
User Offline
Joined: 23rd Nov 2003
Location:
Posted: 23rd Apr 2004 01:49 Edited at: 23rd Apr 2004 01:51
I made this gravity little code




I hope it helps

CURRENT PROJECT: RETRO PAC-MAN
Francesco
20
Years of Service
User Offline
Joined: 11th Apr 2004
Location: Milan, Italy
Posted: 24th Apr 2004 23:19
Responding to Comando 300 I actually needed 3d gravity, although your code works very well. Thanks anyway!
I looked Magellan Studios' source code but I think that you've programmed it in DarkBasic Pro, because when I try to run the program it doesn't recognises a string (precisely "gravity as float"). But I had just the same idea you've written in your post, the one of getting the ground height of some points around the ball and checking the lowest one. I think it's the right way to go...I'll post a message if I can get something to work.
Thanks for your help!

Non si inalberi mica con me, sa!
Lei è venuto qui, lei ha il tombino intasato!
Siamo uno spurgo serio, noi!

Login to post a reply

Server time is: 2024-09-22 06:31:14
Your offset time is: 2024-09-22 06:31:14