Jump to content

  • Log In with Google      Sign In   
  • Create Account

Can somebody here help me with DirectX?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
22 replies to this topic

#1 MLillowitz   Banned   -  Reputation: 23

Like
0Likes
Like

Posted 30 March 2012 - 02:05 AM

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.

Sponsor:

#2 Tom KQT   Members   -  Reputation: 1621

Like
0Likes
Like

Posted 30 March 2012 - 05:32 AM

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/

#3 MLillowitz   Banned   -  Reputation: 23

Like
0Likes
Like

Posted 30 March 2012 - 06:16 PM

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

#4 Nik02   Crossbones+   -  Reputation: 2917

Like
2Likes
Like

Posted 31 March 2012 - 12:07 AM

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.

Niko Suni


#5 Tom KQT   Members   -  Reputation: 1621

Like
0Likes
Like

Posted 31 March 2012 - 01:55 PM

Thanks Nik02, you are absolutely right.

#6 MLillowitz   Banned   -  Reputation: 23

Like
0Likes
Like

Posted 31 March 2012 - 04:41 PM

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.

#7 Nik02   Crossbones+   -  Reputation: 2917

Like
0Likes
Like

Posted 01 April 2012 - 12:41 AM

What code? You only posted the model file.

Niko Suni


#8 MLillowitz   Banned   -  Reputation: 23

Like
-3Likes
Like

Posted 01 April 2012 - 03:29 AM

Hi again, Nik02.

I mean the code I kindly asked for. :)

#9 Tom KQT   Members   -  Reputation: 1621

Like
0Likes
Like

Posted 01 April 2012 - 06:41 AM

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

#10 Nik02   Crossbones+   -  Reputation: 2917

Like
0Likes
Like

Posted 01 April 2012 - 08:04 AM

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.

Niko Suni


#11 MLillowitz   Banned   -  Reputation: 23

Like
0Likes
Like

Posted 02 April 2012 - 05:04 AM

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

#12 Nik02   Crossbones+   -  Reputation: 2917

Like
1Likes
Like

Posted 02 April 2012 - 05:44 AM

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


#13 Nik02   Crossbones+   -  Reputation: 2917

Like
0Likes
Like

Posted 02 April 2012 - 06:27 AM

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


#14 Tom KQT   Members   -  Reputation: 1621

Like
1Likes
Like

Posted 02 April 2012 - 07:00 AM

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.

#15 MLillowitz   Banned   -  Reputation: 23

Like
-3Likes
Like

Posted 02 April 2012 - 06:10 PM

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

#16 jbadams   Senior Staff   -  Reputation: 19350

Like
3Likes
Like

Posted 02 April 2012 - 09:30 PM

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.

#17 MLillowitz   Banned   -  Reputation: 23

Like
-4Likes
Like

Posted 02 April 2012 - 11:02 PM

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

#18 Nik02   Crossbones+   -  Reputation: 2917

Like
1Likes
Like

Posted 02 April 2012 - 11:25 PM

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


#19 jbadams   Senior Staff   -  Reputation: 19350

Like
0Likes
Like

Posted 02 April 2012 - 11:30 PM

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

#20 MLillowitz   Banned   -  Reputation: 23

Like
-2Likes
Like

Posted 03 April 2012 - 01:39 AM

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




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS