| 
  • Earn a $50 Amazon gift card for testing a new product from the makers of PBworks. Click here to apply.

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

View
 

Creating the 3D objects

Page history last edited by xuan wang 7 years, 10 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.

Starting from Layar 3.0, it is 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).

  

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 10000.
  • 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 support transparency on the normal material colors in Layar client v6.0 and above. This feature can be found in the latest 3D model converter (v3.0 and above).
  • Blending is also supported in Layar client v6.0 and above. 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. This can be used to merge virtual and real objects in a more natural way. This feature can also be found in the latest 3D model converter (v3.0 and above).
  • The maximum file size of the 3d model is 1mb. 

 

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.
     

MIME type

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

 

Tutorials for creating good 3D models:

 

  • A slideshow basic tutorial on how to create a 3D object with general tips and tricks. Visit the Slideshare presentation here or view it below:

 

  • 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

 

.L3D model examples:

 

If you want to try out how 3d models look like in the Layar reality browser before creating your own 3d model, please download Layar .l3d models HERE.

 

 

 

 

Comments (8)

Sascha Hendel said

at 12:08 pm on Dec 17, 2009

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

What does 0.1 mean? Please provide a hex value (alpha channel is 8-Bit)

Magnus Skog said

at 6:14 pm on Jan 10, 2010

Hi

It would be great if the program could accept only .obj files. Sometimes there might not be a .mtl present.

Thanks
//Magnus

Magnus Skog said

at 8:03 pm on Jan 10, 2010

Hi again :)

I think the contraints on triangles only is a bit tough. There are millions of models out there, just waiting to be projected on Android and iPhone screens. I'd suggest you implement a routine in your converter program that triangulate polygons into triangles. It would remove tons of manual rework in already existing models and would be a great ROI for Layar I'm sure.

Thanks
//Magnus

Magnus Skog said

at 8:04 pm on Jan 10, 2010

*constraints of course.

Why can't I edit my post? :)

Sascha Hendel said

at 9:20 am on Jan 19, 2010

Great Job, Ronald!

Good to know, that there is still one hardworking (and hopefully best paid ;) guy at Layar...
The preview mode and the optimize settings makes 3D conversion much easier.

Sascha

John Sietsma said

at 1:39 am on Feb 1, 2010

I've created some simple shapes in Blender and exported them with the a number of different options, including; "selection only", "materials" and "triangulate" options. When I import them in the new version nothing happens. No feedback at all. When I open them in the old version it either complains about the object not being triangulated or does nothing as well.

I would attach the files here if I could...

I'll go and try another 3D package.

Snipdag said

at 10:40 pm on Jun 26, 2010

First of all thumbs up for the Layar team for making this converter app.
I imported a test 3d model for my obj / mtl model for the "Woonrapport layer" on which I am working and used the preview feature of the converter. It crashed the first time i used it (see stacktrace below).

the erorr log produced by the converter app was as follows:

Stack: [0x05800000,0x05850000], sp=0x0584f280, free space=13c0584ed88k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C [OPENGL32.dll+0x6cc9]
C [OPENGL32.dll+0x9ae7]
C [jogl.dll+0x3ff5]
j com.sun.opengl.impl.GLImpl.glDrawArrays(III)V+0
j com.layar.model3d.Grid.drawLines(Ljavax/media/opengl/GL;)V+21
j com.layar.model3d.Grid.draw(Ljavax/media/opengl/GL;)V+92
j com.layar.model3d.Preview.display(Ljavax/media/opengl/GLAutoDrawable;)V+181
j com.sun.opengl.impl.GLDrawableHelper.display(Ljavax/media/opengl/GLAutoDrawable;)V+29
j javax.media.opengl.GLJPanel$Updater.display(Ljavax/media/opengl/GLAutoDrawable;)V+224
j javax.media.opengl.GLJPanel$DisplayAction.run()V+11
j com.sun.opengl.impl.GLDrawableHelper.invokeGL(Ljavax/media/opengl/GLDrawable;Ljavax/media/opengl/GLContext;Ljava/lang/Runnable;Ljava/lang/Runnable;)V+418
j javax.media.opengl.GLJPanel.paintComponent(Ljava/awt/Graphics;)V+265
j javax.swing.JComponent.paint(Ljava/awt/Graphics;)V+290
*snap*


Its still a bit unclear to me what exactly caused this exception; I changed a couple of things that solved the problem:

- I ran the converter directly from my local computer rather than through a remote desktop (maybe some issues with opengl / drivers?)
- In the converter i scaled down my 3d model
- I used various actions from the edit menu (like drop normals, and some others).

Hope it might help someone in similar situation,
Greets,
Gert-Jan (bark@ipidee.nl)

Ronald van der Lingen said

at 7:04 pm on Jun 27, 2010

Thank you for your feedback. I have heard similar reports before from other Windows users of the Model Converter, but I have not been able to reproduce it properly yet.

Could you give me some more information about your setup? Which version of Windows are you using? 32bit or 64bit? Which java version?

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