Skip navigation

Barycentric coordinates

Plane plane = new Plane( a, b, c ) ;

float areaABC = Vector3.Dot( plane.Normal, Vector3.Cross( b - a, c - a ) ) ;
float areaPBC = Vector3.Dot( plane.Normal, Vector3.Cross( b - P, c - P ) ) ;
float areaPCA = Vector3.Dot( plane.Normal, Vector3.Cross( c - P, a - P ) ) ;

float alpha = areaPBC / areaABC ;
float beta = areaPCA / areaABC ;
float gamma = 1.0f - alpha - beta ;
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: