Jump to content
  • Advertisement
Sign in to follow this  
mvtapia

x file textures and materials

This topic is 5047 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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 = 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 = 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, the error that is showing is that "cannot convert to 1 dimensional array" Thanks

Share this post


Link to post
Share on other sites
Advertisement
Quote:
"cannot convert to 1 dimensional array"
Whats the declaration for MeshTextures and MeshMaterials? Been a long time I wrote any VB, but it should be something like:

Dim MeshTextures() as Texture
Dim MeshMaterials() as Material


The error probably refers to the way that you're assigning a 1-dimensional array ("new Textures(...)") to a non-1-dimensional variable.

hth
Jack

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!