If you know the path, you also know it starts at 0 and ends at 1. That is a 
direction.
In order to 'read' where you are you need to define the nearest point on curve, 
then read the time. You need to save this number and chech if greater, if not, 
you are going back.

Polygonal made a nice demo, and his framework does all the complex stuffs for 
you.

Hope it helps a bit.

Fabrice

On Oct 13, 2010, at 19:26, jonny <[email protected]> wrote:

> Hi,
> I am building a driving game using Away3D. The perspective is first-
> person so the view of the camera is the actual cockpit view if you
> like. I am using a collisionMap to detect when you drive off the road,
> once you drive off the road, the car will slow down to a stop and at
> that point I want to place the car back on the road facing the right
> direction so the car can continue driving. What I am planning to do to
> achieve this is as follows:
> 
> Create another collisionMap and split the track up into many colour
> coded segments, then I will allocate each color-coded segment an
> "ideal" position (x,y,z). I will then detect what colour area the car
> drove off track. I can then place the car back on the track at that
> ideal position.
> 
> This is my plan but I am not sure if this is the best way as I am only
> just beginning to work with Away3D.
> 
> Is there a better way?
> 
> I have briefly looked at Path Animations but that seems more
> applicable to animating along a predefined path. Although it does seem
> like something could be done with paths. I need to make sure the
> camera/car is facing the right way when i put it back on the road.
> 
> Your recommendations would be most helpful.
> 
> Many Thanks!

Reply via email to