Texturing a mesh

Blitz3D Forums/Blitz3D Programming/Texturing a mesh

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

No need to create multiple verts, you share verts across a face normally.

Just consider each face a flat plane, as that's all it is. And each vert has a uv range of 0 to 1. (Think of this as a percentage of the texture's width/height)

e.g, u=0.5,v=0.5 = Centre of texture.

Now for each face, considering it's just a flat plane, just consider it on a whole, rather than a series of polys.

So for the front face. Two triangles.

Top Left corner(On tri 1) would be 0,0. Top Right Corner(Shared between tri 1 and 2) would be 1,0

Bottom left corner(Shared by tri 1 and 2) would be 0,1

And finally bottom right corner(tri 2) would be 1,1

Now just repeat the same uvs for each face, because they're just flat planes and rotation doesn't affect texture mapping. It can warp it in blitz, in some cases if you're not using even surfaces though.

Also if you want to scale a texture down so it appears smaller yet still tiles across the surface, still use the 0,1 range, and use TextureScale with a number within 0 to 1. and it'll tile it across the face.