texturing unmodeled meshes
Blitz3D Forums/Blitz3D Programming/texturing unmodeled meshes
| ||
I was working on a new project where I entered a few numbers and my program created a mesh for me based on what I entered(using createsurface, addvertex, addtriangle, and that kind of stuff). This is the first time that I've tried creating meshes without using a mesh file(.x or other). I tried to apply a texture the same way as I've always done on my other meshes: tex = LoadTexture("ground.bmp") EntityTexture ground, tex but it didn't work. could it have to do with the way I created the mesh? please help... |
| ||
You will need to set the UV coords for the Vertices as for there proboly all set to 0. |
| ||
Interesting problem. That is the same thing I missed with Wings. I created a mesh and didn't set the UV up. But I created meshes on the fly in blitz and the texturing worked fine because I setup the UV. Without UV set you are only using the first pixel of your texture on your mesh. AddVertex ( surface,x#,y#,z#[,u#][,v#][,w#] ) U and V must be a number between 0 and 1. Just divide 1 by the number of verts across you are using. And then increase U and V by that number for each vert. eg: For nx=0 To 26 For nz=0 To 26 V(nx,nz)=AddVertex(ss,nx,0,nz,(nx*0.037),(nz*0.037),0 );create all vertices Next Next 1/27=0.037 that is were I get the 0.037. This gives each vert. 1/27th of the texture across and down. Hope this helps you somewhat. |