Sign in to follow this  
MLillowitz

Can somebody here help me with DirectX?

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: [url="http://www.2shared.com/file/uzltd4Qa/rhinoqueef.html"]http://www.2shared.c...rhinoqueef.html[/url]

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

Share this post


Link to post
Share on other sites
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 [i]some [/i]extra code is needed in addition to the .x loader.

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
Hi again, Nik02 and Tom KQT.

By "raw" I am referring to loading the model file without DirectX's mesh system, and through a DirectX interface directly.

I expected to see a snapshot within the window of a basic DX utility window system, not the DX Viewer. Because you are using the DX Viewer, and all through my programming of DX I have never used the "Viewer", I am uncertain if you did or did not render the .x file's geometry or statistics in a separate mesh class or container.

This is what I mean, and I really would recommend leaving it as this. I don't want to get too in to specifics here, but if you are willing, could you show the same model file loaded again, but not in the DX Viewer utility?

Thanks in advance. You certainly don't have to, and your kindness to do it in general was fulfilling enough.

- Mikey

Share this post


Link to post
Share on other sites
Loading a .x file with the d3dxof functions is not trivial. Essentially, the file has several sections that have data structured according to "templates" identified by GUIDs. The loader would enumerate through all sections and parse sections of interest (such as vertex data section) according to the template type.

The default template types are documented in the SDK. The most important ones for this case (loading static geometry) have names starting with Mesh*. The individual templates tend to be simple but can form potentially complex hierarchies. Add to that, .x files can be either binary, text or compressed text. And that for robust file handling, you have to understand custom templates too.

Because of this complexity, most real-world developers either:
1: use D3DX Mesh for prototyping or simple demo/poc or
2: write their own custom (often simpler than .x) mesh format and corresponding container + serializer to gain flexibility and precisely solve their needs or
3: use a simpler public format to begin with, and write a custom loader.

I used to write an (incomplete) "raw" .x loader some ten years ago just for fun, but I believe that it has been eaten by the sands of time (or something). Writing a new one would require considerable amount of effort, and would not be very useful to most people anyway.

Share this post


Link to post
Share on other sites
Also note that while the .x format is relatively difficult to parse due to its generic nature, there is nothing "magical" about it. The data ends up in vertex and index buffers when you load it to the D3D device in any case. The D3D core itself does not care how the data was produced; mesh files have absolutely no significance to the device. The D3DX mesh is a convenient helper over the templated file formats so you don't have to write a loader or a geometry container yourself in case you want to do simple mesh rendering.

Share this post


Link to post
Share on other sites
[quote name='Nik02' timestamp='1333369630' post='4927454']
Also note that while the .x format is relatively difficult to parse due to its generic nature, there is nothing "magical" about it. The data ends up in vertex and index buffers when you load it to the D3D device in any case. The D3D core itself does not care how the data was produced; mesh files have absolutely no significance to the device. The D3DX mesh is a convenient helper over the templated file formats so you don't have to write a loader or a geometry container yourself in case you want to do simple mesh rendering.
[/quote]
Exectly. I really wonder what differences does MLillowitz expect. It's not really about loading the mesh but about rendering it. That's where the results may differ.

And even if I did write my own code to parse the x file and create corresponding vertex and index buffers, with absolutely no use of the mesh interface, how would you know that the result is correct, that the result is better and more "accurate" than what D3DXMesh (and thus DirectX Viewer) gives?

X format is DirectX native format so I suppos the developers of DirectX know best how to load it. I personaly 100 % belive the D3DXMesh interface. So, what you see on my screenshot is how the model is supposed to look like. If my custom x-file loader (if I had one) created something different, I would be quite sure that it's me who made a mistake in the code.
That's my opinion.

Share this post


Link to post
Share on other sites
Hi, Tom KQT.

To put this as blunt as possible, I wanted you to [b][i]NOT [/i][/b]use the DX Viewer utility for obvious reasons I mentioned before.

For more info, please view by blogs if you are confused.

[b]Thank you.[/b]

20+ years of programming experience.

- Mikey

Share this post


Link to post
Share on other sites
[quote name='MLillowitz' timestamp='1333411810' post='4927709']
For more info, please view by blogs if you are confused.
[/quote]
I've seen you refer to your blogs more than once now -- perhaps you should provide a link to them? You haven't yet done so in any of your posts, they aren't listed anywhere I can see in your profile, and searching Google for your username doesn't return anything other than a few topics on GDNet.


