3D Model Converter


 

Please NOTE that this documentation will not be updated anymore. Please see our new Developer Documentation Site for the latest updates! The content of this page can be found here.

Summary

 

The Layar3D Model Converter tool is used to convert models in the Wavefront (.obj/.mtl) format to Layar3D (.l3d) that can be used in Layar app. The converter is written in Java and can be run on any system with the latest Java runtime (v6.0 and above), including Windows, Mac, and Linux. The latest version of the Model Converter is based on the Java Webstart technology, which allows you to run the application both in online mode from the browser or offline from the Webstart cache. The advantage of this solution is that we can maintain a single build for the different platforms, while leveraging on native libraries to facilitate OpenGL 3D preview in the converter. Also, you should be notified of updates automatically so you are sure to work with the latest version.

 

     Main Features

 

 

Download

 

         Please check the Release History - 3D Model Converter for more detailed information.

         NOTE: If the update from previous version fails, please remove the old app file and download the new one again.

 

          http://public.layar.com/downloads/Layar3DModelConverterCLI.jar

 

Tour of Layar3D Model Converter

 

In this section, we will walk you through each main feature mentioned above and explain how you can use Layar3D Model Converter.

 

Step 1: Importing Wavefront (.obj/.mtl)

 

 After launching the Layar3D Model Converter, you first have to load the model you want to convert to Layar3D. Select "File -> Import Wavefront (.obj/.mtl)". Please see Creating the 3D objects to learn how to create a good 3D model for displaying in Layar. You can also open a .l3d file directly (Select "File ->Open").

 

                                                             

 

Step 2: Inspect model

 

When you have loaded the model, you will see an overview of the model, including details about the number of verticex, faces, and materials. Also a list of the model dimensions is shown. The minimum Layar version shows you for which layar client version this 3D model is supported. Please NOTE that if there is Opacity value in imported .obj/.mtl files, the minimum layar client version will be automatically set to layar version 6.0 +.

 

 

 

Step 3: Edit materials (optional)

 

On the 'Materials' tab, you can:

 

 

 

 

Step 4: Add texture animation (optional)

 

Under the "Materials" tab, you can enable texture animation by changing the "Type" value to "animated". This will allow you to add animation frames to the texture. Please check Create texture-animated 3D models   to learn how to created texture animated 3D model.

 


 

 

Step 5: Preview the model in 3D (optional)

To save time with testing in the Layar browser, you can use the " Preview" tab to see how the model will look in Layar. This preview window allows you to view the model from different distances and angles.

 


 

Step 6: Edit the model to fix any normal, positioning, or scaling issues (optional)

 

Use the edit menu to manipulate the model and to optimize it display in Layar.

 

 

 

 

Step 7: Layar3D placement on the map (optional)

 

Under "Placement" tab, you can place the 3D model directly on the map. A bird view of the model on the map is shown. The main functionality is:

For detailed explanation on how to use the Placement function, please check Positioning 3D Model within Layar3D Model Converter  .

 


 

Step 8: Save as Layar3D (.l3d)

 

Select "File -> Save As..." to save your model to the Layar3D (.l3d) format. This will create a single file that contains the model including all textures. This is the file you need to refer to in your POI request response. Select "File -> Save" to update the existing Layar3D (.l3d) model.

 

It is also possible to save the same model for different layar version using "File -> Save for version". This is useful when you want to have your models work on various versions of layar clients. You can determine which 3d model should be returned in getPOIs response based on the "version" parameter in getPOIs request. Please NOTE that if you save the model for a specfic older version, some features will be stripped from the model. For example, transparent materials might become opaque, and animated textures might be converted to a static version.

 

 

Tutorials

 

 

 

Command line version

 

As mentioned above, in order to support conversion of 3D models in an automated way, a command line version of the Layar3D Model Converter is also available.

 

This can be invoked in the following way:

 

java -jar Layar3DModelConverter.jar [options] <inputfile.obj>
 -o : Output file. If omitted, the filename will be based on input filename.

 -d : Drop normals. Let the client calculate smooth normals.

 -f : Calculate face normals. Use normals per face causing hard edges in the model.

 -m : Optimize materials. Groups the faces by material to improve rendering performance.

 -w : Make diffuse color white. Used to solve dark textured models.

 -t : Load the given image file as texture on the material(s).

 -x : Rotate model 90 degrees around the X axis. Can be used to fix orientation of .obj file.

 -X : Rotate model -90 degrees around the X axis. Can be used to fix orientation of .obj file.

 -h : Show this help message.

 

You are free to integrate this command line converter in your batch scripts.

 

Build Layar3D model on the fly

 

It is also possible to create Layar3D model on the fly in layar client. One use case is that you provide a map on the grid and generate the map while an user is walking. In case you want to use this feature, please contact us for the Layar3D file structure documentation. One way to do this is to use the command line version of the Layar3D model converter.