Original Post
I'm trying to come up with a rapid prototyping language that is easy for the Blitz crowd to understand. The code below shows a rather simple example. It renders a 10x10 matrix of cubes in OpenGL, assigns each cube a random color and then rotates each cube around the x, y, and z axis's by ~1 degree a second. In addition the viewer is able to pan, zoom and rotate the camera around these cubes. My question is, does your head explode when reading this code or can you get the basic flow and intent just by reading it, without any comments or documentation?
(defun rm-rotating-cubes ()
(let ((width 320) (height 200)
(button-state nil))
(init-objects)
(sdl::with-init ()
(sdl::window width height :flags (list sdl::sdl-opengl))
(rm::with-engine ((rm::get-hwnd) width height) root-node
(let ((cubes nil))
(setf cubes (loop for i from 0 to 10
append (loop for j from 0 to 10
collect (new-mob :script (defscript ()
(rotate-mob actor 1.0 1.0 1.0))
:primitives (rm::new-box -1.0 -1.0 -1.0
1.0 1.0 1.0
(random 1.0) (random 1.0) (random 1.0)
:cx (* i 3.5) :cy (* j 3.5) :cz 0)))))
(add-actor root-node cubes :union t :compute-center t))
(rm::set-default-scene root-node width height)
(sdl:with-events
(:quit t)
(:keydown (state scancode key mod unicode)
(when (equal key 'sdl::SDLK-ESCAPE)
(sdl::quitevent)))
(:mousemotion (state x y xrel yrel)
(rm::aux-handle-motion root-node button-state x y width height))
(:mousebuttondown (button state x y)
(setf button-state (rm::aux-handle-buttons root-node button x y width height)))
(:mousebuttonup (button state x y)
(setf button-state nil))
(:idle
(update-all)))))))