Page 1 of 1

3DS Max and Ogre Coordinates system

Posted: Thu Sep 15, 2005 3:29 pm
by manowar
Hello

I posted once about some missing features in Ogre 3DS Max exporters, especially keyframes animations (no bones). Instead of waiting for this feature to be implemented by someone, I started to look at that myself and see if I can do what I need. I am really new to 3DS Max and maxscript (I am a C++ programmer).

I am trying at the moment to export simple keyframes animations from 3DS Max and I am struggling a bit with coordinates systems. I have a single object (no hierarchy) and I am simply trying to export the keyframes transformations (rotation,translation and scaling) using maxscript.

I understand that the coordinates systems are different .
It is where I need your help.What is the transformation to apply from the quaternion returned from max to be able to use it in Ogre ? At the moment I am just swapping Y and Z, but I guess it is more complex than that for rotations. Some animation seems to work, some not (rotation is wrong). If someone could give me the right transformations to apply or some code example in maxscript, it would be great.

Thanks a lot for your help.


PS.
Hey Lioric if you read by chance this thread is that feature planned in your exporter ? I can tell you that in the company we are all waiting for your exporter ! Videos previews are so impressive ! We cannot wait ! :wink:

Posted: Thu Sep 15, 2005 5:08 pm
by jacmoe
Take a look at OgreSkeletonLib_usefulfns.ms in ogrenew\Tools\3dsmaxExport\scripts\ogre\lib :wink:

Code: Select all

--------------------------------------------------------------------
-- compute the transform, if you want to flip Y and Z axis,
-- because the axis which 'defines height' in OGRE is the Y axis,
-- whereas 3dsmax uses the Z one.
--------------------------------------------------------------------
function flipYZTransform Tform = (
	local axis1,axis2,axis3,t,m
	
	-- computes the matrix
	axis1 = point3 1 0 0 ;
	axis2 = point3 0 0 1 ;
	axis3 = point3 0 -1 0 ;
	t = point3 0 0 0 ;
	m=matrix3 axis1 axis2 axis3 t ;
	
	-- multiplies by the inverse
	Tform = Tform*inverse(m) ;

	return Tform ;
)

Posted: Thu Sep 15, 2005 5:30 pm
by Lioric
This feature is already implemented, along with cameras, lights, and their animations too

We are currently testing it

I will announce the new features probbly today

Lioric

Posted: Thu Sep 15, 2005 6:00 pm
by manowar
That was quick ! Thanks a lot guys. This forum is great ! Hey Lioric...do you sleep sometimes ? Your work seems amazing...I guess I will not sleep tonight myself...dreaming of the exporter... :wink:

We are currently working on a commercial project using ogre. I can tell you that your exporter would be really useful. At the moment it is really a mess to switch from Octopus and the '3DS exporter'... and exporting maxscript data into ascii files... I hope the magic exporter will be ready soon !

Thanks again

Posted: Thu Sep 15, 2005 10:12 pm
by Lioric
Yes i sleep on a regular basis (every night) :)

The exporter is coming at a fast pace thanks to a talented group of beta testers
The object, camera and lights animation part is thanks to Lasse (Channex), he is doing an excellent job

Lioric