nel-all
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Nel] animation problem


From: Andi 'Debug' Allen
Subject: Re: [Nel] animation problem
Date: Wed, 3 Mar 2004 00:26:37 -0000

thanks that helps a ton and half :)
 
cheers Hulud
 
 
    Andi 'Debug' Allen

-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GCS d--- s-: a-- C++++ US++ P++ L+ E--- W+++ N o-- K++ w++++
O---- M-- V-- PS+++ PE Y+ PGP t+ 5++ X++ R-- tv+++ b++++ DI++ D++
G++ e* h++ r+++ y++++
------END GEEK CODE BLOCK------


Design Lead
Project Talaus Online
www.neverborn.net
----- Original Message -----
Sent: Tuesday, March 02, 2004 4:40 PM
Subject: Re: [Nel] animation problem

Hi Andi,
 
>NL3D::UAnimation *testAnimation = CAnimationManager::instance().AnimationSet->getAnimation(0);
>NL3D::UTrack *testTrack = testAnimation->getTrackByName("pos");
 
1) At each frame, you must provide final instance positions to NeL. So you have to know where your characters are placed. In Ryzom,
the character loop looks like that :
 
* First look at the animation tracks for the root node. Evaluate the position / rotation tracks :
 
NL3D::UTrack *testTrackPos = testAnimation->getTrackByName("pos");
NL3D::UTrack *testTrackQuat = testAnimation->getTrackByName("rotquat");
 
CVector resultPos;
testTrackPos->interpolate(animationLocalTime, resultPos);
CQuat resultQuat;
testTrackQuat->interpolate(animationLocalTime, resultQuat);
 
* Build a matrix:
 
CMatrix mt;
mt.identity();
mt.setRot (resultQuat);
mt.setPos (resultPos);
 
* Transform the local animation matrix in the world with the world matrix "where the animation cycle started".
 
CMatrix mtWhereAnimationStarted;
CMatrix finalCharacterMt = mtWhereAnimationStarted * mt;
 
* Set the skeleton's world matrix
 
skeleton->setMatrix (finalCharacterMt);
 
* When the animation cycle ends, reset the mtWhereAnimationStarted matrix and start a new animation cycle.
 
if (animationLocalTime >= animationLength)
{
    mtWhereAnimationStarted = finalCharacterMt
    animationLocalTime = 0;
}
else
{
    animationLocalTime += elapsedTime;
}
 
This code should move your character in world space with a local space animation.
 
2) Now, you have to setup the "detailed animations" system. The "detailed animations" are evaluated automatically by the NeL engine if the instance is visible. "Detailed animations" are bones animations, material animations...
 
First, create an animation set. (UScene::createAnimationSet()).
Then, add all your animations you need for your character into it. (UAnimationSet::addAnimation()).
Once it is done, build the animation set (UAnimationSet::build()).
You have an animation set ready to use with a play list.
 
Create a playlist manager (UScene::createPlayListManager()).
Create a playlist for your character (UPlayListManager::createPlayList(), use one playlist by character).
Get your animation id (uint walkId = UAnimationSet::getAnimationIdByName("walk")).
 
At the begin of each animation cycle, setup your playlist:
    PlayList->setAnimation (0, walkId);
    PlayList->setTimeOrigin (0, currentTime);
 
At each frame, animate the playlists
    PlayListMngr->animate (currentTime);
 
Your character should be animated.
 
Happy hacking,
 
Hld.
 
----- Original Message -----
Sent: Friday, February 20, 2004 3:47 AM
Subject: Re: [Nel] animation problem

hey cyril
 
hate to be a pain old chap
 
but this
 
- Evaluate the current animation time (ie where the animation must by played)
- Get the matrix of the root bone from the current animation (evalute the "pos" and the "rotquat" tracks and build a matrix)
- Translate the matrix with your snaped world position (if need be, rotate it)
- Set the final skeleton world matrix. (Skeleton->setMatrix (finalRootBoneWorldMatrix))
 
ive looked at the animation system and trying to get my head around it
 
how do i do this could you shoot me a quick example if thats ok
 
in my head im thinking
 
animationset of animations
playlists of animations from animation set
each entity has a playlist
 
i need to iterate entities
then get their playlist
then it gets fuzzy...
 
how do i get the current animation time per entity per animation
 
how do i evaluate the pos and rotquat tracks via that i assume which is gained via  getTrackByName
 
this i would of done like this
 
NL3D::UAnimation *testAnimation = CAnimationManager::instance().AnimationSet->getAnimation(0);
NL3D::UTrack *testTrack = testAnimation->getTrackByName("pos");
 
but if we are adjusting each entity via its own playlist? i think im just a little confused as of how
to proceed
 
then how do i use that id to get the


_______________________________________________
Nel mailing list
address@hidden
http://mail.nongnu.org/mailman/listinfo/nel-all

reply via email to

[Prev in Thread] Current Thread [Next in Thread]