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 / How to Solve Scaling During Animation.

Author
Message
Stab in the Dark software
Valued Member
21
Years of Service
User Offline
Joined: 12th Dec 2002
Playing: Badges, I don't need no stinkin badges
Posted: 19th Jan 2012 04:39 Edited at: 19th Jan 2012 15:35
We recently discovered this while developing our Dbpro plugin for loading Milkshape objects.

Some models scale during their animations in DBPro because the model file uses Matrix Key Frames and
requires DBpro to calculate the in-between frames of animation. DBPro uses Matrix interpolations to calculate
the in-between frames. Matrix interpolations do not correctly calculate rotations and can cause the geometry to be scaled.
In some cases the geometry can disappear altogether.

The simple solution is to export the model from your modeling program with position and rotation keys instead
of using matrix keys. DBPro correctly calculates the in-between frames using quaternions when a model uses position and rotation keys.
In most of the modeling programs to export with position and rotation keys just uncheck the matrix key export option.

We decided to post here rather than in the modeling forum because it is important for DBPro developers to be aware
of this when loading models as this relates to the way DBPro renders the animation. We have attached an example to show the difference.

Note: If a Model contains a Matrix Key for each frame of animation (including the in-between frames) DBPro does
not need to calculate the in-between frames and the model will not scale during animation. However storing all of the
in-between frames within the model file significantly increases its file size and the amount of ram required when loading
the model in DBPro.

EDIT:Forgot the attachment

[img][/img]


WindowsXP SP3,Vista,Windows 7 SP1, DBpro v7.7RC7
Stab In The Dark Editor
The coffee is lovely dark and deep,and I have code to write before I sleep.

Attachments

Login to view attachments
MrValentine
AGK Backer
13
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 19th Jan 2012 07:16
Attached?¿?

CumQuaT
AGK Master
13
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 19th Jan 2012 12:29
Thanks for this PSA guys! Fight the good fight!


Stab in the Dark software
Valued Member
21
Years of Service
User Offline
Joined: 12th Dec 2002
Playing: Badges, I don't need no stinkin badges
Posted: 19th Jan 2012 15:51
Sorry forgot the attachment. The attached exe shows two models one with Matrix keys and the other with position
and rotation keys. Both model files are .x files in text format so you can open them in wordpad and see the difference.

[img][/img]


WindowsXP SP3,Vista,Windows 7 SP1, DBpro v7.7RC7
Stab In The Dark Editor
The coffee is lovely dark and deep,and I have code to write before I sleep.

Attachments

Login to view attachments
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 19th Jan 2012 23:32
Looks useful. Thanks.
Chris Tate
DBPro Master
15
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 20th Jan 2012 01:27
LOL I too have seen this with my character animation; my character's legs keep shrinking as he runs...

WLGfx
16
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 20th Jan 2012 01:51
@SitDs - Another great tip logged... Cheers... Very useful...

Mental arithmetic? Me? (That's for computers) I can't subtract a fart from a plate of beans!
Warning! May contain Nuts!
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 20th Jan 2012 19:09
Quote: "my character's legs keep shrinking as he runs"


I know the feeling.
Chris Tate
DBPro Master
15
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 20th Jan 2012 19:25
^^ lol

Login to post a reply

Server time is: 2024-03-28 21:54:49
Your offset time is: 2024-03-28 21:54:49