Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.
Posted 15 December 2012 - 05:20 PM
Posted 15 December 2012 - 07:13 PM
Posted 15 December 2012 - 11:53 PM
Posted 16 December 2012 - 02:55 AM
Wrong.[source lang="jscript"][sx 0 0 0][0 sy 0 0][0 0 sz 0][0 0 0 1][/source]
[sx sx sx 0] [sy sy sy 0] [sz sz sz 0] [0 0 0 1]
Edited by L. Spiro, 16 December 2012 - 02:59 AM.
Posted 16 December 2012 - 10:24 AM
Posted 16 December 2012 - 12:26 PM
Posted 16 December 2012 - 06:54 PM
It isn’t supposed to be a matrix. I will explain below.[sx sx sx 0] [sy sy sy 0] [sz sz sz 0] [0 0 0 1]
What!? What is that matrix supposed to do?
Let’s say you already have your original matrix in the form of:@L.Spiro
I tried your matrix but this resulted in the terms canceling each other out so that scale values had no effect. Perhaps if you could explain what that matrix should do in a bit more detail?
[R R R 0] [R R R 0] [R R R 0] [tx ty tz 1](Notice the scaling term S has been removed).
[R*sx R*sx R*sx 0] [R*sy R*sy R*sy 0] [R*sz R*sz R*sz 0] [tx ty tz 1]
/** * Build a matrix from our data. * * \param _mRet Holds the created matrix. */ LSVOID LSE_FCALL COrientation::BuildMatrix( CMatrix4x4 &_mRet ) const { _mRet._11 = m_vRight.x * m_vScale.x; _mRet._12 = m_vRight.y * m_vScale.x; _mRet._13 = m_vRight.z * m_vScale.x; _mRet._14 = 0.0f; _mRet._21 = m_vUp.x * m_vScale.y; _mRet._22 = m_vUp.y * m_vScale.y; _mRet._23 = m_vUp.z * m_vScale.y; _mRet._24 = 0.0f; _mRet._31 = m_vForward.x * m_vScale.z; _mRet._32 = m_vForward.y * m_vScale.z; _mRet._33 = m_vForward.z * m_vScale.z; _mRet._34 = 0.0f; _mRet._41 = m_vPos.x; _mRet._42 = m_vPos.y; _mRet._43 = m_vPos.z; _mRet._44 = 1.0f; }I construct the matrix directly instead of using any matrix math. This is much more efficient. The forward, up, right, scale, and position components are all 3D vectors. Notice that the scaling terms are multiplied all the way across each row rather than just along the diagonal.
Edited by L. Spiro, 16 December 2012 - 06:59 PM.
Posted 16 December 2012 - 07:13 PM
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.
GameDev.net™, the GameDev.net logo, and GDNet™ are trademarks of GameDev.net, LLC.