Importing 3D models

Detailed 3D models can be imported into OrcaFlex and used to represent the various model objects in shaded graphics. Some examples of these are shown on the OrcaFlex image gallery; others, including the object data, can be found among the OrcaFlex examples. Included with OrcaFlex installation is a collection of very basic, generic models which you are free to use. If, instead, you wish to use a detailed model of a project-specific vessel, buoy, template etc, you can import such models into OrcaFlex one of the following formats:

These describe a surface mesh and, possibly, material (colour and texture) properties for such a model.

OrcaFlex displays 3D models using a Physically Based Rendering (PBR) approach. This means that you can render a model that uses materials and textures that define optical properties further than the base colour, to improve the photorealism of the render.

3D modelling packages

A number of 3D modelling packages are available which support export in .x or .obj format. An up-to-date list of these, both commercial and free or open source, with links to their respective websites, is maintained on our own website on the shaded graphics support page.

Assimp

OrcaFlex uses the Open Asset Importer Library (Assimp) to import both DirectX and OBJ files. You should be able import these file types into OrcaFlex directly from the export of most 3D modelling packages.

To ensure that the 3D model is properly aligned with the OrcaFlex coordinate system, you can either export it with the axes already aligned, or you can apply a translation and rotation to the 3D model within OrcaFlex.

The model can also be switched between the right or left-handed axis convention using the mirror in plane option (this also modifies the face normals and winding direction to preserve the lighting and culling characteristics).

Assimp imports 3D models from various file formats into common data structures, and OrcaFlex makes use of a subset of this information. Specifically, of the material properties listed in the documentation, OrcaFlex uses the following:

Assimp property OrcaFlex usage Valid range
COLOR_DIFFUSE Base colour to render the object. sRGB
COLOR_EMISSIVE Emitted light (does not affect other objects). sRGB
METALLIC_FACTOR 0 to treat the object as a dialectric, 1 to treat the object as a metal. 0 to 1
REFLECTIVITY Modulate the specular highlights. 0 to 1
REFRACTI Alternative method of modulating the specular highlights if REFLECTIVITY is omitted. 1 to 1.8
ROUGHNESS_FACTOR Modulate from smooth to rough. 0 to 1
SHININESS Alternative method of modulating rough to smooth, interpeted as Blinn-Phong power >= 0
ANISOTROPY_FACTOR Modulate asymmetry in specular reflection. 0 to 1
SHEEN_COLOR_FACTOR An additional grazing component. 0 to 1
CLEARCOAT_FACTOR A second layer of specular reflection. 0 to 1
CLEARCOAT_ROUGHNESS_FACTOR Modulate the glossiness of the clearcoat layer. 0 to 1
BUMPSCALING Modulate the effect of the normal map texture. 0 to 1
OPACITY Transparency. 0 to 1

OrcaFlex also uses PBR textures associated with a material to provide per pixel detail. Specifically, OrcaFlex uses the following:

Assimp texture OrcaFlex usage
DIFFUSE Combined with the base colour (COLOR_DIFFUSE), defined in sRGB.
EMISSIVE Overrides the emissive colour (COLOR_EMISSIVE), defined in sRGB.
DIFFUSE_ROUGHNESS Combined with the roughness value (ROUGHNESS_FACTOR).
AMBIENT Ambient occlusion – indirect shadowing.
SPECULAR Combined with the specular value (REFLECTIVITY).
NORMALS Normal map – sub vertex surface normals, defined in tangent space ($X$ left, $Y$ forward, $Z$ up).
METALNESS Combined with the metallic value (METALLIC_FACTOR).
SHEEN Combined with the sheen value (SHEEN_COLOR_FACTOR).

Wavefront OBJ file format

The Wavefront .obj file format and the associated material files (.mtl) is a commonly used interchange format for 3D meshes and their properties. A description of the file specifications are here: OBJ specification and here: MTL specification.

The .mtl files are optional, if no material files are referenced by the .obj file, the object will be drawn in the pen colour defined by that object's drawing data in OrcaFlex.

DirectX file format

OrcaFlex assumes that DirectX models have a left-handed coordinate convention (with the $z$-axis positive into the screen, and the $x$ and $y$ axes in the plane of the screen), and thus automatically applies a transformation to the 3D model into the OrcaFlex coordinate system on import.