开发者

Draw a 3D line with Irrlicht

开发者 https://www.devze.com 2023-02-23 01:05 出处:网络
I would like to draw a 3D segment from point (x1, y1, z1) to point (x2, y2, z2) in a Irrlicht 3D scene.

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 开发者_JAVA百科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.


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 with draw3DLine, then add your custom node to the scene manager like any other.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号