Wednesday, July 12, 2006

File Textures: UV Texture Coordinate Creation

Tonight I wrote UV Texture Coordinate Creation for Sphere and Box primitives. This is generally straightforward but I ran into a decently complicated issue because not all of my cubes are defined as unit cubes! I have a non-hierarchical box and a hierarchical box, and the one is affected by matrix transformations while the other ones do not require this. That caused a problem as I was trying to compare the intersection points with the min/max points on the edges of the cube, and this was not possible until I translated the cube back to the place where a unit cube is generally defined. Sweet. So that took a while but it's awesome to have nice UV texture across the cube now too.

Note from these images that I haven't implemented Mesh UVs yet, I will not be generating these, instead I will be reading them in from the mesh OBJ file and doing some mad interpolation vibe. Word.

Hehe so anyway here are some images from tonight.


UV Mapping first try at spheres


Box front


Box left side textured correctly


Box left side 2nd image


Box back textured correctly


Box ride side textured correctly


Box straight on


Box top


Box bottom


Boxes in a grid pattern


Spheres in a grid pattern


Non hierarchical image UV mapped


Non hierarchical boxes image UV mapped


A picture of me texture mapped onto the spheres and cubes

No comments:

Post a Comment