First, we have to import the model component and add it to our scene. Now we need the model itself. You need to know there are various file formats out there, and how to represent 3D models. React VR supported one out of the box from the beginning, which was OBG. Keep in mind, it only describes the geometry of an object.
In our case, I prepared an astronaut model which is in our static assets directory. We add a source property to our model, and it accepts an OBG key which will provide with a file path to the geometry file, and then we add a style attribute. In addition, we move it two meters away from us.
Next, we add the property wireframe, and with this change, the model already becomes visible in our scene. Let's take a closer look how to change the appearance of the model surface. Therefore, we remove the wireframe property and apply color, in our case, orange.
As you can see, the color applies to the whole model. Let's set the model's property lit to true so it is affected by the current lightning setup. As an alternative to this full covering, we can use a material file that can be referenced.
The benefit of a material file is that it contains quite complex definitions of how the surface of the model looks like, for example, various textures or colors that apply to different parts of the surface.
Therefore, we add an MTL key to the source object and reference the path of the MTL file in our static assets. Last but not least, another alternative is to provide a texture. In our case, I use the chess world that already ships with the React VR boilerplate. You can get to pretty interesting results, as you can see.
Keep in mind, the MTL definition overrides the texture's property, which again overrides the style's color attribute.