VBGamer |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
X File Texture Mapping PyroBoy (7 replies, 0 views) (2000-Aug-28) Yup, another x file question...
I'm trying to load an x-file into my engine, and this time I have all the geometry loading up decently well. The texture coordinates are also loading up fine.
What isn't working is the part of the loading code that determines if there is a texture map applied to a given group inside the x file. I'm using the SDK xfile loader as an example, but even it crashes... Their code uses this to determine if a geometry group has a texture:
If Not Mesh.GetGroupTexture(GIndex) Is Nothing Then
where Mesh is the mesh object holding the loaded x file and GIndex is the internal index of the geometry group we're examining... I know the x file I'm loading has texture filenames in it, cuz I opened it in notepad and checked. I use:
Set TextureMap = MeshObject.GetGroupTexture(ObjectIndex)
If Not TextureMap Is Nothing Then
where TextureMap is a Direct3DRMTexture object, MeshObject is the loaded mesh and ObjectIndex is the index of the group. The SDK example just plain page faults when trying to load the xfile, and mine loads the geometry and skips the texture loading code because the above expression always ends up being false.
For those of you whose engines can load textured Xfiles - How'd you do it, and why isn't the above expression finding that the objects have a texture?
|