Mat44f CDirectionalLight::GetLightViewMatrix()  const
{
  D3DXMATRIX l_LightViewMatrix;
  D3DXVECTOR3 l_Eye(m_Position.x, m_Position.y, m_Position.z), 
              l_LookAt(m_Position.x + m_Direction.x*10, m_Position.y + m_Direction.y*10, m_Position.z + m_Direction.z*10), 
							l_VUP(0.0f,1.0f,0.0f);
  D3DXMatrixLookAtLH( &l_LightViewMatrix, &l_Eye, &l_LookAt, &l_VUP);
  return Mat44f(l_LightViewMatrix);
}
Beispiel #2
0
void CCamera::CreateView()
{
    Vect3f eye = this->GetEye();
    D3DXVECTOR3 l_Eye = D3DXVECTOR3(eye.x, eye.y, eye.z);

    Vect3f lookat = this->GetLookAt();
    D3DXVECTOR3 l_LookAt(lookat.x, lookat.y, lookat.z);

    Vect3f vup = this->GetVecUp();
    D3DXVECTOR3 l_VUP(vup.x, vup.y, vup.z);

    //Setup Matrix view
	D3DXMatrixLookAtLH( &m_View, &l_Eye, &l_LookAt, &l_VUP);
}
///<summary>
/// CCamera:: GetMatrixView : Retorna la Matriz de Vision de la camara.
///</summary>
///<param name="void"></param>
///<returns name="D3DXMATRIX"></returns>
D3DXMATRIX CCamera::GetMatrixView()
{
  D3DXMATRIX l_matView;
  Vect3f eye = this->GetEye();
  Vect3f vup = this->GetVecUp();
  Vect3f lookat = this->GetLookAt();

  D3DXVECTOR3 l_Eye(eye.x, eye.y, eye.z);  
	D3DXVECTOR3 l_LookAt(lookat.x, lookat.y, lookat.z);
  D3DXVECTOR3 l_VUP(vup.x, vup.y, vup.z);
  //Setup Matrix view
  D3DXMatrixLookAtLH( &l_matView, &l_Eye, &l_LookAt, &l_VUP);
  
  return l_matView;
}