Sign in to follow this  
Presh

Jim Adams 'Advanced Animation with Directx' - help me please!!!

Recommended Posts

Hi all, I recently purchased Jim Adams book 'Advanced Animation with Directx'. However when I try to run the demo executables my machine crashes and asks me if i want to report an error to microsoft. I then tried it on another machine and get the same errors. I then decided to recompile an example code myself. The examples compile and build with no errors but still they crash out on me. Does anyone else have this problem and if so do you have a solution for me? thank u, any help would be great Presh [Edited by - Presh on August 3, 2004 4:57:38 PM]

Share this post


Link to post
Share on other sites
I thought the same and I uninstalled and then reinstalled the sdk. That didn't help any.
Besides I tried it on my other computer and the precompiled demo executables on the books cd failed also.

Its strange because the directx sample code all compile and run correctly.

I've emailed Jim to see what he suggests.

thanks for yzzid


Share this post


Link to post
Share on other sites
This doesn't sound like a book problem as I haven't heard of this happening to anyone else. I think it may be something with your computer.

Is there any other programs that you run on your machine that exhibit strange behavior or crash for no reason?
What OS are you using?
Also, what version of the DirectX SDK?

Share this post


Link to post
Share on other sites
Hi guys

Like i said i tried it on two different machines and they both crash out. Even the precompiled executables crash out.
Also I have no problem compiling and running any of the directx samples.
I even uninstalled me directx and installed the directx sdk included on the books CD.

I'm running windows xp (on a laptop and also tried on a desktop).

I have no other problems at all running any executable or games.

Someone else must have this problem also.

When I use the debugger it crashes out stating:

Unhandles exception: C0000005: Access violation

The debugger stops on this line:

g_pD3DDevice->CreateVertexBuffer(sizeof(BackdropVerts), D3DUSAGE_WRITEONLY, BACKDROPFVF, D3DPOOL_DEFAULT, &g_BackdropVB, NULL);

The only example from the book I can get working is the x-file frame program.

Man this is annoying as I bought the book to learn directx animation and therefore don't know enough to debug it.

Thanks for your replies guys






Share this post


Link to post
Share on other sites
That is definitely not the book to learn DirectX from. It teaches nothing of the basics. Perhaps you should go with something that starts from the begining and teaches DirectX at a beginners level.

COnsequently, if you go to the DirectX control panel app, you can set the DirectX runtime to the debug ones and in Visual Studio it should tell you why the call is failing. Make sure to put the debug level at it's highest setting. Let us know what the error is.

Also, what video card are you running?

Share this post


Link to post
Share on other sites
I think I know what the problem is.

In his book Jim uses mixed vertex processing when he creates his Direct3D device. If your video card does not support hardware vertex processing, then the device creation will fail. Check where he creates the device and I believe you should see it setting it to NULL.

One reason the SDK samples work for you is they are created in such a way that if hardware vertex process device cannot be created it will fall back to a software processing device. Jim does not handle this situation in his book.

Sounds to me like you may be using some pretty old video cards.

In the meantime try changing the device creation code (in Direct3D.cpp) to create a device using Software vertex processing.

Change D3DCREATE_MIXED_VERTEXPROCESSING to D3DCREATE_SOFTWARE_VERTEXPROCESSING in the InitD3D function.

Share this post


Link to post
Share on other sites
yzzid

Oh man I can't say how much I appreciate you helping me out.

My graphics cards must me pieces of cr*p (laptop=ati radion mobility and brand you hp desktop with unknown card type).

Thanks to you I can finally get on with learing directx and importing my skinned meshes! yippeee

cheers mate

Presh





Share this post


Link to post
Share on other sites
Just out of curiosity, should the D3DCREATE_MIXED_VERTEXPROCESSING flag work with a card that doesn't handle hardware vertex shaders?

I also noticed Jim has a commented out line in direct3d.cpp with the D3DCREATE_SOFTWARE_VERTEXPROCESSING flag replacement.

Sorry for been an idiot. I guess I have a lot to learn.

thanks again

Presh

Share this post


Link to post
Share on other sites
Sorry for bugging you yzzid,

I notice earlier you mention the directx control panel.
For some reason I don't have the directx control panel under my windows xp control panel. Jim mentions it in his book also.
Is this meant to be there during directx sdk installation?

Also is there a decent directx book you could recommend as to learn some basics from?

cheers

Presh

Share this post


Link to post
Share on other sites
Yes the control panel should be installed when you install the SDK although I have seen cases where is wasn't for some reason.
I believe the file is called directx.cpl and you should locate it in your SDK install directory and copy it to your windows system directory.

As for the mixed vertex processing flag. This allows you to use HW and SW vertex processing. I believe the default is set to HW. You can use the SetSoftwareVertexProcessing call on the IDirect3DDevice9 interface to switch it over to software VP.

As for beginning DX books, I dunno. I learned DX back in the 8.0 days and those books are outdated. I haven't seen anything spectacular recently. I can however recommend taking the Direct3D course at Game Institute or Gameversity. The one you want depends on your learning style. Gameversity courses follow a set schedule where Game Institute allows you to study at your own pace. It's up to you which method is best for your learning style.

Good luck and feel free to post on this board if you have any mroe questions.

BTW, I take it when you changed the book code to use SW vertex processing it worked?

Share this post


Link to post
Share on other sites
yzzid

yes it all the code now works thanks to you.
I've now been able to import my own animated skinned meshes
which is great and I've just finished reading the directx sdk tutorials and some of the reference doc.
I think I'll probably do as you suggest and take a course on it though.

Cheers mate for all your

Presh

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