Next, we need to attach the car to the viewpoints BODY_ORI. Every time an arrow key is pressed the BODY_ORI is changed, so we also need to update the car. Add the following to the updatecar() function
This function will update the position and orientation of the car so that it will follow the BODY_ORI. The first thing we do is translate the car to the position of the viewpoint. Next we rotate the car to the same orientation as the BODY_ORI. The last thing we need to do is move the car so that it looks like the viewpoint is in the driver seat. We translate the car by an offset but notice that the last argument is viz.REL_LOCAL. This tells vizard to translate the car relative to its local coordinate system (i.e. relative to the direction the car is facing).
Now run your script. When you move around the car will move with you.