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.

DarkBASIC Professional Discussion / newton plugin world scale

Author
Message
bitJericho
22
Years of Service
User Offline
Joined: 9th Oct 2002
Location: United States
Posted: 13th Feb 2010 03:56
Hey all,

I'm making a game using Newton, and I think I'm having issues with scale. Newton recommends using the standard 1meter = 1 unit scale, but I think this might be messing with the physics. Does anybody have experience using newton and dbp and what size scale did you use?

tiresius
22
Years of Service
User Offline
Joined: 13th Nov 2002
Location: MA USA
Posted: 13th Feb 2010 14:58
It should be 1 unit = 1 meter but of course it can be larger as long as forces are scaled along with it. However, a larger scale with floating point math may get a little less accurate when the values are large. What problems are you having exactly with 1:1?


A 3D marble platformer using Newton physics.
bitJericho
22
Years of Service
User Offline
Joined: 9th Oct 2002
Location: United States
Posted: 13th Feb 2010 18:48 Edited at: 13th Feb 2010 18:51
well, the car doesnt behave right, it starts moving backwards on its own, and other behaviors that arent present at a larger scale. I've attached two sets of code if you want to look at it.

You may require BBB GUI (in wip board) and Matrix1util plugins, but you can remove the BBBGUI code if you like as it doesnt do anything. Also, I think i have the wheel width and radius variables reversed, just for your reference.

PS car values can be adjusted at around line 362, the car() array

Here's the code at a 1 unit to 1 decimeter scale

Attachments

Login to view attachments
bitJericho
22
Years of Service
User Offline
Joined: 9th Oct 2002
Location: United States
Posted: 13th Feb 2010 18:48
and here's at 1 unit to 1 meter scale

Attachments

Login to view attachments
bitJericho
22
Years of Service
User Offline
Joined: 9th Oct 2002
Location: United States
Posted: 13th Feb 2010 21:51
Ok, so it appears the torque on the tires was the culprit I think. I lowered it significantly and it works better. It appears the torque wasn't too high when going from about 1in to 1 unit down to one unit per decimeter, but messed everything up going down to one meter to one unit.

So uh, all is well now

Login to post a reply

Server time is: 2025-06-27 23:44:54
Your offset time is: 2025-06-27 23:44:54