October 2017
Intermediate to advanced
548 pages
13h 23m
English
Now we can scale the picture after each update. We will use a simple hack that ties head movement (gaze direction) to the object scale. Rather than literally casting a ray to determine a size based on gaze hit point, we'll use the head direction angle as a relative scaling factor (much like a pinch gesture is used to scale on a touch screen). By trial and error, we've decided to scale the object by 10% for each degree of head movement.
The object in our Hierarchy that is to be scaled is not the root Picture object itself, but the FramedImage object. The tool needs to know this, and will ask the PictureController for a reference to this object. Modify PictureController as follows:
File: PictureController.cs public Transform ...