Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
layarmmo-poi [2012/08/29 12:03]
matthewleach Added description text.
layarmmo-poi [2012/11/07 17:00] (current)
matthewleach Tidying the section on rotating an image.
Line 103: Line 103:
 ===Transformations=== ===Transformations===
  
-Another very useful set of parameters are for transformations. ​ These allow you to reposition and rotate the object (you can just set the scale using the size parameter of the object). ​ Shown below is some code that you can add underneath the object definition in order to rate the image so that it is always facing the viewer. ​ Otherwise you might sometimes be side-on to the image and not be able to see it.+Another very useful set of parameters are for transformations. ​ These allow you to reposition and rotate the object (you can just set the scale using the size parameter of the object). ​ Shown below is some code that you can add underneath the object definition in order to rotate ​the image so that it is always facing the viewer. ​ Otherwise you might sometimes be side-on to the image and not be able to see it.   
 + 
 +We are defining an axis of rotation that is pointing straight up (z axis), setting the rotation to zero, and setting it to be relative to the viewer (always zero rotation from where you are looking).
  
 <​code>​ <​code>​
 "​object":​{ "​object":​{
     "​contentType":​ "​image/​png",​     "​contentType":​ "​image/​png",​
-    "​url":​ "​http://​www.thoughtfulmonkey.com/layar/​gilt/​Banker.png",+    "​url":​ "​http://​www.wheretheimageis/imagename.png",
     "​size":​ 1.8     "​size":​ 1.8
 }, },
 "​transform":​{ "​transform":​{
     "​rotate":​ {      "​rotate":​ { 
-    ​"​axis":​ {  +        ​"​axis":​ {  
- "​x":​ 0,  +     ​"​x":​ 0,  
- "​y":​ 0,  +     ​"​y":​ 0,  
- "​z":​ 1 +     ​"​z":​ 1 
-    }, +        }, 
     "​angle":​ 0,      "​angle":​ 0, 
     "​rel":​ true      "​rel":​ true