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.

Author
Message
Indicium
18
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 16th Mar 2010 01:35
Hey, I'm wanting to get some physics in my game, its based mainly on vehicles, I've started making my terrain from heightmaps, which is pretty cool imo I tried Newton but I just can't get my head around it.

Are there any free alternatives?

Or is there a easy guide to newton?

Thanks

Windows 7 32-Bit Home Premium Intel Pentium Dual-Core @ 1.46Ghz 2038mb RAM
Indicium
18
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 16th Mar 2010 20:54
Well I tried to use the default commands for collision with terrain. And well... do the dbpro terrain commands just use a box around the terrain for collision??

Windows 7 32-Bit Home Premium Intel Pentium Dual-Core @ 1.46Ghz 2038mb RAM
chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 16th Mar 2010 21:18
You have to use get ground height , and make some checking :
front
back
left
right
and if one of them are higher than player position, that means that you are colliding.


cheer!

learning every day
Indicium
18
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 16th Mar 2010 21:42 Edited at: 16th Mar 2010 21:44
Ah right, thanks

I thought the make terrain command made an object... I don't suppose theres any way to do that?

EDIT:

That command is for matrix's, not terrain?

Windows 7 32-Bit Home Premium Intel Pentium Dual-Core @ 1.46Ghz 2038mb RAM
chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 16th Mar 2010 22:16
Yeeah..I`m a fool....what I meant :

get terrain ground height(1,x,z)


try again

cheers!

learning every day
Indicium
18
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 16th Mar 2010 22:46 Edited at: 16th Mar 2010 23:15
Thanks, that works great

Well, it doesn't, but that's a fault of mine

But the command itself works no problem, thanks

EDIT: Okay, I guess I'm just gunna have to get my head around Newton

Windows 7 32-Bit Home Premium Intel Pentium Dual-Core @ 1.46Ghz 2038mb RAM
Neuro Fuzzy
19
Years of Service
User Offline
Joined: 11th Jun 2007
Location:
Posted: 16th Mar 2010 23:23
NEWTON IS AWESOME.

It may seem complex, but it's waaay way less complex than trying to make your own physics system, and probably less complex than integrating other libraries into your game, and creating the wrapper yourself. If not newton, then use dark physics, or ODE physics.


Indicium
18
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 16th Mar 2010 23:50 Edited at: 16th Mar 2010 23:52
Okay, I've tried to get to terms with Newton, maybe I've started abit advanced, I don't know. But this is what I've got:



It complies and runs... and crashes for no apparent reason...
Can you see any obvious mistakes in there?

A lot of it is taken from the advanced terrain demo


Sorry about the indentation

Thanks

Windows 7 32-Bit Home Premium Intel Pentium Dual-Core @ 1.46Ghz 2038mb RAM
Indicium
18
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 18th Mar 2010 17:50
Sorry To bump this, but I'm really not making any progress. Does anybody with knowledge of newton have any advice as to why this is crashing?

Windows 7 32-Bit Home Premium Intel Pentium Dual-Core @ 1.46Ghz 2038mb RAM
tiresius
23
Years of Service
User Offline
Joined: 13th Nov 2002
Location: MA USA
Posted: 18th Mar 2010 19:03
Does the terrain demo crash for you? If it does not, start with the Terrain demo and make smaller changes to it until you get to where you want to start at in the code.


A 3D marble platformer using Newton physics.
Indicium
18
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 18th Mar 2010 19:36 Edited at: 18th Mar 2010 20:42
Quote: "Does the terrain demo crash for you? If it does not, start with the Terrain demo and make smaller changes to it until you get to where you want to start at in the code."


No it doesn't, but thanks I never thought of that . I'll try doing that now

EDIT: WTF! I have it working, collision was fine, then I made some adjustments, and tried to compile it.

It didn't compile ( my dbpro often does that ... It just says compiling and does nothing more ). When I reloaded it, ran it, and it said it's stopped working...



EDIT 2:
Nevermind I fixed it, well, previous versions fixed it .

I'm new to newton, so how would I go about applying a force to box to make it move?

Also, is there any way to make tree collision faster?

Windows 7 32-Bit Home Premium Intel Pentium Dual-Core @ 1.46Ghz 2038mb RAM
tiresius
23
Years of Service
User Offline
Joined: 13th Nov 2002
Location: MA USA
Posted: 19th Mar 2010 02:43
Applying a force to a box is done in the jetpack demo. To make tree collision faster the only way I know how is to Serialize it. That means saving the tree collision to file, then reloading it when you need to. The help on those commands are pretty straightforward.

I know I keep saying this, but Newton has a pretty high learning curve and it lends itself to personally going through the demos line by line and reading the help files yourself on the commands used. Tweaking the tutorials and playing around with the settings is the next step. When I started Newton I printed out all the documentation on paper and took it with me on a trip. I ended up reading about every single command probably 2-3 times before diving into the demos and reading that code too when I came back home.

There aren't any Newton Tutorials that I know of so you really need to take charge of your own learning and don't give up on yourself. Ask a question after 2 hours of trying to figure it out on your own. When it is too easy to get answers, you don't grow as fast in your knowledge. Keep at it and you will eventually become a Newton master.

Good luck!


A 3D marble platformer using Newton physics.
Indicium
18
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 19th Mar 2010 09:49
Thanks for the advice, I'll start by tweaking the demos as you said Thanks for taking the time to answer.

Windows 7 32-Bit Home Premium Intel Pentium Dual-Core @ 1.46Ghz 2038mb RAM
programing dude
18
Years of Service
User Offline
Joined: 22nd Jul 2008
Location:
Posted: 20th Mar 2010 00:53
for normal collision you can use boxes and position the boxes where ever the objects are.

for sliding collisions you can use the darkbasic pro commands with a collision math allgorithum which generaly makes sense but technicly is harder.


I use dark physics which allows easy collisions in about 2 commands (excluding the object/world setup and the main loop)

Login to post a reply

Server time is: 2026-07-27 05:10:56
Your offset time is: 2026-07-27 05:10:56