We are trying to create a simple programming environment that lets people generate 3D forms (it's inspired by the [Scratch project](http://scratch.mit.edu)). We'd like it to work in a "turtle geometry" fashion, where a creature (we call it the beetle, by analogy to the logo turtle) moves around the 3D space, and can leave objects along the way that take on its position and orientation.

We are currently using Three.js. While you can move and rotate objects, it's not clear how to create the effect we want, where translations and rotations "accumulate" and can be applied to new objects. We'd also like to store a stack of these matrices to push and pop.

Here's a specific example. The user of our system would create a program like this (this is pseudocode):

```
repeat 36 [
  move 10
  rotate 10
  draw cube
]

```

The idea is that the beetle would move around a circle as it executes this program, leaving a cube at each position.

Is this possible using Three.js? Do we need to switch to pure WebGL?