Ray tracer and collision detection

This is a discussion on Ray tracer and collision detection within the Game Programming forums, part of the General Programming Boards category; I was thinking like this: The model contains certain number of triangles. Each triangle has 3 vertices, which will be ...

  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
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,590
    Object.Vector*=-HitPlane.Normal;

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

Page 3 of 3 FirstFirst 123
Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21