[quote name='MLillowitz' timestamp='1333411810' post='4927709']
To put this as blunt as possible, I wanted you to NOT use the DX Viewer utility for obvious reasons I mentioned before.
[/quote]
To put this as blunt as possible, the reasons you mentioned before don't make sense (as already pointed out by other users).
There is no "standard" way of loading and displaying your model, so if someone was to write their own loading code rather than using the DX Viewer (which loads models in as close to a "standard" way as there is) you would have [i]no idea[/i] how things were done or what steps might have been applied, making the whole process rather useless.

If there's some particular way you need to see the model loaded without using the viewer, then [i]you[/i] need to provide [i]your own [/i]code.

Does that make sense?


Lastly, perhaps it would be sensible to try to fix your own computer so that you can install and use the SDK for yourself -- what exactly do you mean by "messed up"? Perhaps we can help to diagnose why you're unable to install/use/whatever-the-problem-is the libraries.

Share this post


Link to post
Share on other sites
Hi again, jbadams.

My version of Windows 7 Pro has all DirectX runtime libraries corrupted and has necessary OS GUI deficits in prominent .sys files.

I can't run any video files either. Somebody purposely corrupted the files on my system through hacking and malice.

Also, if you wish to see my blogs you'll have to wait until I get hosting on my site. I told you I can give the site, yes, to bookmark, but the site won't be up for a while until I finish paying for hosting and other services.

The site will be here: [url="http://www.mlillowitz.com/"]http://www.mlillowitz.com/[/url]

And I'm sorry if you don't understand my points. When my blogs are up and site maybe you'll understand. I'll just wait until I can save up enough to get my new iMac. :)

20+ years of programming experience.

- Mikey

Share this post


Link to post
Share on other sites
The obvious thing to do would be to make backups of your personal files, and reinstall the OS. Windows install is relatively painless nowadays, but reinstalling your tool software can take some time (depending on software, of course). After that, turn on automatic updates, check that your firewall is active, download Microsoft Security Essentials (or some other malware detector), establish a backup plan and keep software such as Adobe Flash and Reader up to date as well.

If your OS is corrupted to the point where it will not even run, take out the hard drive and connect it to an another computer via a SATA-USB adapter cable (can be purchased for less than $30). You can then find your personal files under the Users directory when you connect it as an USB drive. Some viruses will actively scramble your files, though, so recovery may not be possible. Also, the reason for the corruption could be a failing hard drive; that would potentially hinder the file recovery as well.

Note that D3D does not run in iMac unless you install Windows in it (be it dual-boot or virtual).

In my 20+ (actual) years of developer experience, I have picked up some IT admin practices as well ;)

Share this post


Link to post
Share on other sites
[quote name='MLillowitz' timestamp='1333429357' post='4927772']
My version of Windows 7 Pro has all DirectX runtime libraries corrupted and has necessary OS GUI deficits in prominent .sys files.
[/quote]
You should be able to fix that by re-installing the OS and then re-installing the SDK and run-times. It's a simple and relatively quick fix, and if done correctly won't lose any of your data (which you should have backed up anyway).

Honestly, this is pretty basic for anyone with a technical background, I'm surprised you haven't done so given your "20 years experience"...

Share this post


Link to post
Share on other sites
[left]Regardless of how messed up your installation is, the original installation media will work fine. Furthermore there are plenty of places where you can obtain (including MSDN and TechNet) original copies of the ISOs to install the operating system. Provided you have the legal license.[/left]

[left]Lastly, even if someone DID write said example, you would not be able to compile it if your DXdev installation was so corrupt. Furthermore, even if it was corrupt a simple re-installation would fix that.[/left]

[left]Lastly, I highly doubt you have 20+ experience in anything software development related. I HIGHLY suggest you stop claiming that.[/left]

Share this post


Link to post
Share on other sites
Dear MLillowitz:

It was a pleasure to hear from you recently, after reviewing your activities on this site it was decided that ultimately your "20+ years of experience" were probably too much for us. Clearly you're so much better at software development than us, what with your inability to reinstall an operating system, repair a corrupted DX SDK installation, or even use a smart pointer properly.

Thus we've decided to remove your illustrious self from your presence, lest we infect you with a modicum of intelligence.

Hugs and kisses,
The Senior Moderators

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this