Jump to content


- - - - -

Errors with my geometric transformation


3 replies to this topic

#1 C++Learner

    New Member

  • Members
  • PipPip
  • 15 posts

Posted 30 December 2010 - 01:24 AM

I am trying to perform a TRT matrix transform of my object.

Here's what I have at the moment.

VOID D3DObject::setWorldMatrix()
{
      m_matWorld = (*D3DXMatrixTranslation( &D3DXMatrix(), 1.0, 0.0, 0.0f))*
      (*D3DXMatrixRotationX(&D3DXToRadian,(-120.0f)) )*
      (*D3DXMatrixTranslation(&D3DXMatrix(), 0.12, 0.3, 0.1f));
}

D3DXMATRIXA16 D3DObject::getWorldMat()
{
	return m_matWorld;
}

However, it's not working because of an undeclared identifier for D3DXToRadian, and two unknown identifer mentions for the D3DXMatrix.

Anyone have a solution for this?

#2 Reedbeta

    DevMaster Staff

  • Administrators
  • 5311 posts
  • LocationSanta Clara, CA

Posted 30 December 2010 - 06:42 AM

First of all, please use [code]...[/code] when posting code on the forum.

As for your question, you need to #include the appropriate header file to get those declarations. Looking at MSDN, it appears to be D3dx9math.h.
reedbeta.com - developer blog, OpenGL demos, and other projects

#3 C++Learner

    New Member

  • Members
  • PipPip
  • 15 posts

Posted 05 January 2011 - 12:47 AM

Tried what you mentioned, but it still has the same problems.

#4 C++Learner

    New Member

  • Members
  • PipPip
  • 15 posts

Posted 05 January 2011 - 04:03 AM

problem seems to be solved.

instead of using &D3DXMatrix I replaced it with m_matWorld and seems to be working without errors now.

hope this helps anyone else who has this problem.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users