本文整理汇总了C#中Transform.ToFloatArray方法的典型用法代码示例。如果您正苦于以下问题:C# Transform.ToFloatArray方法的具体用法?C# Transform.ToFloatArray怎么用?C# Transform.ToFloatArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Transform
的用法示例。
在下文中一共展示了Transform.ToFloatArray方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetupViewport
/// <summary>
/// Sets up and initializes the viewport by setting the Uniforms
/// </summary>
public void SetupViewport(ViewportInfo viewport)
{
Transform mv = new Transform();
bool haveModelView = false;
if (m_Uniforms.rglModelViewProjectionMatrix >= 0) {
Transform mvp = viewport.GetXform (CoordinateSystem.World, CoordinateSystem.Clip);
m_MVPXform = mvp;
float[] modelViewProjection = mvp.ToFloatArray(false);
GL.UniformMatrix4 (m_Uniforms.rglModelViewProjectionMatrix, 1, false, modelViewProjection);
}
if (m_Uniforms.rglModelViewMatrix >= 0) {
mv = viewport.GetXform (CoordinateSystem.World, CoordinateSystem.Camera);
m_MVXform = mv;
haveModelView = true;
float[] modelView = mv.ToFloatArray(false);
GL.UniformMatrix4 (m_Uniforms.rglModelViewMatrix, 1, false, modelView);
}
if (m_Uniforms.rglProjectionMatrix >= 0) {
Transform pr = viewport.GetXform (CoordinateSystem.Camera, CoordinateSystem.Clip);
float[] projection = pr.ToFloatArray(false);
GL.UniformMatrix4 (m_Uniforms.rglProjectionMatrix, 1, false, projection);
}
if (m_Uniforms.rglNormalMatrix >= 0) {
float[] normalMatrix = new float[9];
if (!haveModelView) {
mv = viewport.GetXform (CoordinateSystem.World, CoordinateSystem.Camera);
m_MVXform = mv;
}
Matrix4Dto3F (mv, ref normalMatrix, false);
GL.UniformMatrix3 (m_Uniforms.rglNormalMatrix, 1, false, normalMatrix);
}
}