本文整理汇总了C++中Matrix4x4::GetDataPtr方法的典型用法代码示例。如果您正苦于以下问题:C++ Matrix4x4::GetDataPtr方法的具体用法?C++ Matrix4x4::GetDataPtr怎么用?C++ Matrix4x4::GetDataPtr使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Matrix4x4
的用法示例。
在下文中一共展示了Matrix4x4::GetDataPtr方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: InverseLookAtMatrix
void Camera::InverseLookAtMatrix( void )
{
Vector rotVec = at-eye;
rotVec = ( ball ? ball->ApplyTrackballMatrix( rotVec ) : rotVec );
Point finalPos = ( eyeMove ? eyeMove->ApplyCurrentFrameMovementMatrix( at-rotVec ) : at-rotVec );
Matrix4x4 m = Matrix4x4::LookAt( finalPos, at, up ).Invert();
glMultMatrixf( m.GetDataPtr() );
}
示例2: LightLookAtInverseMatrix
// This multiplies onto the current matrix stack an inverse look-at matrix
// (equivalent to Invert( gluLookAt() ) -- if such an operation were possible)
void Scene::LightLookAtInverseMatrix( int i )
{
Point lightPos( light[i]->GetCurrentPos() );
Vector view = camera->GetAt()-lightPos;
view.Normalize();
Vector perp = abs( view.Dot( Vector::YAxis() ) ) < 0.95 ? view.Cross( Vector::YAxis() ) : view.Cross( Vector::XAxis() );
perp.Normalize();
Vector up = perp.Cross( view );
Matrix4x4 mat = Matrix4x4::LookAt( lightPos, camera->GetAt(), up ).Invert();
glMultMatrixf( mat.GetDataPtr() );
}
示例3: InverseLookAtMatrix
void Camera::InverseLookAtMatrix( void )
{
Matrix4x4 m;
if (ball)
{
Vector rotVec = ball->ApplyTrackballMatrix( at-eye );
m = Matrix4x4::LookAt( at-rotVec, at, up ).Invert();
}
else
m = Matrix4x4::LookAt( eye, at, up ).Invert();
glMultMatrixf( m.GetDataPtr() );
}
示例4: LightPerspectiveInverseMatrix
void Scene::LightPerspectiveInverseMatrix( int i, float aspect )
{
Matrix4x4 mat = Matrix4x4::Perspective( light[i]->GetLightFovy(), aspect,
light[i]->GetLightNearPlane(), light[i]->GetLightFarPlane() ).Invert();
glMultMatrixf( mat.GetDataPtr() );
}