Advertisement

x file loading

Started by June 22, 2003 01:34 AM
2 comments, last by Sabonis 21 years, 7 months ago
im using direct 3d, and i have made an engine that supports .x files. I created a few models in max 5 and exported them in .3ds format. I then used the conv3ds tool to make it into an x file. When i imported one of the models into my engine, (more specifically and a-10 aircraft), it was upside down and it seems like its normals were backwards or something because you could see through the model and you would see the inside. I tried using g_pDevice->SetRenderState(D3DRS_CULLMODE, CULL_NONE); and it seemed to have fixed the problem, but the frame rate takes a severe hit. Im wondering if there is some way to solve this problem other than turning the back face culling off. Is there anything that would cause the plane to appear upside down and have its normals inverted like that? any help would be appreciated thanks
"Only two things are infinite, the universe and human stupidity, and I'm not sure about the former." - Albert Einstein (1879-1955) That is so very true...
Sabonis - you need to be able to distinguish between errors in the exported mesh and errors in your app code (esp. to decide which forum to post to). I'll recommend the following diagnostic steps to isolate the problem:

1) Verify the model renders with the same defect using MS X File viewer/sample code or some other 3rd party renderer for X files such as Quick3D (shareware). This will ensure you have a visual arts problem.

2) Verify conv3ds was given the proper parameters (there is an option to flip normals but it's probably not the right solution for you if your plane renders properly in 3DS Max 5)

3) Verify you have at least some normals on your model (try applying at least one normal modifier - typically people use "Smooth"). Without doing this, most meshes will not get normals in the export data and will render transparent after conv3ds is performed.


[edited by - hundel on June 24, 2003 4:21:53 PM]
Advertisement
There''s a way in MAX to flip the normals on a mesh. Do that before export. You might also try using the X file exporter plugin, rather than the converter. Maybe it''ll handle normals better.

Also, instead of specifying CULL_NONE, try CULL_CW. You don''t want to draw the backfaces regardless. But, in my mind that should be a quick fix til you get your models corrected.

I like pie.
[sub]My spoon is too big.[/sub]
hey guys, i emailed a friend of mine and he gave me the solution to the problem. On any models you have, make sure the scaling on everything is positive. Otherwise, everything will seem "backwards"
"Only two things are infinite, the universe and human stupidity, and I'm not sure about the former." - Albert Einstein (1879-1955) That is so very true...

This topic is closed to new replies.

Advertisement