# Development of the Virtual Reality Application:
## 2 Methodology
### Polygon Mesh Optimization  
#### 2.2.1 Conversion of a Rhino3D Model to a Polygon Mesh  
As mentioned in the previous chapter, Rhino3D uses the NURBS mathematical model for the surfaces produced (Figure 5).  
This method cannot be used by the other software utilized in this project, so it was necessary to convert all the surfaces from NURBS surfaces into another surface type, called a polygon mesh. Polygon meshes are collections of vertices, edges, and faces that define an object and can be used by any 3D-modeling and design software. There are many common file formats that can contain meshes, and for this project the.FBX file format [23] was chosen as it can contain many different objects separately, while also preserving the hierarchy of those objects.  
In order to export a NURBS surface into a.FBX file containing all the polygonal meshes, a conversion from NURBS surface to polygonal mesh was deemed necessary. This conversion had to be as lean as possible, meaning as few polygons as possible while maintaining all the surface's information (geometry and curvature). Furthermore, in order to make future steps easier, with regard to unwrapping and texturing of the models (on  
Figure 4: The fully rigged 3D model of Azov (from the stern).  
Figure 5: NURBS surfaces in Rhino3D.  
which more details are provided later), it was desirable to make all or most of the polygons quads, meaning that each polygon was defined by four edges and four vertices. Rhino3D provides two ways for doing this conversion:  
* Automatically during export, resulting in much undesired topology (many triangles, especially around holes in the mesh) making subsequent processes more difficult.
* Quad remeshing, which attempts to convert the NURBS surface into a polygon mesh containing only quads [24].  
A quad-based topology means that a mesh is comprised mainly by quads. This is a generally preferable practice for 3D artists, for various reasons. A quad-based model is the most useful form for 3D modeling, as it ensures a clean topology and provides edge flow that can easily be adjusted. This is highly important when further editing is needed, for example when attempting to reduce polygon count, or when unwrapping is mandatory for texturing the mesh; as in this case. Secondly, subdividing a clean quad-based topology is a controlled and low-risk task, while creating edge loops in a primarily triangle-based mesh can be unexpected and cause shading issues that will be rendered into the game engines.  
Whilst game engines such as Unity3d triangulate the 3D model during import, the triangulation of a quad is considered more predictable than that of an Ngon (a polygon with more than four edges), which may result in unwanted shadings and normal vector calculations.  
Quad remeshing was chosen because it produced excellent quality polygon meshes that maintained all the original surface's information while being solely comprised of quads. The following figure (Figure 6) clearly shows, in contrast to the previous figure, that the mesh holes are completely defined by the quads around them, while the NURBS surface has no discernible way of defining the holes.  
The quad mesh does have some issues, especially in the bow area, but all those are refined during the retopology that takes place in the immediate step following this conversion. The quad remeshing tool could not be used on all objects of the models, so retopology was completed on those objects.  
After the quad-remeshing process was complete, all the meshes created were exported into a.FBX file which was then used for retopology, unwrapping, and texturing of the models.