Adding light sources to a 3D scene

.@spacemonkey could you make a version without the camera? I’d love to test your code on my ipad1

Gist updated for litCube as I had left a bug in it.

Also https://gist.github.com/sp4cemonkey/5046513 is the 3d tile based demo of .@Xavier’s with lighting added. It runs painfully slow (ipad2) and needs light attenuation or some other features to make it look nicer.

.@Jmv38 here is a version without camera, it only needed minor changes to Main.
https://gist.github.com/sp4cemonkey/5046580

I’ll check it out as I have a 3 Gen ipad

Thank you @spacemonkey. I still have to tweek a few things linked to the ipad1 resolution is half yours. The cube appears in top right corner, not in the center. I just cant find where in the code it says to center it so far. And in a previous version the center was ok. This is weird…

@Jmv38 that’s very odd. iPad 1 resolution is the same as my iPad 2 (1024x768).

Additionally this stuff should be resolution independent as it’s drawn by 3d, so it’s the camera call that should cause it to be centered. So something else must be going awry…

Updated @Xavier’s 3d tile based version and now getting good (30-40fps) performance on my iPad2.

https://gist.github.com/sp4cemonkey/5046513

Don’t try and use the litMesh class from this one at the moment unless you are bumpmapping and texturing as it won’t work. The general purpose all encompasing shader was a bad idea (as the books say) for performance. I’m going to modify the LitMesh class and have a set of shaders for different settings, and move the general purpose up to the init level in lua.

Nice work keep it up :3