Alright! We're getting closer. We're now ready to build a little scene in
RenderBox using the code we created earlier. To start, the scene will simply consist of a colored cube and, of course, a camera.
At the beginning of this project, we created the skeleton
RenderBox class, which implements
To this, we now add a
Camera instance. At the top of the
RenderBox class, declare
mainCamera, which will get initialized in
public static Camera mainCamera;
Note that Android Studio may find other
Camera classes; ensure that it uses the one that we created in this package.
Shortly after your app starts and the
MainActivity class is instantiated, the
onSurfaceCreated callback is called. This is ...