Tuesday, 18 August 2009

Point Sprites and Leafy Trees

I finally managed to get point sprites working to a decent state, thanks to the magic of the Alpha Test, as can be seen in the latest screen shot. Only problem now is that the leaves displayed are all standing on end, rather than in a sensible direction...

One solution is to create a 3D texture with multiple rotations of the sprite, and then specify an r texture coordinate during calls display points. While this would undoubtedly work, a more sensible solution is to use a textured quad instead. Takes a little more programming, but ultimately it's a lot more flexible. And thanks to the geometry of the tree generated by Arbaro being a set of eight vertices making six trianges, I can get the direction the leaf is in, cross it with the camera vector and get the relevant vectors to displaying a textured quad.

I'll post a screen shot when I've done this...

No comments:

Post a Comment