Archived

This topic is now archived and is closed to further replies.

Jerry Velders

D3D9 Assigning texture coordinates to a mesh

Recommended Posts

I''ve been trying for a couple of days to get textures to work. Finally reverted to a simple program in which I build a cube by creating the vertex buffer manually and assigning texture coordinates. Finally the textures began to work. My problem is with applying textures to a mesh, particularly those created with D3DXCreateBox and D3DXCreateCylinder. I''ve found that the vertex buffers associated with these meshes don''t include texture coords. I know out how to clone the mesh and add the tex coords ... but how in the world do you determine appropriate texture uv values for an object like a cylinder, which could have a few hundred faces? Any ideas?

Share this post


Link to post
Share on other sites
Generally, you want your geometry to be exported with texture coordinates built in, but in some cases you can use several methods, such as:

Spherical Texture Mapping

Also look for "planar texture mapping", "cube texture mapping" and "cylindrical texture mapping"... the algorithms aren''t that complex and usually provide good results, as long as the geometry you''re mapping is more or less the same shape as the method you''re using.

Visual

Share this post


Link to post
Share on other sites