Ogre Mesh and Skeletons

Everything related to 3D programming
Thade
Enthusiast
Enthusiast
Posts: 266
Joined: Sun Aug 03, 2003 12:06 am
Location: Austria

Ogre Mesh and Skeletons

Post by Thade »

Hi (its very quiet here in 3D Programming - no-one interested in 3d?)

Well - my topic is hopefully not sort of demotivation

I have 100s of Models (bought from companies which specialiced on Models for Games)
They come in different versions - 3ds, fbx, x, b3d, iAvatar, dae, blend, ugh, etc ... but not as mesh and skeleton ... I have them all converted to .ugh (Fragmotion) .b3d (Blitz, Nuclear Basic & Fusion) and .x (Directx) ...
Ok, no problem - there are several exporters for Ogre - I use Fragmotion and Milkshape.
Anyway - conversion from any mentioned to others work excellent, once you know which setting you have to use.
My x b3d n3d animations run in every engine I have used - lately 3DRad, Nuclear Basic, Nuclear Fusion, Blitz3D, etc.

Since the PB Beta is out I am quite busy with it making tests and of course are trying to convert models to ogre mesh and skeleton.

Long talk - short result - the Animations do not work controlled.
The animations run actualy normal and as they should. But the positions are freaky. They jump or move up and down and there are no settings in the exporters to control that.
Some Animations let the model sink under the terrain and come back in a curve. Some Animations run 12 Frames normal - then a jump 10 meters in the air and the rest is normal at the ground again.

I see one problem that the exporters are all from 2007 - 2009 - and different exporters produce different animation behaviours ...

I think that is a Problem, I need some help to solve it.

Has anybody expienced the same? Are there newer Exporters than the ones I found so far? Is there experimental PB-Code available which lets you control the skeleton while loading?

Or even better: Is there a working x-loader which converts the model while loading to a working mesh with animations?

Thanks a lot.
--------------
Yes, its an Irish Wolfhound.
Height: 107 cm; Weight: 88 kg
Fred
Administrator
Administrator
Posts: 18154
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: Ogre Mesh and Skeletons

Post by Fred »

I have built OgreASSIMPConverter (http://www.ogre3d.org/tikiwiki/OgreAssi ... ture=Tools) commandline tool for Ogre 1.8, it will accept in input all formats supported by assimp (see here: http://assimp.sourceforge.net/main_feat ... rmats.html) and output a .mesh with .material and .sekeleton. May be it will work better for you ?

The last version of assimp has been used, and Ogre SDK 1.8.1. I tested with a 3DS model and it loaded correctly in PB.

http://www.purebasic.com/download/OgreA ... verter.zip (Windows only, requiers the VC++2010 runtime)

Have fun !
User avatar
Comtois
Addict
Addict
Posts: 1431
Joined: Tue Aug 19, 2003 11:36 am
Location: Doubs - France

Re: Ogre Mesh and Skeletons

Post by Comtois »

Fred , your archiv is empty.
Please correct my english
http://purebasic.developpez.com/
User avatar
luis
Addict
Addict
Posts: 3893
Joined: Wed Aug 31, 2005 11:09 pm
Location: Italy

Re: Ogre Mesh and Skeletons

Post by luis »

Comtois wrote:Fred , your archiv is empty.
Nope, it works.
"Have you tried turning it off and on again ?"
A little PureBasic review
User avatar
Comtois
Addict
Addict
Posts: 1431
Joined: Tue Aug 19, 2003 11:36 am
Location: Doubs - France

Re: Ogre Mesh and Skeletons

Post by Comtois »

luis wrote:
Comtois wrote:Fred , your archiv is empty.
Nope, it works.
Now, yes :P
Please correct my english
http://purebasic.developpez.com/
applePi
Addict
Addict
Posts: 1404
Joined: Sun Jun 25, 2006 7:28 pm

Re: Ogre Mesh and Skeletons

Post by applePi »

Thade write: (its very quiet here in 3D Programming - no-one interested in 3d?)
everyone are interested in 3D because they are 3D's but it is a complex subject with unlimited issues.
some philosophy:
the people like the software which have a 3D capabilities even if they will use it rarely, the 3D resembles a soul in the body, we don't know how to use the soul in practice but we want it to be inside us because it refers to the implicit capabilities and to the mystery. the same thing with the programming language.
Polo
Addict
Addict
Posts: 2422
Joined: Tue May 06, 2003 5:07 pm
Location: UK

Re: Ogre Mesh and Skeletons

Post by Polo »

Fred wrote:I have built OgreASSIMPConverter (http://www.ogre3d.org/tikiwiki/OgreAssi ... ture=Tools) commandline tool for Ogre 1.8, it will accept in input all formats supported by assimp (see here: http://assimp.sourceforge.net/main_feat ... rmats.html) and output a .mesh with .material and .sekeleton. May be it will work better for you ?

The last version of assimp has been used, and Ogre SDK 1.8.1. I tested with a 3DS model and it loaded correctly in PB.

http://www.purebasic.com/download/OgreA ... verter.zip (Windows only, requiers the VC++2010 runtime)

Have fun !
Haven't tried yet, but this sounds pretty cool (considering most major formats are supported). Making it part of the PB package in the IDE (Tools / 3D Mesh converter) would be quite nice, within a few clicks meshes would be converted while working on projects ;)
Fred
Administrator
Administrator
Posts: 18154
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: Ogre Mesh and Skeletons

Post by Fred »

User tools are here for that :). I will put a mention in the mesh doc so it can be found more easily.
Thade
Enthusiast
Enthusiast
Posts: 266
Joined: Sun Aug 03, 2003 12:06 am
Location: Austria

Re: Ogre Mesh and Skeletons

Post by Thade »

@Fred
Thanks - I will check it all out - and it seems I will have a lot to do during the next days :D
--------------
Yes, its an Irish Wolfhound.
Height: 107 cm; Weight: 88 kg
User avatar
J. Baker
Addict
Addict
Posts: 2181
Joined: Sun Apr 27, 2003 8:12 am
Location: USA
Contact:

Re: Ogre Mesh and Skeletons

Post by J. Baker »

OgreASSIMPConverter didn't do well for me. Obj don't convert and crash OgreASSIMPConverter. 3ds files do convert but return an error in PB. Unable to initialize the mesh, or something like that.

As for other methods. Milkshape3D works but textures are messed up. Don't care much for Blender. CharacterFX works with the following lua script but haven't tried it with animation yet. https://gist.github.com/675553
www.posemotion.com

PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef


Even the vine knows it surroundings but the man with eyes does not.
Fred
Administrator
Administrator
Posts: 18154
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: Ogre Mesh and Skeletons

Post by Fred »

Could you send me the files which doesn't work ?
User avatar
J. Baker
Addict
Addict
Posts: 2181
Joined: Sun Apr 27, 2003 8:12 am
Location: USA
Contact:

Re: Ogre Mesh and Skeletons

Post by J. Baker »

Fred wrote:Could you send me the files which doesn't work ?
PM sent. ;)
www.posemotion.com

PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef


Even the vine knows it surroundings but the man with eyes does not.
Thade
Enthusiast
Enthusiast
Posts: 266
Joined: Sun Aug 03, 2003 12:06 am
Location: Austria

Re: Ogre Mesh and Skeletons

Post by Thade »

I managed to change the Ogre Skeleton xml with a little code snippet to work without jumping ...

For instance:

Code: Select all

				<track bone="Bip01_L_Hand" >
					<keyframes>
						<keyframe time="0" >
							<translate x="-3.3891e-006" y="1.50758e-005" z="1.91279e-006" />
							<rotate angle="0" >
								<axis x="0" y="0" z="-1" />
							</rotate>
							<scale x="1" y="1" z="1" />
						</keyframe>
						<keyframe time="0.0430556" >
							<translate x="-7.2038e-006" y="7.58421e-008" z="2.91278e-006" />
							<rotate angle="0.0560883" >
								<axis x="-7.16006e-006" y="-0.00078479" z="1" />
							</rotate>
							<scale x="1" y="1" z="1" />
						</keyframe>
						<keyframe time="0.0861111" >
							<translate x="-3.3891e-006" y="1.50758e-005" z="1.91279e-006" />
							<rotate angle="0.120076" >
								<axis x="-1.00143e-005" y="-0.000791681" z="1" />
							</rotate>
							<scale x="1" y="1" z="1" />
						</keyframe>
						<keyframe time="0.129167" >
							<translate x="-3.3891e-006" y="7.58401e-008" z="-2.08722e-006" />
							<rotate angle="0.187223" >
								<axis x="-3.49006e-006" y="-0.000795521" z="1" />
							</rotate>
							<scale x="1" y="1" z="1" />
						</keyframe>
						<keyframe time="0.172222" >
							<translate x="4.2403e-006" y="8.07584e-006" z="-8.72146e-008" />
							<rotate angle="0.252792" >
								<axis x="-3.26011e-006" y="-0.00079292" z="1" />
							</rotate>
							<scale x="1" y="1" z="1" />
						</keyframe>
						<keyframe time="0.215278" >
							<translate x="8.05499e-006" y="7.58397e-008" z="-8.72148e-008" />
							<rotate angle="0.312039" >
								<axis x="-3.21058e-006" y="-0.000796826" z="1" />
							</rotate>
							<scale x="1" y="1" z="1" />
						</keyframe>
