This is the 3rd example application from the book Pro Android Augmented Reality by Raghav Sood, published by Apress. It projects models on a marker.
You may either use the internal models or supply your own models in the wavefront obj format.
- First steps
- Taking a screenshot
- Transforming the model
- Custom models
- First print out the marker, upon which the models will be projected. The marker is located in the assets folder of the project source.
- Select one of the internal models.
- The app will start loading the model.
- After it has finished, you will see a live video stream from the camera.
- Now point the camera to the marker, you should see the model you selected.
- 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
- 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.
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.
Attribution