Sign in to follow this  

rotation and translation

This topic is 2060 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 attempting to translate and rotate a wireframe cube in dx9 and c++.I have done research on matrices and toymaker's site and some gamedev's old postings.I am able to get vs 2010 to compile my code but I get a link2019 error. Here is my error, I am pretty sure I have linked all the proper headers and libraries.
[font="Consolas"][size="1"][font="Consolas"][size="1"]>triangledx9.obj : error LNK2019: unresolved external symbol _D3DXMatrixMultiply@12 referenced in function "void __cdecl SetupMatrices(void)" (?SetupMatrices@@YAXXZ)[/size][/font][/size][/font]
[font="Consolas"][size="1"][font="Consolas"][size="1"]1>triangledx9.obj : error LNK2019: unresolved external symbol _D3DXMatrixRotationY@8 referenced in function "void __cdecl SetupMatrices(void)" (?SetupMatrices@@YAXXZ)[/size][/font][/size][/font]
[font="Consolas"][size="1"][font="Consolas"][size="1"]1>triangledx9.obj : error LNK2019: unresolved external symbol _D3DXMatrixTranslation@16 referenced in function "void __cdecl SetupMatrices(void)" (?SetupMatrices@@YAXXZ)[/size][/font][/size][/font]
[font="Consolas"][size="1"][font="Consolas"][size="1"]1>C:\Users\phil\Desktop\bgp_sources\vcnet2003\VCNET2003\chapter06\load_bitmap\triangledx9\Debug\triangledx9.exe : fatal error LNK1120: 3 unresolved externals[/size][/font][/size][/font]
here is the code I am having trouble with.
[code]
float x=10.0f,y=10.0f,z=5.0f,r=D3DX_PI/2.0;
void SetupMatrices()
{
D3DXMATRIX matWorld;
D3DXMATRIX matTemp;
D3DXMatrixTranslation( &matWorld, x, y, z );
D3DXMatrixRotationY( &matTemp, r );
D3DXMatrixMultiply( &matWorld, &matWorld, &matTemp );
D3DXMatrixTranslation( &matTemp, x, y, z );
D3DXMatrixMultiply( &matWorld, &matWorld, &matTemp );
d3ddev->SetTransform( D3DTS_WORLD, &matWorld );
}
[/code]
I will continue to work on this problem.

Share this post


Link to post
Share on other sites
Did you add d3dx9.lib to your linker inputs?

Share this post


Link to post
Share on other sites
The error message implies that you did not correctly add it.

The error message is that the linker is looking for functions, but cannot find them. The functions are in d3dx9.lib.

Share this post


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