Sign in to follow this  
mvtapia

x file Texture

Recommended Posts

I'm using vb.net and I can't seem to get the right code for new texture and new material, here it goes, if someone could understand. XMesh = Mesh.FromFile(Application.StartupPath & "\tiger.x", MeshFlags.SystemMemory, _ DxDevice, Materials) MeshTextures = New Texture(Materials.Length) MeshMaterials(i) = New Material(Materials.Length) For i = 0 To Materials.Length - 1 MeshMaterials(i) = Materials(i).Material3D '// Set the ambient color for the material. Direct3D '// does not do this by default. MeshMaterials(i).Ambient = MeshMaterials(i).Diffuse '// Create the texture. MeshTextures(i) = TextureLoader.FromFile(DxDevice, _ Materials(i).TextureFilename) i = i + 1 Next the problem is on the MeshTextures = New Texture(Materials.Length) MeshMaterials(i) = New Material(Materials.Length) part of the code, I don't know if this is right because I'm trying to convert the code from c++ to visual basic, Thanks

Share this post


Link to post
Share on other sites
Sorry on the

MeshMaterials(i) = New Material(Materials.Length)

i changed it to,

MeshMaterials = New Material(Materials.Length)

that was something I tryed in an act of desperation.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this