Can somebody here help me with DirectX?

Started by
21 comments, last by Washu 12 years ago
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
Advertisement
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.

Niko Suni

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.

Niko Suni


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.

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

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

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

Thank you.

20+ years of programming experience.

- Mikey

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

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.



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

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 no idea 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 you need to provide your own 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.

- Jason Astle-Adams

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: http://www.mlillowitz.com/

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
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 ;)

Niko Suni


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

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"...

- Jason Astle-Adams

Hey, jbadams.

I can't reinstall because the files necessary to do so are corrupt.

Did you not read my post?

20+ years of programming experience.

- Mikey

This topic is closed to new replies.

Advertisement