New Rotation Animator version 1.0

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki

How do you find new animator ?

GREAT !!!
4
57%
It could be better
2
29%
I prefer the old one
0
No votes
I don't use rotation animator
1
14%
 
Total votes: 7

jox
Bug Slayer
Posts: 726
Joined: Thu Apr 22, 2004 6:55 pm
Location: Germany

Post by jox »

warui wrote: But it still has some bugs which i'm currently working on with afacelis (thanks man once again).
Still?

I looked at the source and I must admit that I'm a bit surprised...

You're interpolating between two rotation states stored in two vectors.

Ok.

But your're treating the vectors as if they were spacial vectors (location or direction or whatever). But the vectors used for rotation are really only a container of three euler angle values. So getLength() and normalize() doesn't really make sense (that's also why you had to "fix" the normalize() function I guess).

I doesn't say it won't work, but as you say it still has bugs...

So my quick idea is:

remove this in the constructor:

Code: Select all

	f32 WayLength = (f32)Vector.getLength();
	Vector.normalize();
	TimeFactor = WayLength / TimeForTurn;
and in animateNode() simply do this:

Code: Select all

u32 factor = (timeMs-StartTime) / TimeForTurn;

if (!Loop && factor >= TimeForTurn)
	rot = End;
else
	rot = Start + (Vector * factor);
It's untested but you get the idea, and it's just a proposal...

The whole reverse thing also makes me a bit nervous ;) but I might look at it later...
jox
Bug Slayer
Posts: 726
Joined: Thu Apr 22, 2004 6:55 pm
Location: Germany

Post by jox »

Btw, your vector normalize() fix is still good and valid. Didn't wanna say it's unnecessary! :)
warui
Posts: 232
Joined: Wed Apr 14, 2004 12:06 pm
Location: Lodz, Poland
Contact:

Post by warui »

jox wrote: But your're treating the vectors as if they were spacial vectors (location or direction or whatever). But the vectors used for rotation are really only a container of three euler angle values. So getLength() and normalize() doesn't really make sense (that's also why you had to "fix" the normalize() function I guess).
This because is treat rotation as movment in rotation space. Nothing wrong in it. And i "needed" to fix normalization because if you set same vector for start and destination node would just disappear :) Same happens for Fly Streight animator.
jox wrote:I doesn't say it won't work, but as you say it still has bugs...
There are some compilation problems under VC7 and 6 because of casting problems.
jox wrote:So my quick idea is:
Thanks for pointing out that normalization was unnessesary. Not that animator wokred wrong, but what you proposed works as good as my. I just need to changes two things:

Code: Select all

u32 t = timeMs-StartTime;
f32 factor = t / (f32)TimeForTurn; // otherwise we will get 
                                   // results like 1,2,3,... ;)

if (!Loop && t >= TimeForTurn) // with factor it will loop for MUCH too long
	rot = End;
else
	rot = Start + (Vector * factor);
And check reversing if you want. But it took me most time to get it to work. it should be fine.[/quote]
Tomasz Nowakowski
Openoko - www.openoko.pl
Post Reply