My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
AndARModelViewerInstructions  
How to use the AndAR model viewer
Featured
Updated May 29, 2010 by tdomhan

Introduction

AndAR Model Viewer is an Android application that is capable of displaying 3d models on Augmented Reality markers. warning: this app is still in BETA state The models have to be in wavefront obj format.

This application is available in the android market:

Details

First steps

  • Install the application, either search for "AndAR Model Viewer, or use the following barcode:

  • You need to install the OI File Manager, however the app will automatically point you to this app in the market upon the first start.
  • Print out the marker, upon which the models will be projected. The marker will look like this:
  • Select one of the internal models.
  • Wait for the application to load the model. This might take a while, that's perfectly normal. Just be patient:
  • Finally the result should look like this:
  • You may change the size of the model by swiping the screen vertically.

Taking a screenshot

  • First press the menu key.
  • Next press the button "Take a screenshot".
  • The application will now process the image. It will notfiy you, when it's finished.
  • The screenshot you just took can be found in the root folder of your sd-card. It will be named something like AndARScreenshot1234.png

Transforming the model

  • Press the menu key and select the desired transformation mode. You may either scale, rotate or translate the model.
  • Scale: Slide you finger up and down the touch screen. This will enlarge and shorten the model, respectively.
  • Rotate: Slide your finger horizontally and vertically, this will rotate your model correspondingly.
  • Translate: Slide your finger horizontally and vertically, this will translate your model correspondingly.

Custom models

The application is capable of showing custom wavefront obj models. Most 3d modelling software out there can export this format(e.g. 3ds max, Blender). There are currently some restrictions to the models:

  • Every face must have normals specified
  • The object must be triangulated, this means exactly 3 vertices per face.
  • Basic materials and textures are supported.
E.g. when exporting a model from blender make sure you check Normals and Triangulate.

Comment by bobbymar...@gmail.com, Apr 28, 2010

It looks as if the obj and mtl files link to the bar code png instead of the actual files.

Comment by bobbymar...@gmail.com, Apr 28, 2010

I did find those obj and mtl files at http://code.google.com/p/andar/downloads/list The android browser insisted on saving them as .txt files, so I had to rename them.

Finally, the first time I installed it, I didn't have the OI File Browser installed. I was asked to install it automatically, but then choosing the obj file wouldn't take me back to AndAr? Model Viewer.

I ended up uninstalling and reinstalling the model viewer. I reasoned that perhaps the viewer had tried to install a file type into OI browser and failed, and now that I had the OI browser a reinstall would work.

Anyway, the reinstall worked. It looks cool!

Did you think about having the model know where it was last time, and slowly drift in orientation and position towards wherever your algorithm says it should be now rather than always snapping into position? I think that would make it look a lot more stable.

Again, very cool app! I may be coding some stuff on top of this :-)

Comment by project member tdomhan, Apr 29, 2010

hey bobbymartin2, thanks for the comments! should be correct now. Glad you like the app. Yeah that would be possible, though moving the marker fast would not be possible anymore... currently I'm concerned with getting the app to run on all the android devices out there

Comment by manmath....@gmail.com, May 13, 2010

Really looks good. Can this application will recognise the metal objects like vessles, glas ..etc.

Comment by hoek...@gmail.com, May 18, 2010

OI file manager or top qr code does not work.

Comment by kenc3...@gmail.com, May 24, 2010

Works on my HTC Incredible with the Superman obj and mtl. Tried with other simple OBJ model but came up with white screen. Will try with a few more OBJs and see what happens.

Comment by kenc3...@gmail.com, May 24, 2010

Yup, tried it on another OBJ and had the same problem. I suspect these OBJs may have the MTLs baked in somehow and that just screws things up.

Comment by kenc3...@gmail.com, May 24, 2010

Found an OBJ of a simple box (Brillo pads) and a corresponding MTL but I still get all white. http://www.turbosquid.com/3d-models/3d-model-of-andy-brillo-box/323372

