this post is to showcase a new viewpoint computation library which we have just open sourced. What can it do?
Basically, it can compute the best viewpoint in a 3D scene that satisfies a set of visual properties, such as size, visibility or angle of selected objects in the scene. For example, say you have a scene like the following one:
and you would like a viewpoint that shows one of the computers in the rooms, say the one in the bottom left room. Let's suppose that "monitor", "keyboard", and "mouse" are the scene entities' names of that computer pieces. You then create a set of properties like:
- monitor: should be entirely visible from the viewpoint
monitor: should be not occluded by other objects
monitor: should be rendered at a certain minimum size
The available properties include objects's size, angle, occlusion, and position in the image rendered from the viewpoint (also relative position of two objects, e.g. one at the right of another).
Although the library is not Ogre-specific, it comes with an Ogre interface that reads the Ogre scene graph to know about objects and their position.
The library is available at https://bitbucket.org/rranon/smart-view ... tation-lib and, besides source code, there is a binary demo for Win and Mac.