Jump to content

View more

Image of the Day

「筋肉兄貴のスーパーラン!」
夕焼けにガラス・・・(´・ω・`)
ガラスは割りたいでしょうけど、割ったらクリアできないですよ。
(o・ω・o)
 #indiedev  #indiegame #screenshotsaturday https://t.co/fhKO5NJ5ee
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net's newsletters to receive the latest updates and exclusive content.


Sign up now

Barycentric Coordinates

2: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
2 replies to this topic

#1 lucky6969b   Members   

1254
Like
0Likes
Like

Posted 30 March 2011 - 12:30 AM

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

#2 haegarr   Members   

7345
Like
1Likes
Like

Posted 30 March 2011 - 01:34 AM

When I have a barycentric coordinate relative to a specific triangle, how can I transform it to world space?

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 the point 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.

#3 lucky6969b   Members   

1254
Like
0Likes
Like

Posted 30 March 2011 - 02:11 AM

When I have a barycentric coordinate relative to a specific triangle, how can I transform it to world space?

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 the point 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.


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.




Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.