| 
  • If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.

  • Stop wasting time looking for files and revisions. Connect your Gmail, DriveDropbox, and Slack accounts and in less than 2 minutes, Dokkio will automatically organize all your file attachments. Learn more and claim your free account.

View
 

3D Model Converter

Page history last edited by xuan wang 8 years, 6 months ago

 

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

 

  • Import Wavefront (.obj/.mtl) file and Layar3D (.l3d) file.
  • Overview of the imported 3d model, such as the number of verticex, faces, and materials.
  • Edit materials, textures, color and shininess.
  • Enable texture animation.
  • Preview the model in 3D.
  • Basic editing functionality on the model itself, such as resizing, rotating, etc.
  • 3D model location placement on Google maps, including changing the scale and angle factors of a model.  
  • Write 3D model location (lat & lon), object information (size & full) and transform factors (scale & angle) into JSON format.
  • Converter to Layar3D(.l3d) file.  
  • Save the model into different versions which work on different Layar clients. 

 

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.

 

  • To support conversion of 3D models in an automated way, a Command Line Version of the Layar3D Model Converter is available at:

          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:

  • View the material names used in .obj/.mtl files. 
  • Edit material colors, shininess and opacity values. Material transparency is supported and can be manipulated using the Opacity value. The Opacity value embedded in .obj/.mtl files will be prefilled if it is present. By default, the value is 1. 
  • Enable / disable color blending. when blending is enabled, it means that color value of this material is blended with the color of any other objects that are rendered behind it. If it is disabled, it means the objects that are rendered behind it are hidden from view. 
  • Edit "Shader" field with two options - default & nolighting. The "nolighting" option is for people who want to bake lighting effects into textures instead of relying on the standard lighting from the AR view. 
  • Add and edit textures used in the model. 
  • Replace a texture by clicking on the "Replace image" button.

 

 

 

 

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.

 

  • Drop normals - causes the client to to calculate smooth vertex normals by using the average of the normals of all faces that the vertex is part of.
  • Calculate face normals - causes the vertices to have the normals of the faces they are part of. This results in hard edges. 
  • Flip faces - changes the vertex order of each face, which turns the model "inside out".
  • Optimize materials - reorders the faces to be sorted by material. This improves rendering speeds.
  • Rotate -  Rotate the model around X axis by 90 or -90 degrees. This will change the direction where the model itself is facing.
  • Scale - Resize the model by the specified factor. This will result in size change of the model itself.

 

 

 

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:

  • Locate the model by using the "search" function, such as "amsterdam".
  • Single click on the map to get the geo-coordinates and place the model accordingly. 
  • Edit latitude, longitude, scale and angle factors and save the details in JSON format (while saving the model settings, a separate JSON file is created.)

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.

Comments (0)

You don't have permission to comment on this page.