Thread: Ray tracer and collision detection

  1. #31
    Computer guy
    Join Date
    Sep 2005
    Location
    I'm lost!!!
    Posts
    200
    I was thinking like this:
    The model contains certain number of triangles. Each triangle has 3 vertices, which will be vector3d. Then to move the whole model, i will add the velocity into each vector, so no matter what i do, the model will always be one part. Then i use those vector direction to check if it is intersect with anything in front in a certain distance. If there is nothing, the PointIntriangle checking will not be execute.

    Now, i have to figure out how to pass the collision onto the object that had been collided. So it goes like this: a ship hits a meteoroid (the meteoroid's direction is same as the ship but slower. So basically the ship hits the meteoroid behind). The ship will change direction/ slow down, but how can i change the meteoroid's direction/ speed up because of the hit.
    Hello, testing testing. Everthing is running perfectly...for now

  2. #32
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    Object.Vector*=-HitPlane.Normal;

    For physics you would need much more code to include weight, mass moment of inertia, etc,.

Popular pages Recent additions subscribe to a feed