At the end of the last section I said I wanted to be able to render a single 3D cube. Well that now works. I'll briefly talk through the code in this section. I took most of this from the minimal 3D example in the play-clj repo.
how do I run it?
The project folder contains 3 directories, desktop, iOS and android. Navigate to the desktop directory and you will see a lein project.clj. From this directory start a repl with lein repl and it will sort out your dependencies and do some compilation.
From the desktop_launcher.clj namespace eval the main method
(-main)
This will open a window with a single, green, 3D block displayed.
I've included a line at the bottom of core.clj
That reloads the whole screen and allows you to dynamically make changes to the code and have them reflected instantly in the running window. All you need to do is re-evaluate the namespace. Without that only changes in the :on-render function will be applied.
Looking at the code
So, briefly, what does this code do? The examples don't provide any context so I'll try and document a few things here.
which tag?
Clone the repo and run:
git checkout tags/single-cube
To see the code as it is right now
what's next
Directional lighting to add some spark, movement and rendering some more cubes!