Model Help

Hi.

I've created a model, and an Animated model (same object)
and I have successfully improted it to my cpp file. It's now rendered in a 3d-space and looks like an astroid.

But I want to be able to change the size of it (using directX) how is this done

Also: how do I use my animated model when I control the object (etc: walking animation while moving forward)

thx in advance


Answer this question

Model Help

  • Jeff Gebhart

     CruS wrote:
    But I want to be able to change the size of it (using directX) how is this done

    You need to use the world matrix to apply some scaling. All geometry that is rendered using the fixed function pipeline (the exception is when you're using vertex shaders) should be transformed by the world matrix (IDirect3DDevice9::SetTransform( D3DTS_WORLD, &your_matrix_here );) to allow things such as rotation/translation/scaling.


    D3DXMATRIX matWorld
    D3DXMatrixScaling( &matWorld, 2.0f, 2.0f, 2.0f );
    pd3dDevice->SetTransform( D3DTS_WORLD, &matWorld );
    // Geometry rendered after this point will be scaled by 2x

     


    More complex transformations are possible - look at the D3DXMatrix..() functions in the SDK help files.

     CruS wrote:
    how do I use my animated model when I control the object (etc: walking animation while moving forward)

    There's a sample in the SDK showing how to use animation - I suggest you have a look through that. Unfortunately I've not used D3DX animation in a long while - I'm a bit rusty Smile

    hth
    Jack

  • Model Help