API v8.3 Changes
NOTE: These are the changes in Developer API v8.3. It is supported in Layar client v8.3 (and above) on both Android and iPhone.
In Layar API v8.3 we introduced the following features:
Reference image linking
You can use this feature for two purposes:
- Make it easier for the app to track your reference images at various zoom ranges. If you have a very big page with a lot of content (e.g. the page of broad spread newspaper with a lot of columns and images), you can upload the entire page but also smaller slices of the page. You anchor your objects on the entire page (i.e. use the entire page as the hotspots.anchor.referenceImage key); but your referenceImages array can now also include the smaller slices, specifying how they relate to the entire page by applying a 'transform.translate' and an appropriate 'transform.scale' vector to let the app know the size of the slice with respect to the original page (note that isn't needed if you've specified the real-world height of the images when uploading them to our publishing environment). Now, when the user points the camera closer to the page, the Layar app will find it easier to track the smaller slice and still render the augments correctly.
- Attach augments to a 3D object that consists of multiple planar surfaces, e.g. a box. You upload each side of the box separately and anchor the augments to whichever side is most convenient to you. By specifying how each side relates to the anchor image, the Layar app gets a full 3D view of the reference images and will be able to render the augment regardless of which side of the box is facing the camera.
In order to specify additional linked reference images, just add a referenceImages array at the top level of the getPOI response, next to the hotspots array. Detailed description of the referenceImages array can be found here
Material Overrides
Until introducing the v8.3 API the look and feel of 3D models is completely embedded in the 3D file format. This included material colors and texture images. Using material overrides is now possible to customise the look and feel of a model, e.g. the color of a car, without the need to make different copies of the model. This is makes the whole experience more efficient as the client would not have to download all the different versions.
Also note that now we support two new content types for texture which is video/mp4 and image/gif
A Json response example can be seen bellow. For more details information not eh API changes check out the updated object parameter.
"object": { "url": "http://yourlink.com/object.l3d", "override": { "materials": [ { "opacity": 1.0, "ambientColor": "#000000", "diffuseColor": "#660000", "shininess": 50, "materialId": "paint", "specularColor": "#7f7f7f" } ] }, "contentType": "model/vnd.layar.l3d", "size": 0.62765415012836456 }
POI Anchors
This feature allows you to attache one POI to another. This can be particularly handy in case of 3D models. If for example you would like to have a door open on a 3D car, you can break your 3D mode in two and use POI anchors to place them in your scene.
Example
"anchor": { "poi": car },
User location Anchor
The geo POI anchor element has been extended in order to support POIs tied to the users location. This feature is useful in case of experience domes.
Example
{ "geolocation": "user" }
Non-uniform scale
We now allow a nonuniform scale in the transform specification. This is represented as a dictionary with the scales factors for the "x", "y" and "z" axis.
Example
"scale":{ "x": 2.0, "y": 1.0, "z": 3.0 }