Corona Doing a 3D Tunnel - With Source Code

Here is the 3D tunnel with texture mapping code.

Original Texture

Download source

http://www.alienhorde.com/files/tunnel.zip

Its running at a very low resolution and scaled to fit the screen, even then on an iPhone 4 it gets about 4fps. The textures are processed with php to get the colour values which are then saved into a lua table which rebuilds the image in the fake screen buffer im using.

Its slow but it works and shows how easy it is to do something very complicated in Corona / Lua.

If these calculations were pushed into a C script, Corona could do this at full speed. [import]uid: 5354 topic_id: 9766 reply_id: 309766[/import]

That looks cool! On a 3GS, runs at 2-3 fps… [import]uid: 29384 topic_id: 9766 reply_id: 35612[/import]

In screenBuffer.lua change line 60 to

-- Load Texture From File  
texture = textureLoader.buildTextureFromFile( "texture\_02" , texWidth , texHeight )  

ive changed “texture_01” to “texture_02”, it will load a different texture I processed.

You can also uncomment this to get a different texture style

-- Load XOR Texture -- texture = textureLoader.buildXORTexture( texWidth , texHeight ) [import]uid: 5354 topic_id: 9766 reply_id: 35615[/import]