had to be changed to:

Code: Select all

				<track bone="Bip01_L_Hand" >
					<keyframes>
						<keyframe time="0" >
							<translate x="-3.3891e-006" y="1.50758e-005" z="1.91279e-006" />
							<rotate angle="0" >
								<axis x="0" y="0" z="-1" />
							</rotate>
							<scale x="1" y="1" z="1" />
						</keyframe>
						<keyframe time="0.0430556" >
							<translate x="-3.3891e-006" y="1.50758e-005" z="1.91279e-006" />
							<rotate angle="0.0560883" >
								<axis x="-7.16006e-006" y="-0.00078479" z="1" />
							</rotate>
							<scale x="1" y="1" z="1" />
						</keyframe>
						<keyframe time="0.0861111" >
							<translate x="-3.3891e-006" y="1.50758e-005" z="1.91279e-006" />
							<rotate angle="0.120076" >
								<axis x="-1.00143e-005" y="-0.000791681" z="1" />
							</rotate>
							<scale x="1" y="1" z="1" />
						</keyframe>
						<keyframe time="0.129167" >
							<translate x="-3.3891e-006" y="1.50758e-005" z="1.91279e-006" />
							<rotate angle="0.187223" >
								<axis x="-3.49006e-006" y="-0.000795521" z="1" />
							</rotate>
							<scale x="1" y="1" z="1" />
						</keyframe>
						<keyframe time="0.172222" >
							<translate x="-3.3891e-006" y="1.50758e-005" z="1.91279e-006" />
							<rotate angle="0.252792" >
								<axis x="-3.26011e-006" y="-0.00079292" z="1" />
							</rotate>
							<scale x="1" y="1" z="1" />
						</keyframe>
						<keyframe time="0.215278" >
							<translate x="-3.3891e-006" y="1.50758e-005" z="1.91279e-006" />
							<rotate angle="0.312039" >
								<axis x="-3.21058e-006" y="-0.000796826" z="1" />
							</rotate>
							<scale x="1" y="1" z="1" />
						</keyframe>
In each animation the translation for each bone had to be set to the first value

It works fine - besides one thing which has to be corrected: The Model flies 2 meters above the ground - although the root is set to 0,0,0 and EntityLocate too

Edit:
The actual solution works obviously only if the bones are only rotated - not translated and/or scaled
--------------
Yes, its an Irish Wolfhound.
Height: 107 cm; Weight: 88 kg
Fred
Administrator
Administrator
Posts: 18154
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: Ogre Mesh and Skeletons

Post by Fred »

J. Baker wrote:
Fred wrote:Could you send me the files which doesn't work ?
PM sent. ;)
I have fixed the crash, and it does convert correctly (except the material file, you have to create a material from you .bmp file and it does work). The new converter is online.
Thade
Enthusiast
Enthusiast
Posts: 266
Joined: Sun Aug 03, 2003 12:06 am
Location: Austria

Re: Ogre Mesh and Skeletons

Post by Thade »

Fred wrote:The new converter is online.
Where can I download it? ---- Found it!
Last edited by Thade on Wed Sep 19, 2012 12:25 am, edited 2 times in total.
--------------
Yes, its an Irish Wolfhound.
Height: 107 cm; Weight: 88 kg
Post Reply