Skip to content

Commit

Permalink
Add GLTF writer doc.
Browse files Browse the repository at this point in the history
  • Loading branch information
abellgithub committed Jul 30, 2019
1 parent 8b4e072 commit ba05167
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 2 deletions.
2 changes: 1 addition & 1 deletion doc/stages/readers.text.rst
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ filename
.. include:: reader_opts.rst

header
String to use as the file header. All lines in the file as assumed to be
String to use as the file header. All lines in the file are assumed to be
records containing point data unless skipped with the `skip`_ option.
[Default: None]

Expand Down
63 changes: 63 additions & 0 deletions doc/stages/writers.gltf.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
.. _writers.gltf:

writers.gltf
============

GLTF is a file format `specification`_ for 3D graphics data.
If a mesh has been generated
for a PDAL point view, the **GLTF Writer** will produce simple output in
the GLTF format. PDAL does not currently support many of the attributes
that can be found in a GLTF file.

.. _specification: https://www.khronos.org/gltf/

.. embed::

Example
-------

.. code-block:: json
[
"infile.las",
{
"type": "filters.poisson",
"depth": 12
},
{
"type":"writers.gltf",
"filename":"output.gltf",
"red": 0.8,
"metallic": 0.5
}
]
Options
-------

filename
Name of the GLTF file to be written. [Required]

metallic
The metallic factor of the faces. [Default: 0]

roughness
The roughness factor of the faces. [Default: 0]

red
The red component of the color applied to the faces. [Default: 0]

green
The green component of the color applied to the faces. [Default: 0]

blue
The blue component of the color applied to the faces. [Default: 0]

alpha
The alpha component to be applied to the faces. [Default: 1.0]

double_sided
Whether the faces are colored on both sides, or just the side
visible from the initial observation point (positive normal vector).
[Default: false]

4 changes: 4 additions & 0 deletions doc/stages/writers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ dimension type, while others only understand fixed dimension names.
writers.e57
writers.gdal
writers.geowave
writers.gltf
writers.las
writers.matlab
writers.nitf
Expand Down Expand Up @@ -50,6 +51,9 @@ dimension type, while others only understand fixed dimension names.
:ref:`writers.geowave`
Write point cloud data to Accumulo.

:ref:`writers.gltf`
Write mesh data in GLTF format. Point clouds without meshes cannot be
written.

:ref:`writers.las`
Write ASPRS LAS versions 1.0 - 1.4 formatted data. LAZ support is also
Expand Down
2 changes: 1 addition & 1 deletion io/GltfWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ std::string GltfWriter::getName() const { return s_info.name; }

void GltfWriter::addArgs(ProgramArgs& args)
{
args.add("filename", "Output gltf filename", m_filename);
args.add("filename", "Output gltf filename", m_filename).setPositional();
args.add("metallic", "Metallic factor [0-1]", m_metallic);
args.add("roughness", "Roughness factor [0-1]", m_roughness);
args.add("red", "Red factor [0-1]", m_red);
Expand Down

0 comments on commit ba05167

Please sign in to comment.