Jump to content
  • Advertisement
Sign in to follow this  
michael879

variables in animation

This topic is 4496 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

What I need is a .x file that contains the data for a tank model, along with animation data that allows my program to rotate the turret and the cannon some variable amount of degrees. I tried using bones but the 3d modelling program Im using (blender) doesnt export bones to the .x format. Anyone know another way to do this?

Share this post


Link to post
Share on other sites
Advertisement
You'll definitely want bones, especially for turret work. Odd that it can't export them; maybe user error or something? It's a pretty basic feature.

As an aside, assuming you're working on a game, you'll likely want to scrap the idea of using animations to drive your turret logic. We experimented with something like that on the last project I was on and it was a horrible failure. Much easier is to just give the program knowledge of which bones per model control the rotate and pitch for any given turret and manipulate their facing angles manually. It's really pretty easy once you have a nice run-time representation of a hierarchical skeleton. You'll be able to get sweet looking hierarchical turrets this way too (angle restricted machine-gun turret on top of the tank's main gun which will be very hard to do with animation data).

-me

Share this post


Link to post
Share on other sites
yea I wasnt actually planning on using animated bones, but I havnt really dont much research on this yet and dont even know how directx uses mesh bones. It says in blender when you hover over export to .x that it isnt able to export bones yet. I guess I should use another program.. thanks for the help

Share this post


Link to post
Share on other sites
ok I found an exporter that exports bones to .x. The problem is I get an error whenever I try to call LoadXFromFile. It returns E_FAIL and in the documentation it doesnt even mention the function returning that.

Share this post


Link to post
Share on other sites
Do you mean you're trying to use D3DXLoadMeshFromX() and it's returning E_FAIL?

If so, are you debugging using the debug version of Direct3D? It can provide quite a lot of useful information that the retail version doesn't provide.

If not, what framework/language/runtime are you using?

Share this post


Link to post
Share on other sites
Im using VC++. Im pretty sure Im using the debug version of d3d.. How do I check? and yea I meant D3DXLoadMeshFromX() just forgot the full name and didnt want to look it up. Im using the V() macro defined in DXUT. All it tells me is the line number and the return code tho.

Share this post


Link to post
Share on other sites
I'm using XP, so for me it's:

Start->Control Panel->DirectX

then on the Direct3D tab, there's a box labelled Debug/Retail D3D Runtime, and a radio box to select betwen debug and retail, and a note about how it only affects DX8 and later interfaces. The debug version is usually much more verbose about failures, especially if you crank of the Debug Output Level part of the D3D control panel to "More".

Can you load the .x file in the DirectX viewer that's part of the SDK?

Share this post


Link to post
Share on other sites
thats weird.. the dx viewer wont load it.. doesnt say why. And my program still crashes without any real detail, just says E_FAIL was returned.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!