使用 XNA 渲染任意多边形

发布于 2024-10-08 19:01:05 字数 130 浏览 0 评论 0原文

寻找一种简单的方法来渲染任意顶点列表(在二维平面上)...我猜我必须进行某种细分,并且必须处理凹/凸多边形。在这里不是寻找疯狂的可视化......只是想渲染一个平面形状。

当然其他人以前也遇到过这种需求吗?任何提示将不胜感激:-)

Looking for a simple way to render a list of arbitrary vertices (on a 2d plane) ... I'm guessing that I'll have to do some sort of tessellation, and will have to deal with concave/convex polygons. Not looking for a crazy visualization here ... just want to render a flat shape.

Surely others have encountered this need before? any tips would be appreciated :-)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

寂寞陪衬 2024-10-15 19:01:05

你实际上是在进行三角测量。

尝试 Nick Gravelyn 的 Triangulator 库。上次我使用它时,存在一个错误,即某些多边形会从内到外进行三角测量。但是,如果您浏览一下错误跟踪器,我认为那里有一个修复程序(可能是这个)。

You're actually after triangulation.

Try Nick Gravelyn's Triangulator library. Last time I used it there was a bug in that some polygons would triangulate inside-out. But if you poke around the bug tracker I think there's a fix there (perhaps this one).

那一片橙海, 2024-10-15 19:01:05

Depending on how simple you need to go, you can check out this Primitives Sample on msdn. It's ripped out of the SpaceWar sample and should get you started with basic primitives.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文