Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Limb Position and Rotation/Direction with Animation

Author
Message
Grasmann
16
Years of Service
User Offline
Joined: 1st Sep 2008
Location:
Posted: 27th Mar 2009 01:05 Edited at: 27th Mar 2009 10:24
Hi there

I made something like a alpha version of a timer based Animation system for my game ... atm there are just different Animation-Parts that are timer based but later I want to make a global System out of that ... to use it everywhere needed in my game with just some Functions with parameters

To get the right motion when animating the Player I placed the Camera at the Playermodels head ... the idea was to catch the animation of the Playermodel and to apply it to the Camera ... that way cinematic Videos would be really easy and fun to do

But then again I noticed that somehow the Commands
(EDITf course I meant those XD

Limb Position()
Limb Angle()
Limb Direction()

seem to not include the animation from my .x file
(would it maybe a difference to make the object 3ds? I think those could hold animation data too?)

I need that working XD ... not only for the Camera

Is it somehow possible to get that working?

Maybe I have to Export the 3D-Model in a Special way? But I allready tried different methodes of exporting with milkshape.

Or is it impossible anyway?
RiiDii
20
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 27th Mar 2009 19:21
I don't think it is directly possible (although there might be a dll or plugin that can do it). The work-around is to export the limbs as separate objects and position them onto the object, then rotate and animate the limb-objects. You might need a plugin/dll for rotation and angles, like EZ-Rotate.


Open MMORPG: It's your game!
Visigoth
20
Years of Service
User Offline
Joined: 8th Jan 2005
Location: Bakersfield, California
Posted: 28th Mar 2009 03:49 Edited at: 28th Mar 2009 03:49
If I'm understanding you correctly, you want to "capture" animation into an .x file? Or, are you wanting to just play back an animation? If you have an animation in an .x file, all you need to do is use the command play object(), or loop object(), set object frame(), etc.
It is possible to actually capture an animation into an .x file, but, it would take some work. I've been studying .x file format pretty hard. Basically, all animations are are scale, position, and rotation transformations on meshes inside an .x file. If you had an .x file export function, you could say rotate a limb, then save the rotation into an array, and after you had all your animations loaded into an array, save it out into an .x file.
If you want to learn about the .x file fromat, here is a site I use for reference.

http://local.wasp.uwa.edu.au/~pbourke/dataformats/directx/

its a little dated, but, it still applies.
Grasmann
16
Years of Service
User Offline
Joined: 1st Sep 2008
Location:
Posted: 28th Mar 2009 06:28 Edited at: 28th Mar 2009 06:31
Nah you misunderstood me.

I made a timer based animation system ( or the preversion of it ) for my game ... that means I´m assigning the Frames seperately everytime the timer says I have to ... that works pretty well ... Animations have the same speed if I have 30 FPS compared to 270 FPS ... doesn´t matter.

What I want to do is to get the global limb positions (x,y,z) and the global rotation/direction (xr,yr,zr) of the Head of my Player object

That way I just can place the camera at x,y,z and rotate/point it at xr,yr,zr

So if I would like to do cinematic videos in first person view, where the playermodel or parts of it like an arm or something are still visible, I would just make a simple animation for the playermodel
Visigoth
20
Years of Service
User Offline
Joined: 8th Jan 2005
Location: Bakersfield, California
Posted: 28th Mar 2009 06:42
ok, I'm confused. If you want "global" rotation, I assume you mean where it is in world space. thats just limb space + root space, assuming root is at 0,0,0. If you are changing the actual positions of your limbs in the mesh, thats not really animation. Thats just repositioning the limbs. Its not the same thing as an animation. Like I said, if you have an animation, you have limbs or objects at a set position, and you apply rotation, scale, and position transforms on them. The actual mesh x,y,z remains the same. Maybe I'm still not getting what you are up to.
RiiDii
20
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 29th Mar 2009 02:00
Limb Position X/Y/Z(Object,Limb)
Quote: "This command will return the real number world x/y/z position of the specified limb of the 3D object "


Use that instead of Limb Offset X/Y/Z(Object,Limb), which returns the offset of the limb from the base object.

=================================

Limb Direction X/Y/Z(Object,Limb)
Quote: "This command will return the real number world x/y/z angle of the specified limb of the 3D object "


Use that instead of Limb Angle X/Y/Z(Object, Limb), which returns the local angle of the limb.

Here is a code I threw together quick to demo the different commands. The head is set back so you can see the body.




Open MMORPG: It's your game!

Login to post a reply

Server time is: 2025-05-19 07:49:05
Your offset time is: 2025-05-19 07:49:05