Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Beginner demos of meshes, 3D objects and shaders

IgnatzIgnatz Mod
edited March 2013 in Code Sharing Posts: 5,396

EDITED: This is where I've got to, now.

Starting with a single triangle, I've worked up to 3D blocks, clothed in texture or color, and then built a dice to show off several techniques, including using different parts of one image to clothe an object.

This is the final result

Code here: http://pastebin.com/tcEdk8W5

If you paste it into Codea, do it by holding down the new project button and selecting the paste into project option when it comes up. This ensures the code will split itself correctly into tabs.

The important thing is not how impressive each animation is, but how useful and clear the code is, and I've included a lot of explanation in there to help people understand what can be difficult concepts. My own understanding is not far ahead of where I've got to, so I'm learning as I go (and kind of explaining to myself).

Tagged:

Comments

  • Jmv38Jmv38 Mod
    Posts: 3,295

    Nice @ignatz. Ps: you forgot to comment the backup again! You could write this instead:

        if  Backup  then b=Backup("Mesh demo 1.2") end
    

    then no error, and it wotks for you.

  • IgnatzIgnatz Mod
    Posts: 5,396

    See update to initial post above

  • Posts: 502

    That was a long demo :). Might want to add that the starry night only works for textures of a base 2 size, otherwise the other code in the thread about it is needed.

  • Posts: 557

    I get a whoop bunch of errors about attempts to index various global variables.

  • IgnatzIgnatz Mod
    Posts: 5,396

    That's funny, it works for me when I paste it. Are you sure you got all the code?

  • Posts: 557

    Must not have. Tried again, working now. It's cool!

  • Posts: 17

    I like the demo, it will take some time to work through the code. One more project ;)

Sign In or Register to comment.