Outerra forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Download Outerra Tech Demo. Unofficial Outerra Discord server, MicroProse Discord server for OWS.

Author Topic: Animation problem  (Read 9847 times)

andfly

  • Sr. Member
  • ****
  • Posts: 347
Animation problem
« on: August 21, 2015, 01:29:02 pm »

Hi! Cameni
First of all congratulations to the new version and thank you !
Then a question ...
With this version all my models are like "exploded"!     :'( :'( :'(

What may have happened ?
Do you have any advice for me to fix it?
Logged
I do not know the English language. I use Google Translate. I hope it's all understandable.

Uriah

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 569
  • We do these things not because they are easy. -JFK
Re: Animation problem
« Reply #1 on: August 21, 2015, 02:35:49 pm »

Hi andfly,

You might want to try re-importing the FBX or DAE file with the new version, might help.

Also, add the use strict method to the very first line of the script, and go through and make sure all you global and local variables are declared. The use strict method will log errors to console if there are any exceptions or syntax errors you aren't aware of.

Code: [Select]
"use strict";
Regards,
Uriah
Logged

andfly

  • Sr. Member
  • ****
  • Posts: 347
Re: Animation problem
« Reply #2 on: August 22, 2015, 05:40:35 pm »

Hi andfly,

You might want to try re-importing the FBX or DAE file with the new version, might help.

Also, add the use strict method to the very first line of the script, and go through and make sure all you global and local variables are declared. The use strict method will log errors to console if there are any exceptions or syntax errors you aren't aware of.

Code: [Select]
"use strict";
Regards,
Uriah

Thanks Uriah,

The re-import (now tested) did not solve the problem ...
 I did not know the command was "use strict" is definitely worth trying!

 However now I have a more serious problem.
 Last night I upgraded to Windows 10 and now Outerra does not work anymore.
 I get error "BEFORE" to appear the login window!

 Now I'll try to make installation a "clean" starting from direct link, and
   ... who knows that does not solve the other problems .....

Again, thank you for advice!
Logged
I do not know the English language. I use Google Translate. I hope it's all understandable.

andfly

  • Sr. Member
  • ****
  • Posts: 347
Re: Animation problem
« Reply #3 on: August 24, 2015, 12:26:55 am »

Well ... I'm really puzzled ...
I had already pointed out that, since the last update, many of the animatable parts of my models (and some lever of a pair of planes Levi) were drawn away from their "right" position.
After trying the re-importation and meticulous revision of the script commands (with no success) I continued the observation of the movements of a model to try to understand where was the mistake and ... something really strange I seem to seeing it!

It states that the loading of the model (I used the Rocket Man) without performing any movement is perfect!
Each part (arms, legs, supports ...) are all very firm in their place.
The problem comes when trying to move something!
I deleted all the movements leaving only the "rotate_joint_orig" which refers to the right leg (which was immediately drawn "out of place"), then I stopped the Rocket Man to the ground (where it remains still without performing any animation), I set visual in "third person", and I moved the camera around the model to try to understand "how" and "why" the leg was "poorly positioned" and find the solution to my problem.

The video below explains my doubts ...
Turning around the model (with no animation in place) the leg seems to change its position and even penetrate and exit from the other parties still ...

I was wrong to set the axes, the centers of rotation in Blender or something else?
There will be something in the script that causes all this?
Perhaps the importer collada works differently from earlier versions?
There will be a mistake in the graphical display of this version of Outerra?
Or it is completely normal and I do not understand?

I do not know what to think ....

I would be very grateful to those who, more capable than me, you can give me an explanation ...

Logged
I do not know the English language. I use Google Translate. I hope it's all understandable.

cameni

  • Brano Kemen
  • Outerra Administrator
  • Hero Member
  • *****
  • Posts: 6721
  • No sense of urgency.
    • outerra.com
Re: Animation problem
« Reply #4 on: August 24, 2015, 01:50:51 am »

Angrypig modified that part of the pipeline, and I know he also had to debug and fix a similar issue there. He will have to take a look. He will probably need a test model that exhibits the bug.
Logged

angrypig

  • Sr. Member
  • ****
  • Posts: 454
Re: Animation problem
« Reply #5 on: August 24, 2015, 02:12:12 am »

I will check skinning pipeline... Can you send me FBX file?
Logged

andfly

  • Sr. Member
  • ****
  • Posts: 347
Re: Animation problem
« Reply #6 on: August 24, 2015, 01:56:07 pm »

Hi! cameni & angrypig
Thanks for your concern!

I sent the link to angrypig of the DAE file of my model for debugging.
(I always used the importer collada inserted into the standard menu of Anteworld).

Thanks again !
Logged
I do not know the English language. I use Google Translate. I hope it's all understandable.

andfly

  • Sr. Member
  • ****
  • Posts: 347
Re: Animation problem
« Reply #7 on: August 28, 2015, 02:53:21 pm »

I solved the problem of the mysterious graphic effect.
On the advice of angrypig I reviewed all rotation commands of the script of my model "normalizing" the axis of rotation to the values ​​of "zero" and "one", and everything started to work perfectly.

Put simply, for the interest of someone reading this post, things work this way:

The command    geom :: rotate_joint_orig    you write:

..... geom.rotate_joint_orig (bone_id, valrot, {x: a, y: b, z: c});

bone_id       is the object to rotate
valrot          is the angle of rotation in radians
a, b and c    are the values ​​of the rotation axes x, y and z

Before they could give no unit values ​​to the variables a, b and c  and it could lead, in a single command line, a differential rotation on three axes,
now (since version 5819) a, b and c can only be "0", "1" (and maybe "-1").

For example:

Before:       geom.rotate_joint_orig (bone_id, 1, {x: 1.75, y: coeff * 15-dist, z: c});

Now:          geom.rotate_joint_orig (bone_id, 1.75, {x: 1, y: 0, z: 0});
                 geom.rotate_joint (bone_id, coeff * 15-dist, {x: 0, y 1, z: 0});
                 geom.rotate_joint (bone_id, c, {x: 0, y: 0, z: 1});

I hope to have understood the directive angrypig (ask confirmation or correction)

However this all works well.
« Last Edit: August 29, 2015, 05:26:46 pm by andfly »
Logged
I do not know the English language. I use Google Translate. I hope it's all understandable.

cameni

  • Brano Kemen
  • Outerra Administrator
  • Hero Member
  • *****
  • Posts: 6721
  • No sense of urgency.
    • outerra.com
Re: Animation problem
« Reply #8 on: August 29, 2015, 03:47:23 am »

We'll add normalization into the rotate methods so this won't be necessary. Also, it's not an equivalent code, that would be something like this:

Code: [Select]
var vec = {x: 1.75, y: coeff * 15-dist, z: c};
var invlen = 1.0 / Math.sqrt(vec.x*vec.x + vec.y*vec.y + vec.z*vec.z);

geom.rotate_joint_orig(bone_id, 1, {vec.x*invlen, vec.y*invlen, vec.z*invlen});

But your new form may be what you actually wanted from the start. In any case, we'll put the vector normalization inside the api call so you won't have to worry about invalid params.
Logged

andfly

  • Sr. Member
  • ****
  • Posts: 347
Re: Animation problem
« Reply #9 on: August 29, 2015, 05:19:31 pm »

Well ...
I was too drastic in the interpretation of the advice of angrypig ...
Just make sure that the values are "normalized" and then you can use directly...

In any case, we'll put the vector normalization inside the api call so you won't have to worry about invalid params.
Excellent news, thanks.
Logged
I do not know the English language. I use Google Translate. I hope it's all understandable.