- Home /
Question by
Andrew-Garrison · Jul 17, 2014 at 12:23 AM ·
cameraprojection
Position camera so that 3d game object fills up 100px by 100px of screen space.
I'm implementing a feature where the user can select a game object and the camera positions itself so that the game object fills a 100px by 100px section of screen space. The camera can be at any angle to the object, but the object will always be at the center of the camera's view.
In other words, how far away from the game object do I need to move the camera so that the game object is 100px by 100px when rendered on the screen.
It would be acceptable to use the MeshRenderer.Bounds for the game object to determine its size.
I'm really struggling with this problem, does anyone have any ideas? Thanks!
Comment