Hello! This isn't really what you asked for, but you may be interested in this FlashPascal demo:

http://flashpascal.execute.re/CubeMan3D.php

The source code is included in the examples shipped with the compiler.