Jump to content
  • Advertisement
Sign in to follow this  
MLillowitz

Can somebody here help me with DirectX?

This topic is 2443 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

Hi, thanks for clicking. It would mean a lot to me if somebody could test something for me.

I have a model and I will put an address down to download the file(100% virus-free and scanned, so don't worry). It is a model saved in a .x file extension. If you have DirectX9 or some other third party files, could you do a bare bones test compilation of code with this file in it to see if it loads?

My computer is messed up and won't support DirectX Development libraries, so that's why I am wondering if anyone can show a picture/snapshot of the model and see if it is formatted in the correct texture, geometry data, not corrupt in any other way, etc.

You can use any simple copy/paste sample .x file loading codes, etc. I just really need to see, and would be utterly pleased if anyone here can attempt to load the attached .x file and show a picture if it compiles correctly, etc.

Thank you!

Here is the link to the file: http://www.2shared.c...rhinoqueef.html

EDIT: VERY SORRY for posting twice! It was an accident.

Share this post


Link to post
Share on other sites
Advertisement
Hi,
you didn't upload textures, don't forget that the .x format doesn't include texture data, the images have to be in separate files.

There are few possible errors in the model (no idea whether it is intentional or really an error):
- The box is "missing" one edge - the one above the F letter. There is a hole in the model.
- The cylinder isn't really a cylinder (if it was supposed to be a cylinder). There's only 1/4 of the outer surface and no bottom/top caps.

http://imageshack.us/photo/my-images/339/rhinoqueef.jpg/

Share this post


Link to post
Share on other sites
Hi, Tom. Thanks for being kind enough to compile the code and upload a photo of it within a window.

However, you didn't do it raw I noticed. There appears to be some settings enabled in that window you showed displaying text and buttons on the bottom.

I find that you used some special settings to enable additional displays within the window. I just expected to see the window with the model file loaded inside of it. You must have used some extra code or some third-party controls to load additional displays inside the display.

Are you coding raw through the DX API and the OS bare bones, compiling through a command-line interface program from your OS, or using some other DirectX interface/API programs for programming? I usually code directly with Direct3D and the operating system. However .... still ... yeah.

I am not sure why the box is missing one corner of its face, but all in all thanks.

However, a re-post of the window without additional settings would have been appreciated better(I prefer to know that you directly uploaded the file itself and didn't take this process through additional and unknown procedures to display it through some tweaking or code/interface changes).

Share this post


Link to post
Share on other sites
Tom used DirectX Viewer, which is a tool in the DX SDK. It is included therein for the specific need of verifying model files.

Internally, the tool uses very standard programming practices, and uses the native D3D interfaces for rendering. It also uses the Effect framework (for which the source is available), and if no effect is found to go with the loaded file, it basically sets a sensible default state for the device so that you can see the mesh with lighting and can manipulate its orientation, position and scale with the mouse.

Had he used custom code for this, the results would (statistically speaking) vary even more from the "reference" state. In addition, since the model does not define camera position nor lighting, at least some extra code is needed in addition to the .x loader.

Share this post


Link to post
Share on other sites
Hi again, Tom and Nik02.

I should have made this clear earlier. I expected my code to be compiled and run through a basic DX window.

Share this post


Link to post
Share on other sites
I still don't understand what do you want.
Do you want to see a code to load and display an x model?
Or do you want to see how the particular x model looks and whether it is fine, with no errors?

If the later, then I already provided a picture. That's how the model looks, writing the code myself would make no difference. The model file includes definition of vertices (position, color, normal, texture coordinates etc.), indices and "subsets". There really aren't multiple different ways how to interpret and display the data. What may differ is lighting, because the model doesn't define lights or shaders (effects). But what exactly do you mean by "raw"? There is no "standard" way how to light a model. And I can say that the way DirectX Viewer rendered it is kinda very "basic".

Share this post


Link to post
Share on other sites
The SDK tutorial 6 (D3D9) shows how to load an .x file in general. The DX Viewer uses almost the exact same approach to loading the file.

The D3DX Mesh is little more than a container class for a vertex buffer, an index buffer and a few other utility data structures. It does contain convenient methods for rendering and optimization as well.

Note that the .x format is relatively complex to parse manually without using the D3DX mesh functionality. There are more "raw" interfaces available in d3dx9xof.h or dxfile.h headers (which still require d3dx9.lib for implementation) - using those, you can manually enumerate through the file sections and load just what you need. I believe none of the samples nowadays use the loader cores directly, though.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!