Jump to content
• ### What is your GameDev Story?

• Advertisement

# barycentric analog

This topic is 4905 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

## Recommended Posts

You know how there's the area interpretation of barycentric coordinates? Is there a volume analog for finding the vertex weights of a point inside a tetrahedron? If so, I think you could find the set of points on a convex hull of some points pretty easily. You could just pick four random points and discard all of the points inside that tetrahedron. Keep doing this... mike http://www.coolgroups.com/forum

#### Share this post

##### Share on other sites
Advertisement
This is off the top of my head, but I think it's right...

Geometrically, the idea is you use the edges of the tetrahedron as axes, and work out a matrix to transform that to a coordinate system where the tetrahedron vertices become (0,0,0), (0,0,1), (0,1,0), and (1,0,0).

The way you do that is if your tetrahedron has verts A, B, C, and D, your edges will be (B-A) (C-A) and (D-A). So the inverse of the matrix you want (where the edges are column vectors) is:

[ (B-A) (C-A) (D-A) A ] = T*R*S

T*R*S means that this matrix is the result of a Scale, then Rotation, then Translation, so to invert, we do the corresponding anti-steps in the opposite order.

To anti-scale, you multiply by 1/S, where the S is the length of each edge. To anti-rotate, you transpose the 3x3 rotation part, and to anti-translate you apply the negative translation.

#### Share this post

##### Share on other sites
Quote:
 You know how there's the area interpretation of barycentric coordinates? Is there a volume analog for finding the vertex weights of a point inside a tetrahedron?If so, I think you could find the set of points on a convex hull of some points pretty easily. You could just pick four random points and discard all of the points inside that tetrahedron. Keep doing this...
I'm not familiar with the AP's solution, but yes, barycentric coordinates work in any dimension. They can be thought of as the weighted average of a set of points, or a parameterization of a set of basis vectors.

I'm not sure about your convex hull idea, though. Once a point is found outside the initial tetrahedron it must be added to the hull. The hull is then no longer a tetrahedron and the barycentric approach won't be of any use. But perhaps I'm misunderstanding your suggestion...

#### Share this post

##### Share on other sites

• Advertisement
• Advertisement
• ### What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

(You must login to your GameDev.net account.)

• ### Popular Now

• 15
• 10
• 11
• 9
• 9
• Advertisement
• ### Forum Statistics

• Total Topics
634146
• Total Posts
3015782
×

## Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!