Wrapping a texture round the edge of a cylinder
Hi all,
I wish to wrap a texture around the edge of a cylinder. Here are some pictures to help me explain what im trying to do.
http://www.securemilk.com/model.jpg
http://www.securemilk.com/texture.jpg
http://www.securemilk.com/modelandtext.jpg
Please excuse the tackyness of the last pic, it was a quick photoshop job :P
I created the cylinder using D3DXCreateCylinder and have found that it is next to impossible to add a texture to it as it doesnt have texture normals (or something like that).
So i will need to recreate the cylinder mesh to add the texture to it. But I really have no idea how to go about doing this. So id really appreciate being helped out with this.
Thanks
any ideas anybody? I know you may not know exactly how to do it but even if you know the theory that would be appreciated :-)
Use D3DXCreateCylinder(), then use ID3DXMesh::CloneMesh() to add texture coordinates. These will be filled with junk, so you'll have to lock the vertex buffer (ID3DXMesh::LockVertexBuffer()) and manually compute the texture coordinates yourself.
From your images it looks like you'll want to look into "Cylindrical Texture Mapping" (googled) to generate the coordinates.
If you want a generalised form of UV mapping, you might want to look into the "UV Atlas" tools in the D3DX library (they're quite well documented as well).
hth
Jack
From your images it looks like you'll want to look into "Cylindrical Texture Mapping" (googled) to generate the coordinates.
If you want a generalised form of UV mapping, you might want to look into the "UV Atlas" tools in the D3DX library (they're quite well documented as well).
hth
Jack
Excellent, thankyou very much. As im quite new to directx this may take me some time to do correctly but i'll read as much as i can on the info you provided and hopefully i'll get it done.
Another thing. Is is possible for say a designer to create what im after using a mesh creation program (with the texture already on) to develop a .x file and then i just import it?
If this is possible then once I import the file will I be able to manipulate the modellike scale it?
Thanks for your help mate
Another thing. Is is possible for say a designer to create what im after using a mesh creation program (with the texture already on) to develop a .x file and then i just import it?
If this is possible then once I import the file will I be able to manipulate the modellike scale it?
Thanks for your help mate
Quote:Original post by MilkiesYes, perfectly possible - and probably quite easy as well [smile]
Is is possible for say a designer to create what im after using a mesh creation program (with the texture already on) to develop a .x file and then i just import it?
If this is possible then once I import the file will I be able to manipulate the modellike scale it?
Every 3D modelling package I've used over the years has had cylindrical texture mapping features. More often that not they have much more complex mapping features - you may well find something better!
hth
Jack
Excellent thankyou very much :-)
I dont suppose you can recommend a 3d modelling package for me to test please? Hopepfully it is quite easy and if not then i have professional modeler I can ask for help.
Thanks again mate :-)
I dont suppose you can recommend a 3d modelling package for me to test please? Hopepfully it is quite easy and if not then i have professional modeler I can ask for help.
Thanks again mate :-)
Quote:Original post by MilkiesMaya and 3dsmax are the industry standard tools, but you'll need a lot of spare cash burning a hole in your pocket if you want them.
I dont suppose you can recommend a 3d modelling package for me to test please? Hopepfully it is quite easy and if not then i have professional modeler I can ask for help.
On the opposite end of the spectrum you have Blender and Wings3D, both of which are free. I never managed to get my head around Blender's UI - it wound me up something awful. Wings3D was extremely simple and straight forward and great for making simple models...
hth
aAck
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement