Exporting from pandasoft and 3ds max

Started by
15 comments, last by lucky6969b 11 years, 2 months ago

I'd like to export a mesh to direct3d.

I have, in max, rotated 90 degrees in the x-axis

and -180 degrees in the z-axis

so that the mesh's bottom, in the front view, is facing me. And the "front" of the mesh is pointing upward. It is exported as a left-handed coordinate system, while 3ds max is right-handed

The mesh is displayed correctly.

In my engine, I set the pos to D3DXVECTOR3(10,0,10);

However there is a problem, the mesh has been raised up to about 10 units so that I have to offset it downward to reach the ground level. It seems like some axis is wrong.

Does anyone have some instructions on how to export stuff from max by pandasoft to direct3d?

Thanks

Jack

Advertisement

After you done all transformations in MAX you must apply "Reset X form"

maxexp.jpg

and then export.

Having selected the object, the reset selected button remained dimmed

If you have multiple objects grouped, un-group them and then reset.

The model is seriously distorted.

It seems like every part was reset to 0,0,0

I don't know how to help you further. If i have model composed of different parts i usually just work on each separately and have no problems with that.

Only that i know for sure is that "Reset X Form" is necessary after all transformations, otherwise it will not export correctly.

Hi there. It sounds like the world of the grouped mesh is not located on the centre of the 3dsmax's world.

Thanks ankhd,

It is like what you said. Here comes another problem.

When I set the object to D3DXVECTOR3(0,0,10) and transform it when I want to draw it.

I still get the Z axis pointing upward. Like this


const D3DXMATRIX& GetWorldMatrix()
    {
        
        D3DXMATRIX mat;
        
        if(rot.x != 0.0f || rot.y != 0.0f || rot.z != 0.0f)
        {
            D3DXQuaternionRotationYawPitchRoll(&quatRot, rot.x, rot.y, rot.z);
            D3DXMatrixTransformation(&mat, &scaleCenter, NULL, &scale,
                &rotCenter, &quatRot, &pos);
        }
        else
        {
            D3DXMatrixTransformation(&mat, &scaleCenter, NULL, &scale,
            NULL, NULL, &pos);
        }
        return mat;

     }

You have a bug in your code, returning reference to a local var witch is destroyed after return!

The debugger shows the correct matrix however... strange no?

This topic is closed to new replies.

Advertisement