I am trying to apply a texture to a mesh that has no texture. All that's happening is that only a single color from the texture file is being applied to the mesh, but the entire texture is not displaying. Here's the rendering code:
Dim
mat As Material = New Materialmat.Ambient = Color.White
mat.Diffuse = Color.White
device.SetTexture(0,
Nothing)device.SetTexture(0, texture)
device.Material = mat
Dim
matFirst As Matrix = Matrix.Multiply(Matrix.RotationYawPitchRoll(25, 20, 0), Matrix.Scaling(New Vector3(0.6F, 1.0F, 1.0F)))device.Transform.World = Matrix.Multiply(matFirst, Matrix.Translation(Vec3(iii)))
Me
.meshes(iii).DrawSubset(0)
Here's the code I use to load the mesh and texture.
texture = TextureLoader.FromFile(device, "texture.bmp")
For
iii = 0 To indexMe.meshes(iii) = mesh.FromFile("mesh.x", MeshFlags.SystemMemory, device, mats) Me.meshes(iii).ComputeNormals()
Next
iiiI would like to get it to apply the entire texture, not just a single color. What am I doing wrong I am using the October 2006 version of DirectX, and Visual Basic .NET 2003 Standard.