Friday, September 19, 2014

3d models with Layar

If you want to load 3d models with Layar you need to use the l3d converter. 


How to Use 3D 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 specific 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.

No comments:

Post a Comment