April 2020
Intermediate to advanced
716 pages
18h 55m
English
In order to add 3D objects to the game world, we will use the Entity component, which allows us to render 3D objects in React 360. The Entity component can be added in the view as follows:
<Entity source={{ obj: {uri: "http://linktoOBJfile.obj "}, mtl: {uri: "http://linktoMTLfile.obj "} }}/>
Files containing the specific 3D object's information are added to the Entity component using a source attribute. The source attribute takes an object of key-value pairs to map resource file types to their locations. React 360 supports the Wavefront OBJ file format, which is a common representation for 3D models. So, in the source attribute, the Entity component supports the following keys:
Read now
Unlock full access