# Barycentric Coordinates

## Recommended Posts

lucky6969b    1330
When I have a barycentric coordinate relative to a specific triangle, how can I transform it to world space?
I have found one post although I forgot the link.
My second question being is in max sdk, class Mesh, there isn't any method to retrieve a specific set of vertices of a triangle. Do I assume that I can use getVert() and count a triangle from every third increments? Can I assume max is using triangle strips?
Thanks
Jack

##### Share on other sites
haegarr    7372
[quote name='lucky6969b' timestamp='1301466626' post='4792030']
When I have a barycentric coordinate relative to a specific triangle, how can I transform it to world space?
[/quote]
AFAIK barycentric co-ordinates by itself are ever relative to the vertices, regardless of a co-ordinate system. If you apply the barycentric co-ordinates to vertices given in model space you'll get a point in model space; if you apply them to vertices given in world space you'll get a point in world space.

Hence if you need [i]the point[/i] in world space, e.g. apply the barycentric co-ordinates to the vertices of the triangle to yield in the model local co-ordinates of the point. Apply the model-to-global (a.k.a. local-to-world) transformation of the model to yield in the same co-ordinates but now w.r.t. the world space.

##### Share on other sites
lucky6969b    1330
[quote name='haegarr' timestamp='1301470489' post='4792039']
[quote name='lucky6969b' timestamp='1301466626' post='4792030']
When I have a barycentric coordinate relative to a specific triangle, how can I transform it to world space?
[/quote]
AFAIK barycentric co-ordinates by itself are ever relative to the vertices, regardless of a co-ordinate system. If you apply the barycentric co-ordinates to vertices given in model space you'll get a point in model space; if you apply them to vertices given in world space you'll get a point in world space.

Hence if you need [i]the point[/i] in world space, e.g. apply the barycentric co-ordinates to the vertices of the triangle to yield in the model local co-ordinates of the point. Apply the model-to-global (a.k.a. local-to-world) transformation of the model to yield in the same co-ordinates but now w.r.t. the world space.
[/quote]

That makes a lot of sense, thanks a lot....Ah. my second question, in max, I can't find any methods in the mesh class that retrieve a face or pointer to a face given a face index.