Thursday, March 20, 2008

NeHe Lesson 25: Morphing & Loading Objects From A File

Somehow I found time to do the next one too. This was pretty fun one as well. I love the morphing effect. And I like the simpleness of the code compared to the c/c++ version. :)

I left out the Object struct as the D version didn't need the field for the number of vertices, and then there wasn't anything else left than the array itself. So now there are just arrays of Vertices.
I also put a static opCall in the Vertex struct, although it isn't strictly necessary.

And as with the lesson 10, the datais imported into the binary at compile time, so no file i/o is needed.

You can check it out here.

NeHe Lesson 24: Tokens, Extensions, Scissor Testing And TGA Loading

A new lesson done. Yay! I should have called this one the Extensions and Scissor Testing lesson, because I left the TGA stuff out and the token thingy was replaced with a call to split. But I wanted to keep to the pattern with the lesson titles.

I changed the code to initialize the texts only once and not every draw-call. Better that way. Otherwise there isn't that much new stuff. Then glScissor call is pretty simple.

See the code here.