Home Forums Software Development Unity3d 4.6 Cannot find Camera object Reply To: Unity3d 4.6 Cannot find Camera object

#3853
Jenny [Tobii]
Participant

Hi Richard,

Hm, yes I think this must have to do with how the EyeX Framework code tries to project the bounding box of the game object from World space to Screen.

If you want to take a look, and hack away to try and make it work for you, the projection calculation code is implemented as static methods on UnityProject\Assets\Standard Assets\EyeXFramework\ProjectedRect.cs.

It basically works like this:
0. Given either a Bounds object or a BoxCollider object corresponding to a bounding box containing the game object
1. Find the 8 corner points of the axis-aligned box
2. Project the corner points from World to Screen
3. Calculate the smallest axis-aligned rectangle on Screen that contains all of the corner points.

It is also possible to override the GetProjectedRect() method by creating your own custom component class that derives from GazeAwareComponent, and calculate and return your own ProjectedRect struct specifying an axis-aligned rectangle on Screen that covers the area of the screen where your game object is displayed.