Skip to main content
gamedev.net
🔒 Locked

loading meshes

Started by dbunder May 13, 2004 at 1:50 AM 7 replies 1.2k views
Original Post
dbunder
dbunder
Using directx 9.0b in debug mode, visual studio .net 2003 pro, max 6, and panda directx exporter v4.6.0.53. When I export my mesh with the exporter, I set all the options I want then export it to an .x file. In the DirectX meshview it loads and applies the texture perfectly. Using the Direct3D tutorial #6 that came with the DirectX SDK, it won''t work. I get no errors when loading it, and I do exhaustive error checking. The default tiger.x file and related texture loads using the tutorial program. My guess is that the panda exporter doesn''t export correctly for 9.0b, am I right? If so, what would be a good program/plugin to export my .max files to valid .x files? If you need any other information just let me know... thanks!
Mezz
Mezz
Hmm, I never had any trouble with the panda exporter...

Anyway - what exactly "won''t work" when it''s loaded with the tutorial program - texture screwed up? normals wrong? nothing to display? what''s the details?

If meshview loads and displays it all correctly, I''d say it''s *not* a problem with the X file itself.

-Mezz
dbunder
dbunder
it just doesn''t display anything in the window at all. the only thing i could see that could be going wrong is the mesh has 6 textures associated with it, but i''m only loading 1 of them since it''s the only one i was given by the artist. but it does display in meshview.exe even without all the textures, so i''m stumped.
neneboricua19
neneboricua19
It might be because the tutorial sample assumes the camera is at a fixed position in space. If the model you''re trying to load is really big, then your camera could be located inside the actual model. This would make is seem like nothing is rendered.

You can use MeshView to see the extents of the model along all three axis. Place your camera somewhere outside these extents and check if you can see the model.

neneboricua
dbunder
dbunder
quote:
Original post by neneboricua19
It might be because the tutorial sample assumes the camera is at a fixed position in space. If the model you''re trying to load is really big, then your camera could be located inside the actual model. This would make is seem like nothing is rendered.

You can use MeshView to see the extents of the model along all three axis. Place your camera somewhere outside these extents and check if you can see the model.

neneboricua


excuse my newbness, but how do i figure out what the extents are on the model in meshview? i never thought that it could be a camera problem, but that seems completely logical.

neneboricua19
neneboricua19
quote:
Original post by dbunder
excuse my newbness, but how do i figure out what the extents are on the model in meshview? i never thought that it could be a camera problem, but that seems completely logical.


Sorry but I may have been thinking of another modeling program. I just loaded up MeshView and couldn''t find the button that tells you how big the whole mesh is.

In any case, you can move your camera back a ways and see if your model shows up. Move it back like 10 or 20 or 30 units and you should see the model.

neneboricua
dbunder
dbunder
i moved it around today, forward and back, 10 units, 20, etc. still can''t see the thing. still totally stumped. any other suggestions? i''m gonna look at the code for meshview tomorrow to see how it goes about displaying it correctly.
neneboricua19
neneboricua19
The code in that tutorial is fundamentally sound. It should be able to display pretty much any model correctly. If you actually created the model you''re trying to load, then you probably know how big you made it. If not, load it up in Max again and check the model''s bounding box.

If the model is pretty big, make sure you move your camera back enough so that you can see it. For example, if you use Tutorial6 to to load the Tiny.x model that comes in the DX SDK, you need to move your camera back to around -500 on the z because the model is very large. You also need to extend your far clipping plane. The default is set at 100 but since the model is so big, put it at 1000 so that you can see it.

Also, when you load the model you created, turn off all culling. In case you didn''t know, culling is the idea of not rendering triangles that are facing away from the viewer. But since we''re just testing here, go ahead and turn it off and see if your model shows up. To turn off culling, do the following in your init function some time after you''ve created the D3D device:

g_pD3DDevice->SetRenderState(D3DRS_CULLMODE, D3DCULL_NONE);

See if that works for you.

neneboricua

dbunder
dbunder
before i got this reply i gave that a try, as it was the only thing i hadn''t tried yet. it didn''t work for the model i was trying to load yesterday, but it worked on a simple sphere with a texture on it. i''m guessing the other export was just a bad export. trying another export in a bit.

thanks for all your help guys!

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.