Comment by project member tdomhan, May 27, 2010

hi kenc3dan, sorry for the inconveniences. I just loaded the model with the newest version and everything works fine. Though the model doesn't reference the texture in the mtl file. This means, it is just a white box on a white plane. Another problem is that the model is not located in the centre of the coordinate system. In the downloads section you will find an obj model of the Android mascot: http://code.google.com/p/andar/downloads/detail?name=AndroidMascotObjModel.zip&can=2&q=

Comment by project member tdomhan, May 27, 2010

(ps: by "newest version" I mean a test version that is not yet release)

Comment by juanigna...@gmail.com, Jun 1, 2010

"newest version" doesn't mean "andar svn version", isn't it? I'm beginning a project combining both (AndAR and model viewer) sources and it won't open the file.

Comment by project member tdomhan, Jun 1, 2010

the model viewer, that is available in the market, is not available through the SVN. I think the model viewer from the SVN is probably not working...I should clean that up.. hope I will find some time soon

Comment by juanigna...@gmail.com, Jun 1, 2010

I'm using the code from the model viewer at the SVN and I'm able to load android pet, but nothing else. What would you suggest in order to load models?

Comment by hoek...@gmail.com, Jun 1, 2010

hi can the viewer be made availible as .apk on this site. as im in south africa and when i scan the qr code it does not find the app in market..

Comment by hoek...@gmail.com, Jun 1, 2010

sorry to just give more detail, i can get andar, but not andar model viewer.

Comment by project member tdomhan, Jun 1, 2010

@hoektoe that is correct. I'm considering to release it as open source in the future, however currently it is not. The application can be found in the slideme market, too: https://slideme.org/application/andar https://slideme.org/application/andar-model-viewer I hope that works in south africa, if not just say so :D

Comment by juanigna...@gmail.com, Jun 2, 2010

Have you seen min3d in order to load models? http://code.google.com/p/min3d/ It's just been released, and it looks certainly interesting. I'm trying to mix both, but it's not that straightforward, since both define incompatible Renderers.

Comment by davema...@gmail.com, Jun 12, 2010

Can anybody help me play custom models? i have the obj and the mtl but it still doesnt work

Comment by g...@kryptonians.net, Jun 16, 2010

Worked on the first try. The Motorola Droid seems to be straining to keep up, but it does work.

Comment by project member tdomhan, Jun 16, 2010

hi davemaiso, can you tell me at which point your stuck. you selected the obj model or don't see anything, black screen, white screen, etc.??

Comment by Neck...@gmail.com, Jun 17, 2010

Hello,

I've got the same problem with custom models. I compiled the latest sources, uploaded the apk on my HTC Magic. I tried several Obj models and none are working.Nothing is displayed when I shoot the marker. I used models that I found on the web (like here) or I created models from Blender. Thanks

Comment by project member tdomhan, Jun 17, 2010

well I'm lacking information here. if you got a model that does not work, then send it to me and I will see what I can do. However if the internal models or the superman model(is this the one your referring to?) from the downloads section, dont work then something is wrong. The camera video stream is displayed, but not model can be seen on the marker? Do the internal models work? If not: did you print out the correct marker?(http://andar.googlecode.com/files/Android.pdf)

Comment by MaxSMoke...@gmail.com, Jun 22, 2010

Is there any way to make the model viewer load up texture maps? I've always wanted to show people my 3D artwork on my phone, but I haven't found any model viewers for Android, outside of yours. If you could get it to load up texture maps, that would be extremely helpful!

Comment by sma...@gmail.com, Jul 10, 2010

Hi,

First of all thank u for this app. I have a problem with importing .obj custom model. UV coordinats are mess up, when I import same .obj into Maya everything is OK.

HTC Desire

Help plz

Comment by project member tdomhan, Jul 18, 2010

@MaxSMoke777 the model viewer does load textures, if they are specified in the obj model file. If you have any trouble loading them please file a bug report.

