添加 3D 到 2D 游戏
我正在使用精灵制作一个自上而下的平台游戏。我想添加一些 3D 元素来增加平台的深度,将平台绘制为向下延伸到深渊的柱子。下图说明了这一概念。
我的问题出现在尝试将 3D 模型的顶部与平台精灵对齐时。我将如何设计一个系统,每当我绘制平台对象时,它会在正确的位置自动创建支柱?
I am making a top-down platformer game using sprites. I would like to add some 3d elements to add depth to the platforms, by drawing the platforms as pillars that extend down into the abyss. The concept is illustrated in the image below.
My problem arises in trying to align the top of the 3d model with the platform sprite. How would I design a system that automatically creates a pillar in the proper position whenever I draw a platform object?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您将需要更复杂地渲染世界中的精灵。关于如何将 2d spritebatch 渲染与 3d 融合的一个很好的示例可以在 Shawn Hargreave 的博客上找到:
https:// /blogs.msdn.com/b/shawnhar/archive/2011/01/12/spritebatch-billboards-in-a-3d-world.aspx
You will want to get a bit more sophisticated in how you render the sprites in your world. A great example of how to fuse 2d spritebatch rendering with 3d can be found on Shawn Hargreave's blog here:
https://blogs.msdn.com/b/shawnhar/archive/2011/01/12/spritebatch-billboards-in-a-3d-world.aspx