Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.



This topic is 5865 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

hi all; i am trying to my transformation function to work the way i want it. basicly i have a node that has matrixes for world trans and a float for scale. when the children want to update there transformations the take in to account their parents. i am trying to combine the parents and child rotations then trans then scale but seperately.does any one know what i am doing wrong in this function.

class CCyFrame : public CCyObject

// Variables

    CCyNode* m_pParentNode; 

// Functions

	// Update the position of this objects

	void UpdateGS(); 
	virtual void UpdateWD();	
	//Render the objects

	 void OnRender(CDXRender& rRenderer); 
	 virtual void Draw(CDXRender& rRenderer) = 0;
	// set parent		

    inline void SetParent (CCyNode* pCyParent){m_pParentNode = pCyParent;}

	     friend class CDXRender;
	     friend class CCyNode;
	     //Local & World Transform

	     D3DXMATRIX m_LRMatrix;
             D3DXMATRIX m_WRMatrix;
             D3DXMATRIX  m_LTrans;
             D3DXMATRIX  m_WTrans;
	     float m_LScale;
	     float m_WScale;

void CCyFrame::UpdateWD()

 if (m_pParentNode)
m_WScale  =  m_pParentNode->m_WScale * m_LScale;	
DXMatrixMultiply(&m_WRMatrix, &m_pParentNode->m_WRMatrix, &m_LRMatrix ); 

m_WRMatrix = m_LRMatrix; 
m_WTrans   = m_LTrans;
m_WScale   = m_LScale;


Share this post

Link to post
Share on other sites

  • 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!