Using the scenegraph to overlay a 3D model onto the camera view

In the previous chapter you learned how to set up a single viewport and camera to render the video background. While the virtual camera determines how your 3D graphics are projected on a 2D image plane, the viewport defines the mapping of this image plane to a part of the actual window in which your application runs (or the whole screen of the smartphone if the app runs in fullscreen mode). It determines the portion of the application window in which graphics are rendered. Multiple viewports can be stacked and can cover the same or different screen areas as shown in the following figure. For a basic AR application, you typically have two viewports. One is associated with the camera ...

Get Augmented Reality for Android Application Development now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.