Ignore:
Timestamp:
10/09/06 15:57:28 (18 years ago)
Author:
mattausch
Message:

resolved bug for object space distribution using triangles
fixed biasing bug for mesh::GetRandomSurfacePoint? method and
GetRandomVisibleSurfacePoint?.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/Lib/Vis/Preprocessing/src/IntersectableWrapper.cpp

    r1344 r1586  
    5555} 
    5656 
     57int 
     58TriangleIntersectable::GetRandomSurfacePoint(Vector3 &point, Vector3 &normal) 
     59{ 
     60        // random barycentric coordinates 
     61        const float a = RandomValue(0, 1); 
     62        const float b = RandomValue(0, 1); 
     63        const float c = 1.0 - a - b; 
     64         
     65        point = mItem.mVertices[0] + a * (mItem.mVertices[1] - mItem.mVertices[0]) + 
     66                        mItem.mVertices[0] + b * (mItem.mVertices[2] - mItem.mVertices[0]) + 
     67                        mItem.mVertices[1] + c * (mItem.mVertices[2] - mItem.mVertices[1]); 
     68         
     69        normal = mItem.GetNormal(); 
     70 
     71        return 0; 
     72} 
     73 
    5774  
    5875} 
Note: See TracChangeset for help on using the changeset viewer.