2D Mesh questions

Hi all,

I’m looking at the Roller Coaster example and it leaves me with a few questions.

It looks like the example uses a 2D mesh to create the stars and the track and then the camera advanced styling to look at the mesh in 3D space. It’s kinda crazy how that works and really confusing. Is there deeper documentation on 2D mesh and camera usage? I’d love to figure this out so I can move my meshes behind or infront of each other without using zLevel, or should I just use zLevel?

Additionally, is Codea capable of 2D lighting? It seems like it should be, just using normal maps and the mesh shader? Are there any examples?

So I was able to get perspective() and camera() to work in my demo project.

It actually does move and manipulate whatever you draw into a 3D view. Crazy. But it doesn’t really automatically give your 2D scene 3D depth (based on the other thread about zLevel, I will solve this by manipulating draw order), that is somehow achieved by cleverly placing the track planks and stars into the mesh. It’s also really confusing how the values of camera() work. I would love a demo that really explains and shows how to use it properly. Roller Coster is doing some complex math with azimuth and things i don’t understand lol

No, progress yet on 2D light, I’ll try to figure it out soon-ish…

@skar - @RonJeffries posted a 3d demo in Craft as he learnt about Craft. It involved several objects and cycling around. I’ll post a link when I find it. It may answer you questions.

@Bri_G no I’m afraid that won’t apply here as this is specifically for non-craft 2D part of Codea