Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


X File Texture Mapping

This topic is 6652 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 having trouble reading texture information from x files when loading models. I''m using retained mode objects to do the loading, as is done in the SDK IM example. So far, the geometry itself loads fine. All vertices, indices, normals and texture coords are present and accounted for. What isn''t working is the part of the loading code that determines if there is a texture map applied to a given mesh group inside the x file. The SDK example uses the Direct3DRMMesh object''s GetGroupTexture method to retrieve the texture info for a given group inside a mesh. Problem is, the function indicates there''s no texture even though there''s supposed to be textures on these groups. I took a look at the x file in notepad, and the texture filenames are in there... Is this method flawed or could there be something wrong with my x file? I use EffectWare''s DirectX Object Output 0.5 plugin for Max 3. Even the SDK xfile loader crashes and burns on models exported this way. Anyone have experience with this plugin? Anyone know a better one out there? For those of you whose engines support loading textured xfiles - how did you do it? Did any of you use retained mode like the SDK does? p.s. - as a side note, I heard something about MS putting in enhanced support for x file loading in Direct3D 8 (right in Immediate Mode this time). Anyone know what form this will take?

Share this post

Link to post
Share on other sites
Ok... That''s good, cuz I like the plugin!

So did you use retained mode to do it? I know you''re familiar with VB so I''ll post you some code.

The SDK example uses this to determine if a texture map is present:

If Not MeshObject.GetGroupTexture(ObjectIndex) Is Nothing Then

Do your texture loading stuff here...

End If

where MeshObject is a Direct3DRMMesh containing the X file you just loaded, and ObjectIndex is the index number of the specific geometry "chunk" within the mesh. The GetGroupTexture function always evaluates to Nothing, and the texture code never runs. What else could be going wrong?

Share this post

Link to post
Share on other sites

  • 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!