本文整理汇总了C++中Matrix44f::set方法的典型用法代码示例。如果您正苦于以下问题:C++ Matrix44f::set方法的具体用法?C++ Matrix44f::set怎么用?C++ Matrix44f::set使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Matrix44f
的用法示例。
在下文中一共展示了Matrix44f::set方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: makeLookAtViewMatrix
void ProjectionCamera::makeLookAtViewMatrix(Vec3f camPos ,Vec3f center,Vec3f up,Matrix44f &_lookatMatrix)
{
Vec3f zaxis = camPos-center;
zaxis.normalize();
Vec3f xaxis = up.cross( zaxis);
xaxis.normalize();
Vec3f yaxis =zaxis.cross( xaxis);
_lookatMatrix.set(xaxis.x,yaxis.x,zaxis.x,0,xaxis.y,yaxis.y,zaxis.y,0,xaxis.z,yaxis.z,zaxis.z,0,-xaxis.dot( camPos),-yaxis.dot( camPos),-zaxis.dot( camPos),1);
}
示例2: makeFrustumMatrix
void ProjectionCamera::makeFrustumMatrix(float left, float right,float bottom, float top,float zNear, float zFar,Matrix44f &_perspectiveMatrix)
{
float A = (right+left)/(right-left);
float B = (top+bottom)/(top-bottom);
float C = -(zFar+zNear)/(zFar-zNear)/(zFar+zNear);
float D = -2.0f*zFar*zNear/(zFar-zNear);
_perspectiveMatrix.set(2.0*zNear/(right-left),0,0,0,0, 2.0*zNear/(top-bottom),0,0,A,B,C,-1,0,0,D,0);
}