I’ll clean up the code a bit and post it. You are welcome to use any part of it.
I am not doing any culling, although I did expect to have to have to do it. I was going to just draw the room the player is in, plus the neighbouring corridors, which meant having a lookup table of neighbors for every room and corridor, but after finding the whole thing ran so fast, I didn’t need to bother.
I think the speed is largely down to the tiling shader, which dramatically cuts the number of mesh triangles - eg the floor and ceiling, each spanning over 900,000 pixels, each consist of just two triangles! The whole scene is nearly 5 million pixels but only has 1,350 vertices. This matters because speed seems to degrade linearly with the number of triangles. And the tiling shader is just the standard shader with one line changed. IMHO, that is the most powerful line of code I have ever seen in Codea (thank you, spacemonkey!).
If you go to the next step, as I said previously, it involves creating characters. 3D animation is extremely difficult, because it means creating and importing 3D objects which have more than one version of the pieces that animate. I can import .obj files created in Maya or Blender, but I haven’t tried animated models yet.
However, it is maybe possible to cheat and use static 2D “billboards” that turn to always face the player - like the statues in my video - and for example, ghosts can be made to float so they don’t need any walking animation. I already tried this here.
If you are going to shoot, you also face the difficulty of pointing, because once OpenGL has drawn the screen, it is just a mess of pixels, and, unlike any other language, I know, Codea has no way of telling you what object you just touched, or pointed at. There are at least two solutions to this, LoopSpace has elegant mathematics that work for regularly shaped objects, and I have a much less elegant hack that works for any object at all, by stealing one frame and drawing a coded version of the scene on it.
Sorry to ramble on, but 3D is both endlessly fascinating and (for me at least) hugely difficult and challenging.