### Mesh Loading and Rendering 2 (2/7)

Description

This step shows how to load mesh files which are not in OBJ format.

Key points

As we saw in the last step, OglModel can render simply OBJ file. This was done directly in this component because OBJ is widely used. But if you have less common format files, there is a different method to render them.

MeshLoader is used to load several kinds of files. Its loaded data is connected to OglModel, which will used it to visualize. In this example, we render an OFF file, using MeshOffLoader.

Clear the scene to start with just a root node again.

Add a MeshVTKLoader component and rename it "loader". Change the Filename of the object to /Sofa/share/mesh/aneurysm3d_2_small.off.

Add a OglModel.

Save your scene file by selecting File > Save. We will refer to this file as myTutorial.scn.

In your favorite XML editor, open myTutorial.scn. Look for the line:

OglModel template="ExtVec3f" name="oglModel8"

After the name property, add src="@loader". The line should now look like:

OglModel template="ExtVec3f" name="oglModel8" src="@loader"

Save the file. Re-open myTutorial.scn in the Modeler.

Run in SOFA.

You can now see the model of an aneurysm. If it is dark and difficult to see, don't be alarmed. That is simply because of the default colors specified for this model.

### Next