LWJGL Forum

Programming => Lightweight Java Gaming Library => Topic started by: kc on April 09, 2009, 16:35:08

Poll
Question: how to detect collision among models?
Option 1: model to model collision
Option 2: other
Title: lwjgl collision detection
Post by: kc on April 09, 2009, 16:35:08
Hi i wanna limit my car model movement to my road and detect its collision with pavement which is another model...
somebody please tell me how can i do it..
Title: Re: lwjgl collision detection
Post by: bobjob on April 09, 2009, 22:43:30
If you plan to have complex tracks (with ramps and such), I think the simplest way for a car game would be.

to treat the car as an elipsoid (or sphere). and to do a point to triangle collision.
Title: Re: lwjgl collision detection
Post by: kc on April 11, 2009, 06:42:58
thank u for replying..
I cant treat car as elipsoid(or sphere) because my guide wants perfection.
i am trying to take minimum and maximum point of car (it covers all four edges of car) and check whether it lies inside triangles on road. but its not working.. i am not getting y its not working.
can u please tell me y its not working..?
i am using
modelViewMatrix = getModelviewMatrix();
car.projectVerts(car, modelViewMatrix, projectionMatrix, viewport);
functions and taking minimum and maximum points from projected vertices.