ANN: car-simulation now with trailer.
From: Andreas Leitgeb (avl_at_gamma.logic.tuwien.ac.at)
Date: 11/27/03
- Previous message: guan sy: "SOS"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 27 Nov 2003 14:11:58 GMT
Some time ago, at this spot, I announced my wish-script
that simulated the movements of a car, which could
go forward and backward and turn left or right.
The substance of that script was the algorithm for
calculating the exact angle of the front wheels (the
inner wheel is turned more than the outer wheel),
and the exact new position of the car, even if larger
time-steps are used.
Now there is a new feature: the car has a trailer, and you can
play and see how difficult (or not) it is to drive back with
a trailer. But no fear: if in real world you would damage
your car and trailer, by going back straight and the trailer
moving sideways, it won't damage the program (yet), as the
trailer will just pass through your car as if it was virtual,
that means: there is no collision handling built in :-)
Also, the algorithm for the trailer is no longer >exact<, but
treats car's theoretically exact round movements as a sequence
of segments. It's a good approximation, though, and feels right.
Just a few notes on usage:
<Left> and <Right> turn the steering wheel (it goes 360° around)
<Up> and <Down> accellerate and decellerate. By keeping
the Up-Button pressed you can overburn the motor by 50%
which helps engaging higher gears.
<r> will engage reverse gear, but only if you're standing still.
<1> <2> ... <5> will engage the 1st, 2nd, ... 5th gear, but you
won't be able to start the motor (or it may die off) if you're
too slow for the requested/current gear.
<c> will scroll to your car, if it moved out of the window.
You can find it here: <http://avl.enemy.org/TclTk/>
It's the last one in section "Games & Amusements:"
<http://avl.enemy.org/TclTk/drive.tcl> is the direct link.
Have fun and prosper.
- Previous message: guan sy: "SOS"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]