@smajky could you provide a sample file which fails to load(correctly) in the model viewer

Comment by j.bros...@gmail.com, Oct 1, 2010

Hi Tom, On my Samsung Galaxy S the models (both built-in and custom) load fine the first time, but every following model won't load and only the camera preview is showing with a much higher framerate (real time). I guess the ARToolkit library bombs out at some place here. I will report back when I harvested the log output.

Comment by srisu...@gmail.com, Oct 5, 2010

It's working on my HTC Tattoo android 1.6. Thank you very much.

Comment by madhusmi...@gmail.com, Oct 25, 2010

Nice concept! ... but could neone help me find free 3d models that could be run with this app? .. thnx ...

Comment by project member tdomhan, Oct 27, 2010

Hi, as attributed in the model viewer application, some of my models are from: http://resources.blogscopia.com/

furthermore you can convert many models using Blender.(http://www.blender.org/)

the google sketchup warehouse provides some models, too: http://sketchup.google.com/3dwarehouse/

hope that helps.

Comment by cl...@mmprint.com, Oct 27, 2010

Just tried it on the HTC EVO and works perfectly.

Comment by Jco...@gmail.com, Oct 28, 2010

Works good on Dell Streak running 1.6. Going to see if I can export a microstaion dgn to some readable format.

Comment by johnnyj...@gmail.com, Nov 15, 2010

The app did not run as expected on my Sony Ericsson X10 Mini Pro with the 2.1 upgrade. The app runs without any errors, but no models show up on the marker. Any pointers on good places in code to debug to catch what can be wrong?

Comment by bland.l...@gmail.com, Nov 15, 2010

What are the exact steps/options to select (uncheck all other options and just check Normals and Triangulate?) to export the 3d model as a compatible OBJ file from Blender?

It would help if you post the steps as most of us are outsiders to 3d model development.

Comment by sanjivudas@gmail.com, Dec 8, 2010

@bland.life - just import a .obj file in blender which you have created from other apps or downloaded then export it, after you enter the file name and press it opens with some option just check Normals and Triangulate in that one and it should work fine

Comment by rindang...@gmail.com, Jan 30, 2011

hi all, am new in AR, am interest about it, but the problem is, I don't know where I must start,

I learn some paper and still confuse of how it works, do someone has a suggestion how I should learn? and which book I should read.

could someone kindly send me a tutorial of it to rindang2t7@gmail.com ? am waiting for all of u'r kindness ^^

Comment by nvar...@gmail.com, Apr 11, 2011

Anyone got it working on a Samsung Galaxy GT-P1000N? Can't get any models to show on that.

The AndAR library does work, though.

Any ideas? I need to build a school project on this and can't get it to work.

Thanks!

Comment by rassall....@gmail.com, Apr 18, 2011

Its a good application for showing 3D in AR. But one question:

How I can change the marker in AndARModelviewer coding. I want to use my own marker. But I didnt find any hints in ocding to change the marker.

Can anyone help me..

thanks Rassall

Comment by andresil...@gmail.com, Apr 22, 2011

My name is André Silveira (Brazil). AnDar? tested and worked well. Includes some markers in the assets folder and it worked (Galaxy TAB P1000). My problem is that I have the full version of AnDar?. The library and other edu.dhbw.andar are compiled (binary). You can send me the files open for andre@um.pro.br.

Comment by andresil...@gmail.com, Apr 22, 2011

I know when a marker is detected? If I can drive to a different intent in Android (phone, browser, video, etc.) ? How do I implement that feature? What classes should I use?


For exemplo: NumMakers? = 3 (Three makers were detected)

NumMakers? = LastNumMakers?();

if(NumMarkers? != null and NumMarkers? > 0) {

for (int i = 1; i < (NumMarkers?+1); i++) {
Marker = detectmarkers(i); switch (Marker) {
case 1: // ---------- open BROWSER
Intent myIntent = new Intent(Intent.ACTION_VIEW); myIntent.setData(Uri.parse(“http://www.url.com”));
startActivity(myIntent); finish();
case 3: // ---------- open VIDEO
VideoView? videoView = (VideoView?)this.findViewById(R.id.video); MediaController? mc = new MediaController?(this); videoView.setMediaController(mc); videoView.setVideoURI(Uri.parse("http://www.video.com/video.mp4")); videoView.requestFocus(); videoView.start();
default:
....
}
}
}

Comment by rikki233...@gmail.com, May 5, 2011

Hi i want to display an image on top of the marker How should i do it?

Comment by bizkit...@gmail.com, May 10, 2011

I have the AndAR app working, but ModelViewer? shows only blank screen with the error log msg "W/System.err(12883): java.io.FileNotFoundException?: camera_para.dat".

Comment by meryq...@gmail.com, Jun 24, 2011

I found that if the camera have more than one same markers in its view. it only shows one 3D object instead of 3 objects. Why is that?

Comment by showgol...@gmail.com, Jul 7, 2011

Hello from Thailand, I'm try to export .OBJ with .MTL from Blender, A model is appear but material is disappear, How could I export material and UVs from Blender, Please advise.

Comment by niladri....@gmail.com, Jul 11, 2011

This Application is not woking on my Galaxy s GT-90003

Comment by rohitjai...@gmail.com, Aug 5, 2011

Does not work on my Galaxy S

Comment by tir...@gmail.com, Sep 22, 2011

hi, there, AndAR DOES work on Galaxy S ( GT-I9000) with android 2.3.4 (JVQ rom), and AndAR model viewer as well as AndARpong does.

I also tested them on an Acer Iconia TAB and only AndAR is working yet not the AndAR model wiewer.

One question : is it possible to show animated models ? regards Eric

really nice apps , good job Tdomhan :-)

Comment by Cpt.Xavi...@gmail.com, Oct 3, 2011

Seems to work on Dell Streak 7 (Android 2.2) but not consistantly. I assume this is simply user error, but the only time I got a model to show up (the android mascot guy) was if I held it steady and focused on the marker from a few feet away for a while, then moving it closer. I only got the model to show up twice, I don't know if maybe it has something to do with the lighting or what. Trying to find documentation that may clear this up.

Comment by Cpt.Xavi...@gmail.com, Oct 4, 2011

Did some looking around, seems like I have the can't view models in landscape orientation problem. Works fine otherwise. Still trying to figure out why my custom model isn't showing though.

Comment by enve...@gmail.com, Oct 13, 2011

Doesn't work on my Asus Transformer either. App seems fine but the models never appear.

Comment by olaiz...@gmail.com, Oct 13, 2011

Works well on my galaxy s+. The textures appear vertically flipped though. I had to reference them to ./ when exporting the .mtl, and flip them so they look right. Tried it with 2 models, 32k faces and 512x512 texture and 3k faces with 1024x512 texture.

Best model viewer that i've found for android so far.

Comment by Remco.B...@gmail.com, Nov 1, 2011

Hi there!

I've been looking for this kind of app for a while now and I would love to use for my presentation next Thuesday! Unfortunately the model doens't appear on my Asus Transformer in the AndAR Model Viewer..! As mentioned earlier, you can see the model if you make a screenshot!

Any chance this could be fixed easely, since the green box is showing fine!

Would be awesome if I could use it for my presentation at school! Great work!

Comment by r.fusel...@gmail.com, Nov 23, 2011

Works great on my Motorola Droid 3 but can't get models to show color they just come in white. I create model in Sketchup, export to 3DS Max and export out to .obj

Comment by madeehaa...@gmail.com, Nov 30, 2011

hey i am loading my own model and its display a white cube. i am loading a building model plz any one help its urgent

Comment by r.fusel...@gmail.com, Nov 30, 2011

Samsung Galaxy tab 10.1 model does not display but shows up in screenshot. Go figure! Any one have any ideas?

Comment by r.fusel...@gmail.com, Nov 30, 2011

If you get a white model be sure to copy the material file along with the obj file in the same directory. I have best success with basic colors.

Comment by r.fusel...@gmail.com, Nov 30, 2011

Anyone interested in specilized AR development? My company is looking for programing support. Contact Ryan Fuselier at ryan@fenstermaker.com

Comment by madeehaa...@gmail.com, Nov 30, 2011

Thank you for your rply but how can i get a material file when exporting in obj? i am using blender to convert .3DS file to .obj and i am checking write materials, triangulate faces, include normals,include edges, include UVs, objects as objects models and apply modifiers when exporting it in .obj. am i making some mistake when exporting in .obj?I am also placing its .mtl file in the same directory but every time i get a white box. plz help thanks

Comment by Dalco...@gmail.com, Nov 30, 2011

Has anyone had any luck in using more complex materials(uvw maps)? Documentation leads me to believe that it isn't supported yet, but I figured that I would ask.

Comment by madeehaa...@gmail.com, Dec 1, 2011

and how to get the side view of object?plz rply

Comment by Dalco...@gmail.com, Dec 1, 2011

to get he side view of an object, all you should have to do is rotate your phone around the marker.

Comment by Dalco...@gmail.com, Dec 1, 2011

or rotate the marker, I may have misunderstood your question.

Comment by madeehaa...@gmail.com, Dec 1, 2011

ok Thank you for your rply one more thing how can i get a material file when exporting in obj? i am using blender to convert .3DS file to .obj and i am checking write materials, triangulate faces, include normals,include edges, include UVs, objects as objects models and apply modifiers when exporting it in .obj. am i making some mistake when exporting in .obj?I am also placing its .mtl file in the same directory but every time i get a white box. plz reply thanks

Comment by Dalco...@gmail.com, Dec 2, 2011

I'm sorry but I can't help you with that. I too am having a problem with materials, they are causing my phone to seize up all together. I've never touched blender because I do all my work in 3ds max. However, with the amount I want to contribute and build software of my own, I see myself learning JAVA in the near future. Hopefully Ill be able to help during that process.

Comment by madeehaa...@gmail.com, Dec 3, 2011

ok thank you plz someone else help i need it urgently. Thanks

Comment by neeni.sh...@gmail.com, Dec 4, 2011

It doesnot work with android 2.3.5 gingerbread

Comment by Boda.Fot...@gmail.com, Dec 9, 2011

Hey, awesome app, everything working on the xoom. Only thing is that when I make my own objects in SketchUp? they dont have any color. I tried all the combinations I could, but nothing gets the objects in anything other than black. What am I doing wrong?

Cheers, Josh

Comment by Boda.Fot...@gmail.com, Dec 12, 2011

Hi All,

to those who are having trouble getting the colors to load for your own models using SketchUp?, follow this example color guide...

newmtl Color_A01? Ns 10.0000

Ni 1.5000 d 1.0000 Tr 0.0000 Tf 1.0000 1.0000 1.0000 illum 2
Ka 0.1000 0.1000 0.0000
Kd 0.1000 0.1000 0.0000 Ks 0.0000 0.0000 0.0000 Ke 0.0000 0.0000 0.0000

newmtl Color_E01? Ns 10.0000

Ni 1.5000 d 1.0000 Tr 0.0000 Tf 1.0000 1.0000 1.0000 illum 2 Ka 0.0000 0.3000 0.3000 Kd 0.0000 0.3000 0.3000 Ks 0.0000 0.0000 0.0000 Ke 0.0000 0.0000 0.0000

newmtl Color_I01? Ns 10.0000

Ni 1.5000 d 1.0000 Tr 0.0000 Tf 1.0000 1.0000 1.0000 illum 2 Ka 0.2000 0.0000 0.2000 Kd 0.2000 0.0000 0.2000 Ks 0.0000 0.0000 0.0000 Ke 0.0000 0.0000 0.0000

the trick is to change the mtl file with a variation of this (like change 0.3 to 0.4) and have this file in the same folder as the obj file.

Comment by madeehaa...@gmail.com, Jan 25, 2012

how to add some button(for menu)at the side of screen when viewing model in AndARModelViewer? plz someone reply thank you

Comment by tak...@gmail.com, Feb 2, 2012

I have a problem here... How can I obtain position and direction of camera.. ??? like two vectors.. maybe? Thanks

Comment by jaco.coz...@gmail.com, Feb 7, 2012

Hi r.fusel...@gmail.com, did you manage to solve the problem where your model only shows in the screenshot? I have the same problem on my Galaxy Tab 10.0? Thanks.

Comment by blitz.fi...@gmail.com, Feb 16, 2012

I get my models to work by creating them in 3Ds Max or Sketchup, exporting from Max as .obj and from Sketchup as Collada and importing to Blender and exporting again as OBJ from there... Make sure when exporting from Max to do it as Quads and only Triangulate from Blender! For some reason the texture gets flipped so i had to flip it in Max first (so it looks mirrored). Also make sure to copy the .mtl file and the texture too (i use .jpg) if you are using one! I can't get transparency to work yet, perhaps I need to use a transparent png? not sure....

Comment by 84philipp@gmail.com, Feb 18, 2012

Hey, first thanks for the great library, worked pretty intense on it the last week there are several bugs/difficulties though ...

i wrote an adapted version of the modelviewer, internal files do not support textutes not hard to add though, there is a comment in mtl parser actually

big problem is the 2 surfaces, opengl + cam over each other, this is officially not supported and can and will result in weird results, for example that the model is only visible at certain times (though always in the screenshot). usually first time you start the app but after resuming, restarting the activity it is not visible

if you change the order of the surfaces, model is invisible the first start but then visible, hacked this together with something like

Log.i("DBG-FIRST", String.valueOf(firststart));
if (firststart == false) {
frame.addView(previewSurface); frame.addView(glSurfaceView);
} else {
frame.addView(glSurfaceView); frame.addView(previewSurface);
}

has to be changed in the lib itself

texture loading has problems too

make sure to:

BitmapFactory?.Options opts = new BitmapFactory?.Options(); opts.inScaled = false;

transparent pngs are not working can be fixed by enable gl_blend BEFORE loading the textures just before using them is not enough

gl_blend has problems with several devices

if you use custom renderer, check how often gl_init is called its not clean

.. ..

..

stumbled over lots of stuff and fixed lots by clean solurtions but also by pretty dirty hacks but still very happy that this was opensourced

Comment by madeehaa...@gmail.com, Feb 21, 2012

hey..i want to display slideshow in the bottom of the screen and at the same time i want to view the model in the camera..how can i run these two things together?

Comment by stere.qu...@gmail.com, Feb 23, 2012

hi

i tried your lib and on my Asus EEE Pad TF101 the chooser and pong sample doesn't work if i compile in android 2.2 or most recent version.

Best regard.

Comment by sobbi...@gmail.com, Mar 7, 2012

hi tdomhan,i try the andar on my i9000 and it work nice.but how can i change the marker?thanks!

Comment by abdullahazzam.azzam3@gmail.com, Mar 9, 2012

hi tdomhan whether multimarker can be applied in the AndAR model viewer? how if you can? thanks

Comment by madeehaa...@gmail.com, Apr 9, 2012

hey plz tell me how to show some text on marker instead of model?

Comment by zanthe...@gmail.com, May 4, 2012

hi, when i export my sketchup models to the andar model viewer i see the object but not the object colors... why? i don't know i'm doing wrong... help please!

Comment by deddy.n...@gmail.com, May 8, 2012

hi, i want to ask about how to show model 3D with material (some file .jpg) i've tried to convert model with path ./map in file .mtl, but when camera capture marker, camera has stopped. camera such as frozen any idea, please?


Sign in to add a comment
Powered by Google Project Hosting