Here is part 3 of the 3D Engine - rotating and moving the camera. ******************************************** More steps for the 3D engine in this studio: http://scratch.mit.edu/studios/202972 ******************************************** Use arrow keys and WASD to move through the starfield. You can change the number of stars (in hundreds) using the slider. FPS (frames per second) is shown at the bottom left. The stars are randomly placed in a cube about your starting point, and they don't regenerate if you move out of that cube - so you can end up with blackness if you travel too far! Press space to reset the camera to its original position. There's no distance ordering, so background stars can be rendered on top of foreground stars. I've gone for greater efficiency in the way this works, and it has paid off - it's considerably better than the way InterXeptor 3D does it, so I'll have to change that at some point... :) I get about 12fps with 1000 stars on our old 32 bit Core Duo Mac Mini using both Safari and Firefox (OSX10.6), and about 3fps with 5000 stars - so I'm expecting many of you out there can do a lot better.
This is almost a copy, but I did the challenge! It runs really well at http://phosphorus.github.io/#46144502