Jump to content
  • Advertisement
Sign in to follow this  
makingroulette

alias maya .X file exporter

This topic is 4970 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

i am currently using alias maya version 6 to create a model of a roulette wheel would you believe. But i am unable to export it in the .X file format so that it can be read into a DirectX application. Does anyone know where I get hold of one? I had heard that one was included in recent updates to the directX software development kit, ive downloaded recent updates from october 2004 onwards and could not find it. I will be very greatful for your help

Share this post


Link to post
Share on other sites
Advertisement

What you are looking for is in the 'extra' part of the SDK;
Specifically: "\Direct3D\Plug-Ins\Maya version 4.0 and 5.0\" (with summer 2003 sdk extras anyway)

Main DL page: http://msdn.microsoft.com/library/default.asp?url=/downloads/list/directx.asp

Extras DL page: http://www.microsoft.com/downloads/details.aspx?FamilyId=8AF0AFA9-1383-44B4-BC8B-7D6315212323&displaylang=en




You may find the following usefull to actually compile:

http://www.gamedev.net/community/forums/topic.asp?topic_id=253944&whichpage=1�


/**
* --------------------------------------------
* DHCBlueBerry Member since: 6/30/2004 From: Japan
* Posted - 6/30/2004 6:11:35 AM
* Maya6.0 xExport.
* here is replacement code for DtMatrixGetTransforms() call that is not
* supported in Maya6.0 any more. you could replace those calls with this and
* remove old DtMatrixGetTransforms(). it'll happily compile with vs2003.
* libMDtAPI.lib does not need to be linked.
*
--------------------------------------------
*/


int MyMatrixGetTransforms( float *pmatrix , float *translate , float *scale , float *quaternion , float *rotation )
{
float matrix[ 4 ][ 4 ];
for ( int i = 0 ; i < 16 ; ++i )
{
*( &matrix[ 0 ][ 0 ] + i ) = *( &pmatrix[ 0 ] + i );
}

MVector t;
double d_scale[ 3 ];
double d_quat[ 4 ];
double euler[ 3 ];
MStatus result;

MMatrix mmatrix( matrix );

MTransformationMatrix mtmatrix( mmatrix );
if ( mtmatrix.getScale( d_scale , MSpace::Space::kTransform) != MS::kSuccess )
{
return 0;
}

t = mtmatrix.translation( MSpace::Space::kTransform , &result );
if ( result != MS::kSuccess )
{
return 0;
}

if ( mtmatrix.getRotationQuaternion( d_quat[ 0 ] , d_quat[ 1 ] , d_quat[ 2 ] , d_quat[ 3 ] , MSpace::Space::kTransform ) != MS::kSuccess )
{
return 0;
}

MTransformationMatrix::RotationOrder rotation_order = MTransformationMatrix::RotationOrder::kLast;
if ( mtmatrix.getRotation( euler , rotation_order ) != MS::kSuccess )
{
return 0;
}

translate[ 0 ] = static_cast< float >( t.x );
translate[ 1 ] = static_cast< float >( t.y );
translate[ 2 ] = static_cast< float >( t.z );
scale[ 0 ] = static_cast< float >( d_scale[ 0 ] );
scale[ 1 ] = static_cast< float >( d_scale[ 1 ] );
scale[ 2 ] = static_cast< float >( d_scale[ 2 ] );
quaternion[ 0 ] = static_cast< float >( d_quat[ 3 ] );
quaternion[ 1 ] = static_cast< float >( d_quat[ 0 ] );
quaternion[ 2 ] = static_cast< float >( d_quat[ 1 ] );
quaternion[ 3 ] = static_cast< float >( d_quat[ 2 ] );
rotation[ 0 ] = static_cast< float >( euler[ 0 ] );
rotation[ 1 ] = static_cast< float >( euler[ 1 ] );
rotation[ 2 ] = static_cast< float >( euler[ 2 ] );

return 1;
}




Worked like a charm for me; with "Microsoft DirectX 9.0 SDK Update (Summer 2003)" and Maya 6 Complete


HTH

Share this post


Link to post
Share on other sites
Correction, with Microsoft DirectX 9.0 SDK (February 2005)

Search the (C++) help for: "Effect File Exporter for Alias Maya"

Default location is: C:\Program Files\Microsoft DirectX 9.0 SDK (February 2005)\Utilities\Source\Maya

Nothing to do with the extras DL this release it seems, which is nice.

I've yet to try it fwiw.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!