A simple box scene
Let's rock this riddim! Make a scene with just a cube and, of course, a camera (which has been set up automatically by RenderBox
). Set up the MainActivity
class using the IRenderBox
interface's setup
callback.
In setup
of MainActivity
, we create a Transform
for the cube and position it so that it's set back and slightly offset in space:
Transform cube; @Override public void setup() { cube = new Transform(); cube.addComponent(new Cube()); cube.setLocalPosition(2.0f, -2.f, -5.0f); }
In Android Studio, click on Run. The program should compile, build, and install onto your connected Android phone. If you receive any compile errors, fix them now! As mentioned earlier, with the Matrix
class, make sure that you are importing the right ...
Get Cardboard VR Projects for Android now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.