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

  • You already know Dokkio is an AI-powered assistant to organize & manage your digital files & messages. Very soon, Dokkio will support Outlook as well as One Drive. Check it out today!

View
 

Creating the 3D objects

This version was saved 13 years, 9 months ago View current version     Page history
Saved by Ronald van der Lingen
on June 25, 2010 at 5:38:48 pm
 

Layar3D Model Converter

 

Starting from Layar 3.0, it will be possible for developers to add 3D objects to their layers. For this purpose, we have defined the Layar3D (.l3d) file format that allows storage of textured 3D models in a single file. This file format is optimized for mobile parsing and viewing.

To allow developers to create their own 3D models for use in Layar, we developed a tool to convert models in the Wavefront (.obj/.mtl) format to Layar3D (.l3d).

 

Tutorials for creating good 3D models:

 

  • A slideshow basic tutorial on how to create a 3D object with general tips and tricks.Layar Tutorial - 3D Content Creation Tips & Tricks
  • A more detailed and advanced manual(pdf) on how to create good 3D objects in Layar. Our 3D artist, Stefan Wassink, will guide you through the steps to create a 3D buiding model.  

         3D in Layar_The manual_v1.0.pdf

 

Model requirements

You can use any 3D modeling software application to create your 3D models, as long as you can export the model to Wavefront (.obj/.mtl) format. When creating your models, take the following into account:

  • Please keep the model complexity as low as possible. The current mobile phones are not powerful enough to render complex models at a decent frame rate. We suggest you keep the maximum total number of polygons visible at the same time at 5000.
  • We only support mesh based objects. While .obj can also hold NURBS based objects, this is not supported.
  • The model should consist of triangles only. Make sure that you convert all quads or higher polygons to triangles.
  • We assume that the unit for the vertex coordinates in the 3D model is set to 1 meter. You can model your object for the correct size or use a scaling factor in your layer at a later stage.
  • We do not support transparency on the normal material colors at this moment (.mtl settings). We only take the RGB values, not the alpha.

 

Texture requirements

We do support texturing of the 3D model, but only for setting the diffuse color of the material. At this moment we do not support multiple textures, e.g. for bump mapping.

  • Texture images MUST be resized to have their width and height be powers of 2, e.g.: 16x16, 32x32, 64x64, 256x128, etc.
  • Please keep your texture images small as larger texture require more bandwith and have a performance impact on the client.
  • Transparency in textures is supported, but you should note that we do not support blending as some of the phones can't do this. This means that for partial transparency (alpha values larger than 0.1) the objects behind them are not displayed, but the camera image is. For alpha values less than 0.1, we use an alpha test in opengl, which means that those parts will not be drawn. This allows you to make cutouts with textures.
     

MIME type

  • On the client we do not check any MIME types, so we have not defined one.

 

Using the Layar3D Model Converter

The Layar3D Model Converter tool is written in Java and can be run on any system with the latest Java runtime, 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.

 

To start the Layar3D Model Converter, go to: http://site.layar.com/downloads/Layar3DModelConverter.jnlp

 

What's new in version 2.0.0:

  • Added support for texture animation. You can load an animated gif image in a material which converts the texture to an animated texture.
    • Note: any L3D model containing animated textures will not be compatible with clients prior to Layar 3.5. Make sure you check the version number to provide a working model to the user. 
  • Added support for .obj files with relative indexes to vertices as can be exported by 3ds Max. 

 

What's new in version 1.5.2:

  • Added support for absolute paths to texture images in the .mtl file as exported by 3ds Max.

 

What's new in version 1.5.1:

  • Added ambient lighting in the preview mode. This lighting is equivalent to the lighting parameters of Layar 3.0.4 and up.
  • Improved error handling during .obj imports.
  • Fixed a bug that improves the command line parsing for the CLI version of the ModelConverter.

 

What's new in version 1.5.0:

  • Triangulation of complex polygons. You can now import .obj files that contain complex polygons, including quads, convex and concave polygons. This allows you to use tools that do not have a triangulate option in embedded in the .obj export, e.g. Google Sketchup Pro.
  • Improved .obj parsing, fixing some bugs on 3D Studio Max exports with incomplete material files. We now use sensible default values to fill in the blanks.
  • Added OpenGL 3D preview panel, which tries to mimic the rendering of the model in Layar as much as possible.
  • Added Material preview panel, which shows the materials used in the model, including the option to modify colors and the shininess parameters of the materials.
  • Automatic texture scaling to fit the size requirement of having the width and height be powers of 2 during .obj/.mtl import.
  • Added basic editing methods:
    • Dropping normals - causes the client 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 OpenGL rendering speeds.
    • Rotate - rotate the model around the X axis by 90 or -90 degrees.

      Note: By default, version 1.5.0 of the Model Converter rotates the models by 90 degrees to fix the fact that most 3D modelling tools export to .obj with the Z axis pointing into the screen instead of upwards. In the previous version, we did not do that so .obj files that worked previously should be rotated by -90 degrees around the X axis to be positioned correctly again.

    • Scale - resize the model by the specified factor. 

 

When you have problems with the webstart verion ,you can still download the previous (more limited) version at:

http://layar.com/downloads/Layar3DModelConverter_v1_0_2.jar

 

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

 After you start the Layar 3D Model Converter, you first have to load the model you want to convert to Layar3D. Select "File > Import Wavefront (.obj/.mtl).

 

 

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.

 

 

 

Step 3: Preview and edit materials (optional)

On the 'Materials' tab, you can see all materials and textures used in the model and you can edit the color and shininess values.

 

 

 

Step 4: 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 5: Edit the model to fix any normal, positioning, or scaling issues

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

 

 

Step 6: 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.

 

 

 

Command line version

To support conversion of 3D models in an automated way, a command line version of the Layar3D Model Converter is available at:

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

 

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.
 -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.

Comments (0)

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