I am doing a 3D racing game in Director, and it's the first time I do a 3D game
in director.
Could anyone sugget me that what is the best way to program the collision
detection between the car and the
edge of the track.
SIncerely
Mark
I am doing a 3D racing game in Director, and it's the first time I do a 3D game
in director.
Could anyone sugget me that what is the best way to program the collision
detection between the car and the
edge of the track.
SIncerely
Mark
the best way is a technique called "ray casting". Basically it draws a ine
(ray) starting from a point in the space and with a specific direction, then
you must check what models are intersected by the ray, and if they distance is
greater than the minimum needed for a collision.
Lingo have "modelsUnderRay()" method that do it quicly and efficient.
Of course, if you want to use physics, install havok xtra. But consider the
first option:
You have the position of the car and its local x axis, -x axis, -y axis, y
axis.
check the models itersected by the rays casted in ther four directions,
starting from the position of the car.
If the distance to the edge is less than a value, simply move the car model in
the opossite direction (-ray),
where do I download the Havok Xtra? is it free?
mk0505 wrote:
> I am doing a 3D racing game in Director, and it's the first time I do a 3D game
> in director.
> Could anyone sugget me that what is the best way to program the collision
> detection between the car and the
> edge of the track.
I´d go for Havok!
--
Agustín María Rodríguez | Partner
Methanoia Studio | http://www.methanoia.com
---------------------------------------------------
www.onwine.com.ar > Macromedia Director demos & code
mk0505 wrote:
> where do I download the Havok Xtra? is it free?
Yes, it´s free.
http://director-online.com/havok/
--
Agustín María Rodríguez | Partner
Methanoia Studio | http://www.methanoia.com
---------------------------------------------------
www.onwine.com.ar > Macromedia Director demos & code
Hi Mark,
> I am doing a 3D racing game in Director, and it's the first time I do a 3D game
> in director.
> Could anyone sugget me that what is the best way to program the collision
> detection between the car and the
> edge of the track.
This might be a quick way of testing your 3D models ( if you have some
existing ones ) within Shockwave 3D, and using Havok...
http://www.candointeractive.com/gamedesign/car
If it works OK in that, at least you'll know that your 3D environment is
going to be fine.
Regards...
Mal
Lesezeichen