Draw a 3D line with Irrlicht

I would like to draw a 3D segment from the point (x1, y1, z1) to the point (x2, y2, z2) in a three-dimensional Irrlicht scene.

I know the line3d class and 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 draw a 3d line?
You can assume that I know how to add a camera and draw a scene.

+5
source share
1 answer

IAttributes for serialization, you are not trying to save the string, you want to draw it. Drawing something means setting up the states in the driver (material and transformations), and then telling the driver to do it.

Your best option is to edit Example 3 and replace it drawVertexPrimitiveListwith draw3DLine, and then add your custom node to the scene manager, like any other.

+3
source

All Articles