Export 360 degree looping animation

The place for artists, modellers, level designers et al to discuss their approaches for creating content for OGRE.
Post Reply
User avatar
semicolon
Halfling
Posts: 94
Joined: Sun Jul 04, 2004 4:42 pm
Location: Bangkok, Thailand
Contact:

Export 360 degree looping animation

Post by semicolon »

I was going to export 360 degree looping animation just like windmill and propeller. The animation looks really wrong when exported. I don't know how to export it correctly of that kind of animation. Otherwise if there is no other way to export 360 degree looping animation, would there be any suggesting manual way to do outside of 3DSMAX like adjusting the .skeleton.xml.

Thanks for the suggestion
Semicolon
"Nature is the mother of learning"
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 67
Contact:

Post by sinbad »

Set keyframes at distances less than 180 degrees apart. So you need 3 keyframes in a complete revolution.
User avatar
semicolon
Halfling
Posts: 94
Joined: Sun Jul 04, 2004 4:42 pm
Location: Bangkok, Thailand
Contact:

Post by semicolon »

Thanks a lot Sinbad.

It's almost there. I can now complete the whole revolution. However, at the middle of the cycle, it rotates backward a little bit before it spins back to the complete cycle. Hmm... couldn't really figure out why this happen. I could give you the sample .skeleton file if you need to inspect.

Semicolon
"Nature is the mother of learning"
User avatar
ahmedali
Gnome
Posts: 302
Joined: Fri Feb 20, 2004 8:52 pm
Location: Lahore, Pakistan

Post by ahmedali »

Try key framing at every 120 degs instread of 180. Maybe the "choose shortest path" option has anything to do with it??

If shortest path is On then dont add 2 key_frames at same location.
User avatar
semicolon
Halfling
Posts: 94
Joined: Sun Jul 04, 2004 4:42 pm
Location: Bangkok, Thailand
Contact:

Post by semicolon »

Thanks a lot for the comments ahmedali

I have tried the key trick as you commented but it doesn't seem to change. By the way, where is the "choose shortest path" option?

Semicolon
"Nature is the mother of learning"
User avatar
ahmedali
Gnome
Posts: 302
Joined: Fri Feb 20, 2004 8:52 pm
Location: Lahore, Pakistan

Post by ahmedali »

By default rotation is done using shortest-path algorithm. It is possible to change this behaviour using setUseShortestRotationPath() method.
Its in animation track, see docs

Does this animation seam occur at end/starting of the animation loop.

You can also mail me skeleton file. better send mesh too.

at: elkali at gmail dot com
User avatar
semicolon
Halfling
Posts: 94
Joined: Sun Jul 04, 2004 4:42 pm
Location: Bangkok, Thailand
Contact:

Post by semicolon »

I've sent the e-mail with the file to you. It was rejected. I am not sure whether or not this is gonna be in your mail box. However if you don't receive my e-mail, please let me know asap.

thanks a lot for your help.
Semicolon
"Nature is the mother of learning"
User avatar
ahmedali
Gnome
Posts: 302
Joined: Fri Feb 20, 2004 8:52 pm
Location: Lahore, Pakistan

Post by ahmedali »

I have sent you the new xml skeleton file. compile and use it. Sorry I deleted the key frames on Center, but they were empty anyway,

I havent yet investigated the actual cause.

But I think the main problem was being caused by having X-axis pf Box2 negative and positive at different keyframes.

Also I think there is bug in ogre OR in the mesh viewer the "chose closest path" is not affecting.


0 90 180 0
and
0 90 180 360
For example these key frames should give the same results, when "chose closest path" is On. by default it should On but in mesh viewer its seems not working. So its either mesh viewer or ogre!
User avatar
ahmedali
Gnome
Posts: 302
Joined: Fri Feb 20, 2004 8:52 pm
Location: Lahore, Pakistan

Post by ahmedali »

btw which 3d app / exporter are you using ?
User avatar
DWORD
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 1365
Joined: Tue Sep 07, 2004 12:43 pm
Location: Aalborg, Denmark
Contact:

Post by DWORD »

ahmedali wrote:0 90 180 0
and
0 90 180 360
For example these key frames should give the same results, when "chose closest path" is On. by default it should On but in mesh viewer its seems not working. So its either mesh viewer or ogre!
I don't think there's a bug. It's impossible to choose the shortest path from

180 to 0
and
180 to 360

as both are valid.
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 67
Contact:

Post by sinbad »

Correct, it's not a bug. You're better to use:

0 120 240 360

Then there's no ambiguity.
User avatar
Poseidon
Kobold
Posts: 30
Joined: Sun Apr 24, 2005 1:48 pm
Location: Karlsruhe, Germany

Post by Poseidon »

I had the same problem some time ago: I wanted to rotate the barrel of a minigun while the mounting stays firm.

The following posting helped me a lot :
http://www.ogre3d.org/phpBB2/viewtopic. ... ht=minigun

In the end I created two independent meshes (one for the barrel, one for the mounting) and rotated the barrel a bit on every frame.
It works out pretty nice, as you can see in this game [ur]http://vortex-game.sourcefoge.org[/url]

The advantage is, that you can rotate the barrel at different speeds or even stop it completely. The penalty is, you have to code a bit..

You are rotating using skeleton animation? I didn't know this is also possible, but great

greetz,
poseidon
User avatar
semicolon
Halfling
Posts: 94
Joined: Sun Jul 04, 2004 4:42 pm
Location: Bangkok, Thailand
Contact:

Post by semicolon »

Hello,

I thank you everyone for all of the suggestions. Especially, Ahmedali. He helped me fixed the animation and this is 99% perfect as the animation rotate in complete cycle. I have compared the .skeleton files of the before and after the fixes. The rotation information was really wrong. I just figured out some method to animate the cycle. I will create the 5 keyframes from 3DSMAX and copy the keyframes information to replace them. By the way I don't know whether or not this would work. Just wanted some experts to confirm it.

Really thank you for all of the help.
Semicolon

P.S. I am using 3DSMAX as primary 3D tools. Any more suggestions are more than welcome.
"Nature is the mother of learning"
User avatar
ahmedali
Gnome
Posts: 302
Joined: Fri Feb 20, 2004 8:52 pm
Location: Lahore, Pakistan

Post by ahmedali »

That was a stupid mistake :oops:

then this should give the same results
0 90 180 270 0
and
0 90 180 270 360

right ?
Post Reply