DirectX problem loading textures from x files

Started by
1 comment, last by Luciyan 15 years, 10 months ago
Hello everyone, At the moment, I am working in Visual Basic 6.0 with DirectX 7.0 and trying some new things out and I bumped into this little one... I downloaded a project related to car racing. It has a few meshes (.x) loaded and all of them textured(automatically from the file; not using visual basic to implement textures). BUT, the car(.x) I use to move around in the project, doesn't have any textures implemented in .x file nor in Visual Basic, but depending on its position in the scene, it gets different textures applied (for example, the texture from the street, the mountain, etc).In other words, Visual Basic doesn't load it properly. Let me paste some of the code here: Set CarFrame = D3DRM.CreateFrame(SceneFrame) Set CarMesh = D3DRM.CreateMeshBuilder CarMesh.LoadFromFile "car.x", 0, D3DRMLOAD_FROMFILE, Nothing, Nothing CarFrame.AddVisual CarMesh CarFrame.SetPosition Nothing, 222, 0, 309 CarFrame.AddRotation D3DRMCOMBINE_BEFORE, 0, 1, 0, 9.42 CarMesh.ScaleMesh 0.2, 0.2, 0.2 SceneFrame - The main frame CarFrame - Direct3DRMFrame3 CarMesh - Direct3DRMMeshBuilder3 My questions are: Is this problem be connected with exporting the .x file correctly ? How can I export an .x file so that Visual Basic will load the textures automatically from the file? Thanks in advance, Luci P.S. I managed to add some photos to show it better: http://img229.imageshack.us/my.php?image=bug1ts4.jpg
Advertisement
Quote:Original post by Luciyan
At the moment, I am working in Visual Basic 6.0 with DirectX 7.0
Umm... why? I thought that DX9 worked with VB6? I'd very strongly recommend against using DX7, since DX8 or DX9 is substantially easier to work with and possibly more performant. And DX9 is more or less fixed forever on XP and below (D3D10 is Vista only).

I really hope that D3DRM doesn't stand for D3D Retained Mode, because if it does I'd get as far away from it as possible, as quickly as possible - there's a reason it disappeared around DX5 or DX6; it abstracts too much stuff away and makes a lot of stuff very slow.

You can load .x files in the X File Viewer that comes with the SDK to check if there's a problem with your export or if there's a problem with the rendering.

If the textures seem to "flow" over the car, then it sounds like you have a texture matrix set to the same as your car's world matrix or something similar.
Ok, I think I got it now, thanks a lot :)

This topic is closed to new replies.

Advertisement