Skip navigation links
LuciadFusion
2023.1.08

Package com.luciad.format.object3d

This package defines interfaces for the modelling of arbitrary 3D geometries.

See: Description

Package com.luciad.format.object3d Description

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:

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

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
Skip navigation links
LuciadFusion
2023.1.08