Skip to main content
gamedev.net
🔒 Locked

a working animation sample?

Started by jigen3 2 replies 650+ views
Original Post
jigen3
jigen3
hi, i've been trying to get the animation samples provided by the book DX9 kick start and the "SimpleAnimation" example provided by the DX Aug SDK, but neither seems to work. the LoadHierarchyFromFile() function always fails for some reason in the kick start example (and i don't know how to debug a failing function) and the SDK one fails to create the Direct3D device. i looked at the animation tutorial on this site, but that is written in c++. does anyone know of a working animation sample (in c#) or at least a more detailed animation tutorial? thx jigen3
Saruman
Saruman
I'm not quite sure what your problem is with the SDK, as I know for a fact that the managed examples all run perfectly fine. Also start using the debugger and trace what is going on in the application... as that way you can get more information on what is happening. I mean the call to LoadHierarchy is going to spin through your user-defined callbacks, so break there and step.
counterrabbit
counterrabbit
in my opinion the sdk isnt a great place to learn anything, if you are a noob like me i find most of it (accompanied by the msdn) just confusing.


if you want to animate something, im gonna assume 2d there are 2 ways (well 2 ways i know of) heres a basic run down, this should give u enough to get started and then ull be up to where i am

1. load a cycle of images to the back buffer, the method is to make an array of pointers for as many images you have. do this loading with a loop

2. cycle through the images by a numerical name using a loop

3. make a timer to cycle through the loop

.. id show u my code but its messy and by no means any grounds to learn on


the 2nd way is to do what im doing at the moment and use id3dxsprite and use the RECT structure to look at a certain part of a texture and then cycle through. if you have no idea what i mean do a google search for a sprite sheet and just see the different states of animation.

id really like a code buddy right about now so if you wanna message me and we can work on somethings together then i am more than welcome, im finding all this a bit hard too
jigen3
jigen3
thx for the replies, but when i use the step into/out/over functions in the debugger on the function it breaks out of the debugger leaving the generic error message:

An unhandled exception of type 'System.NullReferenceException' occurred in microsoft.directx.direct3dx.dll

and i'm also trying to do 3d animation, not 2d, thx tho.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.