Package com.luciad.format.object3d
This package defines interfaces for the modelling of arbitrary 3D geometries.
A typical use-case is to style data in your view using a 3D icon defined in an external file. Out-of-the-box we support the following 3D file formats which can be decoded into one of the interfaces of this package:
- The Collada file format (*.dae): see below for more information.
-
The WaveFront OBJ file format (*.obj):
see the
com.luciad.format.object3d.obj
package for more information. -
The OpenFlight file format (*.flt):
see the
com.luciad.format.object3d.openflight
package for more information.
Examples on how to work with OBJ and OpenFlight data can be found in their respective packages. There is no specific Collada package nor Collada API. Instead, working with Collada data is explained below.
Working with Collada data
Input files
File | Required | Entry point | Description |
---|---|---|---|
*.dae | x | x | A Collada file |
Supported versions and specifications
-
This decoder partially supports Collada version 1.4.1 (namespace
http://www.collada.org/2005/11/COLLADASchema/
)
Known limitations
Currently, LuciadLightspeed only parses Collada elements that are relevant to create a valid ILcd3DMeshNode
.
Elements related to cameras, animations, etc. are ignored.
For geometries only meshes based on triangles are supported, other geometries will be ignored.
These are the same limitations as used by Google Earth.
Note that files containing such unsupported features can be opened in most cases, and the mesh can be visualized. The unsupported settings will simply be ignored. Decoding will only fail when the file is invalid (e.g. does not respect the specification), or does not contain enough supported features to visualize something.
The Collada data can only be visualized on a Lightspeed view. GXY views are not supported.
Typical Collada use-cases:
Style a point using a Collada 3D icon
On a Lightspeed view, you can use a Collada icon to style your points.
This is achieved by using a TLsp3DIconStyle
, as illustrated in the following snippet
and explained in the LuciadLightspeed developer guide:
TLsp3DIconStyle iconStyle = TLsp3DIconStyle.newBuilder().icon( "source.dae" ).build();
Collada data embedded in a KML file
Our TLcdKML22ModelDecoder
and TLspKML22LayerBuilder
classes support Collada data embedded in KML/KMZ files.
As such, KML/KMZ files containing Collada data can be visualized on a Lightspeed view
just like any other KML/KMZ file.
No extra steps are needed.
Consult the Javadoc of those KML classes and the KML developer guide for more information on working with KML data.
Correcting the rotation of a Collada icon
When styling a point using a Collada 3D icon, it is important that the rotation defined in the Collada file matches
the rotation assumed by Lightspeed.
A mismatch in rotation could for example result in an airplane that appears to be flying backwards or sideways.
Consult the class javadoc of the TLsp3DIconStyle
for more information on the rotation conventions.
While the API of the TLsp3DIconStyle.Builder
class allows you to correct the rotation of your icon,
it has the drawback that it must be corrected over and over again, each time you use that Collada file.
This section explains how you can correct the rotation in the Collada file itself.
The major benefit here is that you need to alter the rotation only once, and afterwards you can use the modified
version of the Collada file over and over again without needing to correct the rotation again.
Correcting a backwards moving icon
This requires a rotation of 180 degrees.
This is achieved by adding the rotation to each <node>
element that is a direct child of <visual_scene>
.
So change all
<visual_scene ...>
<node ...>
occurrences to
<visual_scene ...>
<node ...>
<rotate>0 0 1 180</rotate>
Correcting a sideways moving icon
This requires a rotation of 90 or -90 degrees.
This is achieved by adding the rotation to each <node>
element that is a direct child of <visual_scene>
.
So change all
<visual_scene ...>
<node ...>
occurrences to
<visual_scene ...>
<node ...>
<rotate>0 0 1 -90</rotate>
when your airplane is flying with his right wing/side in the forward direction, and to
<visual_scene ...>
<node ...>
<rotate>0 0 1 90</rotate>
when your airplane is flying with his left wing/side in the forward direction.
- Since:
- 5.3
-
ClassDescriptionAn ILcd3DMesh represents a 3D geometric object.Describes a node in a hierarchical tree of 3D meshes.An interface that represents the visual aspects of an ILcdStyled3DMesh.An interface for a 3D primitive contained in an ILcd3DMesh.An interface for an individual element of an ILcd3DPrimitive.An extension of ILcd3DMesh that can provide an ILcd3DMeshStyle for every primitive.A builder class for creating 3D meshes corresponding to a set of common shapes, namely: arrow: a 3D arrow, composed by a conic tip and a cylindrical stick box: a parallelepiped shape cone: a conic frustum shape (a cylinder is obtainable as a sub-case) cross: a set of three axis-aligned segments ellipsoid: an ellipsoidal shape pyramid: a pyramidal frustum shape with squared baseEnum representing the possible orientations of the axis of symmetry of a mesh.Default implementation of ILcd3DMeshStyle.A builder class for creating mesh styles.A type-safe enumeration of the valid primitive types that can be used inside an
ILcd3DMesh
.