カメラ3
ピボットも追加。
回転の中心を原点に移動すること。
povit(ピボット):注視点の上方向を軸にカメラ位置を回転
XMVECTOR eye = m_pCamera->getPosition(); XMVECTOR up = m_pCamera->getUp(); XMVECTOR at = m_pCamera->getLookAt(); XMVECTOR pos = eye - at; XMVECTOR dir = XMVector3Normalize(-pos); XMVECTOR right = XMVector3Cross(up, dir); up = XMVector3Normalize(XMVector3Cross(dir, right)); XMVECTOR rot = XMQuaternionRotationAxis(up,angle); eye = XMVector3Rotate( pos, rot ) + at; m_pCamera->setLookAtLH( eye, at, up );