重心计算有什么用? [英] What are barycentric calculations used for?

查看:44
本文介绍了重心计算有什么用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在研究XNA的重心方法,我在网上找到的描述对我来说还很模糊.一个例子会很好.只需用英语做一个解释就可以了……目的是什么,如何使用它?

解决方案

来自

I've been looking at XNA's Barycentric method and the descriptions I find online are pretty opaque to me. An example would be nice. Just an explanation in English would be great... what is the purpose and how could it be used?

解决方案

From Wikipedia:

In geometry, the barycentric coordinate system is a coordinate system in which the location of a point is specified as the center of mass, or barycenter, of masses placed at the vertices of a simplex (a triangle, tetrahedron, etc).

They are used, I believe, for raytracing in game development.

When a ray intersects a triangle in a normal mesh, you just record it as either a hit or a miss. But if you want to implement a subsurf modifier (image below), which makes meshes much smoother, you will need the distance the ray hit from the center of the triangle (which is much easier to work with in Barycentric coordinates).

Subsurf modifiers are not that hard to visualize:

The cube is the original shape, and the smooth mesh inside is the "subsurfed" cube, I think with a recursion depth of three or four.


Actually, that might not be correct. Don't take my exact word for it, but I do know that they are used for texture mapping on geometric shapes.

Here's a little set of slides you can look at: http://www8.cs.umu.se/kurser/TDBC07/HT04/handouts/HO-lecture11.pdf

这篇关于重心计算有什么用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