Importing polygonal data

Displaying 3D Model Formats

Vaporgui is capable of importing and displaying geometric models stored in numerous 3D modeling scene formats. The Open Asset Import Library (ASSIMP) performs the task of reading the 3D model file and translating the model description into a common format undertood by vaporgui. Supported 3d model file formats are described on the ASSIMP web site. After the model description is read by ASSIMP it may need to be geometrically transformed (scaled, translated, or rotated) before it can correctly oriented within a visualizer. The remainder of this document discusses options for model transformation.

Case 1: static geometry, single transformation:

For the simplest case where geometry (3D model) does not vary over time, the geometry is not replicated within a VAPOR scene, and only a time-invariant modeling transformation is needed, the path to the model file as well as an associated transformation (translation, scale, rotation) can be specified directly from the GUI. I.e. the GUI provides a file selector and an ordered list of transformations that can be adjusted manually.

Case 2: time varying geometry and/or multiple transformations:

If either the geometry or modeling transformations vary over time, or multiple instances of the geometry are required, the specifications for the file path(s) and transformations are provided via a .vms file: an XML file that is analogous to the .vdf file. The syntax for the .vms file is defined by the pseudo BNF description:

XML := [<File>] [<Transform>+] [<Timestep>+]

Timestep := [<File>] [<Transform>]+

Transform := <[Scale]+ [Translate]+ [Rotate]+>

Scale := <x y z>

Translate := <x y z>

Rotate := <x y z theta>

Matrix := <m0 m1 … m15>

<x>, <y>, <z>, <m0-15>, <theta> := float

<File> := string

where “[ ]” is an optional language component, and “+” means one or more. 

If an optional element is missing from a Timestep a default value is used. The default File is “vaporscene.obj”. The default scale, translation, and rotation are the identity transforms.

The transforms will be applied to the model in reverse order (i.e., the view-model matrix will be multiplied by the transformations in the order they are read). Setting the optional top-level  (global) File and Transform elements changes the default values used within a Timestep.

The angle theta in the Rotate transform is specified in degrees.

The 4x4 matrix transform should be specified in row-major.

Any transforms defined in the Model’s GUI tab will be applied after the transforms defined in the scene file.

If the number of time steps defined by the scene meta file is less than the number of time steps contained in the VDC then the metadata values of the most recently defined time step are used.

If multiple transforms are specified a separate instance of the model is displayed for each transform.

Note: the .vms file must be named with the ".vms" extension for vaporgui to correctly recognize the file.

Example 1

This example specifies a single .vms scene file and a single transform to be used for all time steps in the VDC. It replicates the functionality supported directly from the GUI without a scene metafile.

<File> myfile.obj </File>

<Transform>

<Scale> 2.0 2.0 2.0 </Scale>

</Transform>

Example 2

This example demonstrates the specification of time-varying 3D model files, all using the same global transform. Three model files are specified for time steps 0, 1, and 2. Each scene will undergo a translation (0.5, 0.5, 0.5).

<Transform>

<Translate> 0.5, 0.5, 0.5 </Translate>

</Transform> 

<Timestep>

<File> scene0.obj </File>

</Timestep>

<Timestep>

<File> scene1.obj </File>

</Timestep>

<Timestep>

<File> scene2.obj </File>

</Timestep>

 

Example 2

This example shows the specification of both time varying scene files and transforms.

<Timestep>

<File> scene0.obj </File>

<Transform>

<Rotate> 1.0 0.0 0.0 5 </Scale>

</Transform>

</Timestep>

<Timestep>

<File> scene1.obj </File>

<Transform>

<Rotate> 1.0 0.0 0.0 10 </Scale>

</Transform>

</Timestep>