This article describes how to use a custom reference in the 3D Tiles Processing Engine.

Working with ILcdModelReference

You can describe the coordinate system in which an original dataset is defined in an ILcdModelReference.

The model reference may be null. In that case, the resulting 3D Tiles tileset will not have a georeference. You cannot properly add a dataset without a georeference to a Luciad application. A dataset without a georeference is centered on the 0,0,0 coordinates by default, with a size in meters.

The easiest way to position a dataset on the globe is to use a TLcdTopocentric reference. It is a Cartesian reference with the origin positioned at a specific geodetic location, defined in longitude, latitude, and height values, with the Z-axis tangent to Earth’s ellipsoid and the Y-axis pointing towards the North Pole.

Program: Example of creating a TLcdTopocentric reference centered on longitude 45.2°, latitude 1.2° and at 125 meters above sea level using the standard WGS84 geodetic datum.
  TLcdXYZPoint origin = new TLcdXYZPoint(45.2, 1.2, 125);
  TLcdTopocentricReference reference = new TLcdTopocentricReference(new TLcdGeodeticDatum(), origin);

Using the reference

There are 2 ways to define what reference is used to process the dataset. If a single reference is valid for every file in the dataset, specify it as follows:

Program: Example of creating a TLcdTopocentric reference
  TLcdXYZPoint origin = new TLcdXYZPoint(45.2548, 1.254, 125);
  TLcdTopocentricReference reference = new TLcdTopocentricReference(new TLcdGeodeticDatum(), origin);
  TLcd3DTilesProcessorBuilder.newBuilder()
                             .inputPath("c:/meshes/")
                             .outputPath("c:/meshes/tiled/")
                             .reference(reference)
                             .process()
                             .get();

If each input file has its own reference, you can plug in a factory function instead.

Program: Example of using a reference factory
  TLcd3DTilesProcessorBuilder.newBuilder()
                                 .inputPath("c:/meshes/")
                                 .outputPath("c:/meshes/tiled/")
                                 .referenceFactory(aMeshFile -> {
                                   // implement some logic that retrieves the
                                   // correct reference based on the file name.
                                 })
                                 .process()
                                 .get();