CS 621Contemporary Computer Graphics


Lab 14
Dr. Tong Yu, Winter 2008

Ray Triangle Intersection

  • Login and open two windows, one for editing and one for compiling and executing programs. ( Try to reduce the browser size so that it won't occupy the whole screen and you can observe a few things on the screen at the same time. )

    Suppose a triangle is specified by the following three vertices:

    P0 = ( 1, 2, 2 )
    P1 = ( 6, 3, 2 )
    P2 = ( 3, 5, 2 )
    and a ray is given by R(t) = ( 0, 0, 0 ) + t ( 2, 2, 1 ) / 3

    Determine the following:

    1. The normalized normal to the plane containing the triangle
    2. The distance from the origin to the plane containing the triangle
    3. The intersection point of the ray and the plane containing the triangle
    4. Whether the ray hits the triangle