Hi All,
After going mad trying to get the vehicle command to work with objects made with DBPro, I thought I would take all the numbers and give the names like 'wheel front right', so the vehicle demo that come with physics, I have named all of them.
Now this is when I find out that some values do the opposite of what you expect, like wheel_rear_right_height#=0.2 I change to 1.2 and the front of the car rises up.
so far I think the height and radius varables work back to front.
have look and see what you think.
` demonstrates simple creation of a vehicle
` set up program
phy enable debug
phy start
autocam off
sync on
sync rate 60
color backdrop 0
make light 1
set directional light 1, -5, -5, 5
position camera -20, 20, -25
point camera 0, 10, 0
` create ground
load image "road2.png", 1
make object box 1, 1000, 1, 1000
texture object 1, 1
phy make rigid body static box 1
` load car
load object "beach.x", 2
load image "beachBu2.tga",2
load image "dbprocubemap.dds",3
texture object 2,2
set blend mapping on 2,1,3,2,16
position object 2, 15, 2, -25
rotate limb 2,0,0,-90,0
rem limb
limb_front_right=3
limb_front_left=9
limb_rear_right=5
limb_rear_left=7
rem steering location
loc_front_left_wheel=1
loc_front_right_wheel=1
loc_rear__left_wheel=0
loc_rear_right_wheel=0
rem wheel spin
clock_wise_spin_rear_right=0
anticlock_wise_spin_rear_left=1
clock_wise_spin_front_right=0
anticlock_wise_spin_front_left=1
rem wheel height
wheel_front_right_radius#=0.6
wheel_front_left_radius#=0.6
wheel_rear_right_radius#=1.6
wheel_rear_left_radius#=1.6
rem wheel height
wheel_front_right_height#=0.2
wheel_front_left_height#=0.2
wheel_rear_right_height#=0.2
wheel_rear_left_height#=0.2
rem x axis
wheel_front_right_x#=-1.5
wheel_front_left_x#=-1.5
wheel_rear_right_x#=1.5
wheel_rear_left_x#=1.5
rem y axis
wheel_front_right_Y#=0.3
wheel_front_left_Y#=0.3
wheel_rear_right_Y#=0.3
wheel_rear_left_Y#=0.3
rem z axis
wheel_front_left_z#=1.1
wheel_front_right_z#=-1.1
wheel_rear_left_z#=-1.1
wheel_rear_right_z#=1.1
` set up vehicle
phy create vehicle 2
phy add vehicle body 2, 2.2, 0.6, 0.75, 0.0, 0.6, 0.0
`phy add vehicle wheel ID, limb, x#, y#, z#, radius#, height#, location, direction
phy add vehicle wheel 2, limb_rear_right, wheel_rear_right_x#, wheel_rear_right_Y#, wheel_rear_right_z#, wheel_rear_right_radius#, wheel_rear_right_height#, loc_rear_right_wheel, clock_wise_spin_rear_right
phy add vehicle wheel 2, limb_rear_left, wheel_rear_left_x#, wheel_rear_left_Y#, wheel_rear_left_z#, wheel_rear_left_radius#, wheel_rear_left_height#, loc_rear_left_wheel, anticlock_wise_spin_rear_left
phy add vehicle wheel 2, limb_front_right, wheel_front_right_x#, wheel_front_right_Y#, wheel_front_right_z#, wheel_front_right_radius#, wheel_front_right_height#, loc_front_right_wheel, clock_wise_spin_front_right
phy add vehicle wheel 2, limb_front_left, wheel_front_left_x#, wheel_front_left_Y#, wheel_front_left_z#, wheel_front_left_radius#, wheel_front_left_height#, loc_front_left_wheel, anticlock_wise_spin_front_left
phy set vehicle max motor 2, 200.0
phy set vehicle steering delta 2, 0.1
phy set vehicle max steering angle 2, 0.4
phy set vehicle auto 2, 1
phy set vehicle suspension spring 2,100
phy build vehicle 2
` set up vehicle
`phy create vehicle 2
`phy add vehicle body 2, 2.2, 0.6, 0.75, 0.0, 0.6, 0.0
`phy add vehicle wheel 2, 5, 1.5, 0.3, 1.1, 0.6, 0.2, 0, 0
`phy add vehicle wheel 2, 7, 1.5, 0.3, -1.1, 0.6, 0.2, 0, 1
`phy add vehicle wheel 2, 3, -1.5, 0.3, -1.1, 0.6, 0.2, 1, 0
`phy add vehicle wheel 2, 9, -1.5, 0.3, 1.1, 0.6, 0.2, 1, 1
`phy set vehicle max motor 2, 200.0
`phy set vehicle steering delta 2, 0.1
`phy set vehicle max steering angle 2, 0.4
`phy set vehicle auto 2, 1
`phy set vehicle suspension spring 2,100
`phy build vehicle 2
` display image
load image "logo.png", 100000
sprite 1, 0, 600 - 60, 100000
` main loop
do
` follow car
set camera to follow object position x ( 2 ), object position y ( 2 ), object position z ( 2 ), 0, 6, 4, 1, 0
` update physics and screen
phy update
sync
loop
Dark Physics makes any hot drink go cold.