当前位置: 首页>>代码示例>>C#>>正文


C# Matrix4.Transpose方法代码示例

本文整理汇总了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 );
		}
开发者ID:mono-soc-2011,项目名称:axiom,代码行数:30,代码来源:GpuProgramParameters.cs

示例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 );
			}
		}
开发者ID:ryan-bunker,项目名称:axiom3d,代码行数:16,代码来源:GpuProgramParameters.cs

示例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
		}
开发者ID:ryan-bunker,项目名称:axiom3d,代码行数:28,代码来源:XnaRenderSystem.cs

示例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 );
		}
开发者ID:ryan-bunker,项目名称:axiom3d,代码行数:16,代码来源:GpuProgramParameters.cs

示例5: MakeGLMatrix

		private void MakeGLMatrix( ref Matrix4 matrix, float[] floats )
		{
			var mat = matrix.Transpose();
			mat.MakeFloatArray( floats );
		}
开发者ID:mono-soc-2011,项目名称:axiom,代码行数:5,代码来源:GLRenderSystem.cs


注:本文中的Axiom.Math.Matrix4.Transpose方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。