使用 Irrlicht 绘制 3D 线
我想在 Irrlicht 3D 场景中绘制从点 (x1, y1, z1) 到点 (x2, y2, z2) 的 3D 线段。
我知道 line3d 类 和这个 addLine3d 方法 但我不明白如何使用它们。这个 IAttributes 类是什么?
有人可以提供一个如何绘制 3d 线的最小示例吗?
您可以假设我知道如何添加相机并绘制场景。
I would like to draw a 3D segment from point (x1, y1, z1) to point (x2, y2, z2) in a Irrlicht 3D scene.
I am aware of the line3d class and of this addLine3d method but I don't understand how to use them. What is this IAttributes class?
Can someone provide a minimal example of how to do draw a 3d line?
You can assume that I know how to add a Camera and draw the scene.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
IAttributes 用于序列化,您不是要保存一条线,而是要绘制一条线。绘制某些东西意味着在驱动程序中设置状态(材质和变换),然后告诉驱动程序绘制它。
您最好的选择是编辑 示例 3 并将
drawVertexPrimitiveList
替换为draw3DLine
,然后像其他节点一样将自定义节点添加到场景管理器中。IAttributes is for serialization, you aren't trying to save a line, you want to draw one. Drawing something means setting the states in the driver (material and transforms), then telling the driver to draw it.
Your best option is to edit example 3 and replace
drawVertexPrimitiveList
withdraw3DLine
, then add your custom node to the scene manager like any other.