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.

Dark Physics & Dark A.I. & Dark Dynamix / Problems making a vehicle move

Author
Message
Eirik
18
Years of Service
User Offline
Joined: 1st Aug 2006
Location: Norway
Posted: 5th Aug 2006 05:21
Hi

Have been testing some models I previous have made using the DP vehicle commands. Have succeded in registering all limbs and positions etc required to make the engine aware of the different components (almost).

If I use the arrow keys to increase the speed and the wheels are turning but the car does not move. Using the debugger I can see that the car body is registered but I can not see the wheels. Should the be displayed too ? Suspect that there are some problems related to my handling of the wheels since increasing decreasing the body size makes the car body and wheel sink into the ground.

The program is very much based upon one of the small vehicle demos delivered with DP. I can't spot any difference that should make this behave like this (might be beacuse it is past 4 AM here..... )


` 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 "racer_frag.x", 2

position object 2, 15, 2, -25
rem rotate limb 2,0,0,-90,0

Height# = 0.47
Radius# = Height# / 2.0

` set up vehicle
phy create vehicle 2
phy add vehicle body 2, 1.16, 0.69 - Radius#, 2.33, 0.0, 0.0, 0.0
rem RR = limb 10
phy add vehicle wheel 2, 10, limb position x (2, 10), limb position y (2, 10), limb position z (2, 10), Radius#, Height#, 0, 1
rem RL = limb 8
phy add vehicle wheel 2, 8, limb position x (2, 8), limb position y (2, 8), limb position z (2, 8), Radius#, Height#, 0, 1
rem FR = limb 6
phy add vehicle wheel 2, 5, limb position x (2, 5), limb position y (2, 5), limb position z (2, 5), Radius#, Height#, 1, 1
rem FL = limb 4
phy add vehicle wheel 2, 3, limb position x (2, 3), limb position y (2, 3), limb position z (2, 3), Radius#, Height#, 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

` main loop
do
set cursor 0, 0

print Radius#, Height#
for index = 0 to 10
print limb name$(2, index)
next

` 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

Attachments

Login to view attachments
Mike Johnson
TGC Developer
22
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 5th Aug 2006 09:44
You should see the wheels in the debugger so I'm thinking it might be their position is causing the problem. Possibly they are inside the main body of the vehicle. Try pulling them out a little.
Mike Johnson
TGC Developer
22
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 5th Aug 2006 10:57
One other thing I'd recommend - take a look at Demos\Vehicles\Vehicle. Run the debugger alongside and you will get to see the chassis and wheels. That's the kind of result you need to be looking for. Make sure the wheels are free of any obstacles. Also check the position of the chassis, make sure it's not scraping along the ground or obstructed in any way.
Eirik
18
Years of Service
User Offline
Joined: 1st Aug 2006
Location: Norway
Posted: 5th Aug 2006 11:49
Tried to pull the wheels further out but there where no difference. I suspected that there where issues related to the chassis but changing the base position or size of the body only resulted in making the car sink into the ground. If the wheels worked it should stop at least at the position the where set to

Going to check more the difference between my model and the model used in the demo.
Eirik
18
Years of Service
User Offline
Joined: 1st Aug 2006
Location: Norway
Posted: 5th Aug 2006 12:24
Checked again in the debugger and found two issues (one is as you suspected : I used the total size of the body (including the wheels) as the size of the body regarding the width. One other thing is that I have found the wheels in the debugger way of the object. Now the issue is to figure out why they are so much of ..... and if there are some feature to zoom into objects in the debugger.... Things can get pretty small and hard to identify.

Thanks for the quick response to this.

Login to post a reply

Server time is: 2024-11-24 12:28:43
Your offset time is: 2024-11-24 12:28:43