本文整理汇总了C#中Axiom.Math.Matrix4.Transpose方法的典型用法代码示例。如果您正苦于以下问题:C# Matrix4.Transpose方法的具体用法?C# Matrix4.Transpose怎么用?C# Matrix4.Transpose使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Axiom.Math.Matrix4
的用法示例。
在下文中一共展示了Matrix4.Transpose方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetConstant
/// <summary>
/// Sends a multiple value constant floating-point parameter to the program.
/// </summary>
/// <remarks>
/// This method is made virtual to allow GpuProgramManagers, or even individual
/// GpuProgram implementations to supply their own implementation if need be.
/// An example would be where a Matrix needs to be transposed to row-major format
/// before passing to the hardware.
/// </remarks>
/// <param name="index">Index of the contant register.</param>
/// <param name="val">Structure containing 3 packed float values.</param>
public void SetConstant( int index, Matrix4 val )
{
Matrix4 mat;
// transpose the matrix if need be
if ( transposeMatrices )
{
mat = val.Transpose();
}
else
{
mat = val;
}
SetConstant( index++, mat.m00, mat.m01, mat.m02, mat.m03 );
SetConstant( index++, mat.m10, mat.m11, mat.m12, mat.m13 );
SetConstant( index++, mat.m20, mat.m21, mat.m22, mat.m23 );
SetConstant( index, mat.m30, mat.m31, mat.m32, mat.m33 );
}
示例2: WriteRawConstant
public void WriteRawConstant( int physicalIndex, Matrix4 m, int elementCount )
{
var arr = new float[16];
// remember, raw content access uses raw float count rather than float4
if ( TransposeMatrices )
{
var t = m.Transpose();
t.MakeFloatArray( arr );
_writeRawConstants( physicalIndex, arr, elementCount > 16 ? 16 : elementCount );
}
else
{
m.MakeFloatArray( arr );
_writeRawConstants( physicalIndex, arr, elementCount > 16 ? 16 : elementCount );
}
}
示例3: SetTextureMatrix
/// <summary>
/// Sets the texture matrix for the specified stage. Used to apply rotations, translations,
/// and scaling to textures.
/// </summary>
public override void SetTextureMatrix(int stage, Matrix4 xform)
{
if (texStageDesc[stage].autoTexCoordType == TexCoordCalcMethod.ProjectiveTexture)
{
//seems like we have to apply a specific transform when we have the frustum
//and a projective texture
//from directx rendersystem
// Derive camera space to projector space transform
// To do this, we need to undo the camera view matrix, then
// apply the projector view & projection matrices
//Matrix4 newMat = _viewMatrix.Inverse();
//texStageDesc[ stage ].frustum.ViewMatrix = texStageDesc[ stage ].frustum.ViewMatrix.Transpose();
//texStageDesc[stage].frustum.ProjectionMatrix = texStageDesc[stage].frustum.ProjectionMatrix.Transpose();
//newMat = texStageDesc[ stage ].frustum.ViewMatrix * newMat;
//newMat = texStageDesc[ stage ].frustum.ProjectionMatrix * newMat;
//newMat = Matrix4.ClipSpace2DToImageSpace * newMat;
//xform = xform * newMat;
}
#if AXIOM_FF_EMULATION
_ffProgramParameters.SetTextureMatrix( stage, xform.Transpose() );
#endif
}
示例4: SetConstant
public void SetConstant( int index, Matrix4 mat )
{
var a = new float[16];
// set as 4x 4-element floats
if ( TransposeMatrices )
{
mat.Transpose().MakeFloatArray( a );
}
else
{
mat.MakeFloatArray( a );
}
SetConstant( index, a, 4 );
}
示例5: MakeGLMatrix
private void MakeGLMatrix( ref Matrix4 matrix, float[] floats )
{
var mat = matrix.Transpose();
mat.MakeFloatArray( floats );
}