Skip to content
Snippets Groups Projects
Commit 85b40520 authored by Andrew Heather's avatar Andrew Heather Committed by Mark OLESEN
Browse files

ENH: Added new glTF sammpled set writer

Description
    Writes point data in glTF v2 format

    Two files are generated:
    - filename.bin  : a binary file containing all scene entities
    - filename.gltf : a JSON file that ties fields to the binary data

    The output can contain both geometry and fields, with additional support
    for colours using a user-supplied colour map, and animation of particle
    tracks.

    Controls are provided via the optional formatOptions dictionary.

    For non-particle track data:

    \verbatim
    formatOptions
    {
        // Apply colours flag (yes | no ) [optional]
        colours     yes;

        // List of options per field
        fieldInfo
        {
            p
            {
                // Colour map [optional]
                colourMap       <colourMap>;

                // Colour map minimum and maximum limits [optional]
                // Uses field min and max if not specified
                min             0;
                max             1;

                // Alpha channel [optional] (uniform | field)
                alpha           uniform;
                alphaValue      0.5;

                //alpha           field;
                //alphaField      T;
                //normalise       yes;
            }
        }
    }
    \verbatim

    For particle tracks:

    \verbatim
    formatOptions
    {
        // Apply colours flag (yes | no) [optional]
        colours     yes;

        // Animate tracks (yes | no) [optional]
        animate     yes;

        // Animation properties [optional]
        animationInfo
        {
            // Colour map [optional]
            colourMap       <colourMap>;

            // Colour [optional] (uniform | field)
            colour          uniform;
            colourValue     (1 0 0); // RGB in range [0-1]

            //colour          field;
            //colourField     d;

            // Colour map minimum and maximum limits [optional]
            // Note: for colour = field option
            // Uses field min and max if not specified
            min             0;
            max             1;

            // Alpha channel [optional] (uniform | field)
            alpha           uniform;
            alphaValue      0.5;

            //alpha           field;
            //alphaField      T;
            //normalise       yes;
        }
    }
    \endverbatim

Note
    When writing particle animations, the particle field and colour properties
    correspond to initial particle state (first data point) and cannot be
    animated (limitation of the file format).

    For more information on the specification see
    https://www.khronos.org/registry/glTF/
parent 0f155daf
Branches
Tags
1 merge request!503sampledSets - enable writer construction from dictionary; glTF export
Showing
with 2978 additions and 0 deletions
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment