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


C# Library.TransformMatrix类代码示例

本文整理汇总了C#中MediaPortal.GUI.Library.TransformMatrix的典型用法代码示例。如果您正苦于以下问题:C# TransformMatrix类的具体用法?C# TransformMatrix怎么用?C# TransformMatrix使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


TransformMatrix类属于MediaPortal.GUI.Library命名空间,在下文中一共展示了TransformMatrix类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CreateScaler

 public static TransformMatrix CreateScaler(float scaleX, float scaleY, float scaleZ /*=1.0f*/)
 {
   TransformMatrix scaler = new TransformMatrix();
   scaler.m[0, 0] = scaleX;
   scaler.m[1, 1] = scaleY;
   scaler.m[2, 2] = scaleZ;
   return scaler;
 }
开发者ID:arangas,项目名称:MediaPortal-1,代码行数:8,代码来源:TransformMatrix.cs

示例2: CreateTranslation

 public static TransformMatrix CreateTranslation(float transX, float transY, float transZ /*=0.0f*/)
 {
   TransformMatrix translation = new TransformMatrix();
   translation.m[0, 3] = transX;
   translation.m[1, 3] = transY;
   translation.m[2, 3] = transZ;
   return translation;
 }
开发者ID:arangas,项目名称:MediaPortal-1,代码行数:8,代码来源:TransformMatrix.cs

示例3: FinalTransformBucket

 public FinalTransformBucket(TransformMatrix finalTransform, TransformMatrix finalTransformCalibrated)
 {
   // The matrices on the stack must be copies otherwise they may be illegally manipulated while on the stack.
   _finalTransformMatrix = (TransformMatrix)finalTransform.Clone();
   _finalTransformMatrixCalibrated = (TransformMatrix)finalTransformCalibrated.Clone();
 }
开发者ID:doskabouter,项目名称:MediaPortal-1,代码行数:6,代码来源:GraphicContext.cs

示例4: UpdateFinalTransform

 /// <summary>
 /// 
 /// </summary>
 /// <param name="matrix"></param>
 public static void UpdateFinalTransform(TransformMatrix matrix)
 {
   _finalTransform = matrix;
   _finalTransformCalibrated = GetOffsetCorrectionTransform().multiply(matrix);
 }
开发者ID:doskabouter,项目名称:MediaPortal-1,代码行数:9,代码来源:GraphicContext.cs

示例5: SetScalingResolution

    /// <summary>
    /// 
    /// </summary>
    /// <param name="posX"></param>
    /// <param name="posY"></param>
    /// <param name="needsScaling"></param>
    public static void SetScalingResolution(int posX, int posY, bool needsScaling)
    {
      if (!needsScaling)
      {
        _guiTransform = TransformMatrix.CreateTranslation(posX, posY, 0);
      }

      Cameras.Clear();
      Cameras.Add(new Point(Width / 2, Height / 2));
      UpdateCameraPosition(Cameras[Cameras.Count-1]);

      // reset the final transform and window transforms
      UpdateFinalTransform(_guiTransform);
    }
开发者ID:doskabouter,项目名称:MediaPortal-1,代码行数:20,代码来源:GraphicContext.cs

示例6: RotateZ

 /// <summary>
 /// Rotates the control transform matrix by the specified angle (in degrees) around the z-axis.
 /// </summary>
 public static void RotateZ(float angle, float x, float y)
 {
   TransformMatrix m = new TransformMatrix();
   angle *= DEGREE_TO_RADIAN;
   m.SetZRotation(angle, x, y, 1.0f);
   UpdateFinalTransform(ControlTransform.multiplyAssign(m));
 }
开发者ID:nio22,项目名称:MediaPortal-1,代码行数:10,代码来源:GraphicContext.cs

示例7: CreateFader

 public static TransformMatrix CreateFader(float a)
 {
   TransformMatrix fader = new TransformMatrix();
   fader.alpha = a;
   return fader;
 }
开发者ID:arangas,项目名称:MediaPortal-1,代码行数:6,代码来源:TransformMatrix.cs

示例8: RenderAnimation

 private bool RenderAnimation(uint time)
 {
   TransformMatrix transform = new TransformMatrix();
   // show animation
   _showAnimation.Animate(time, true);
   UpdateStates(_showAnimation.AnimationType, _showAnimation.CurrentProcess, _showAnimation.CurrentState);
   _showAnimation.RenderAnimation(ref transform);
   // close animation
   _closeAnimation.Animate(time, true);
   UpdateStates(_closeAnimation.AnimationType, _closeAnimation.CurrentProcess, _closeAnimation.CurrentState);
   _closeAnimation.RenderAnimation(ref transform);
   GUIGraphicsContext.SetWindowTransform(transform);
   return true;
 }
开发者ID:MediaPortal,项目名称:MediaPortal-1,代码行数:14,代码来源:GUIWindow.cs

示例9: Draw

    /// <summary>
    /// Draw a texture rotated around (x,y) blended with a diffuse texture.
    /// </summary>
    /// <param name="x"></param>
    /// <param name="y"></param>
    /// <param name="nw"></param>
    /// <param name="nh"></param>
    /// <param name="zrot"></param>
    /// <param name="uoff"></param>
    /// <param name="voff"></param>
    /// <param name="umax"></param>
    /// <param name="vmax"></param>
    /// <param name="color"></param>
    /// <param name="diffuseTextureNo"></param>
    /// <param name="uoffd"></param>
    /// <param name="voffd"></param>
    /// <param name="umaxd"></param>
    /// <param name="vmaxd"></param>
    public void Draw(float x, float y, float nw, float nh, float zrot, float uoff, float voff, 
                     float umax, float vmax, uint color, int blendableTextureNo, float uoffd, 
                     float voffd, float umaxd, float vmaxd, FontEngineBlendMode blendMode)
    {
      if (_textureNumber >= 0)
      {
        // Rotate around the x,y point of the specified rectangle; maintain aspect ratio (1.0f)
        TransformMatrix localTransform = new TransformMatrix();
        localTransform.SetZRotation(zrot, x, y, 1.0f);
        TransformMatrix finalTransform = GUIGraphicsContext.GetFinalTransform();
        localTransform = finalTransform.multiply(localTransform);

        DXNative.FontEngineDrawTexture2(_textureNumber, x, y, nw, nh, uoff, voff, umax, vmax,
                               color, localTransform.Matrix,
                               blendableTextureNo, uoffd, voffd, umaxd, vmaxd,
                               blendMode);
      }
    }
开发者ID:arangas,项目名称:MediaPortal-1,代码行数:36,代码来源:TextureFrame.cs

示例10: Clone

 public object Clone()
 {
   TransformMatrix matrix = new TransformMatrix();
   matrix.assign(this);
   return matrix;
 }
开发者ID:arangas,项目名称:MediaPortal-1,代码行数:6,代码来源:TransformMatrix.cs

示例11: multiply

 public TransformMatrix multiply(TransformMatrix right)
 {
   TransformMatrix result = new TransformMatrix();
   result.m[0, 0] = m[0, 0] * right.m[0, 0] + m[0, 1] * right.m[1, 0] + m[0, 2] * right.m[2, 0];
   result.m[0, 1] = m[0, 0] * right.m[0, 1] + m[0, 1] * right.m[1, 1] + m[0, 2] * right.m[2, 1];
   result.m[0, 2] = m[0, 0] * right.m[0, 2] + m[0, 1] * right.m[1, 2] + m[0, 2] * right.m[2, 2];
   result.m[0, 3] = m[0, 0] * right.m[0, 3] + m[0, 1] * right.m[1, 3] + m[0, 2] * right.m[2, 3] + m[0, 3];
   result.m[1, 0] = m[1, 0] * right.m[0, 0] + m[1, 1] * right.m[1, 0] + m[1, 2] * right.m[2, 0];
   result.m[1, 1] = m[1, 0] * right.m[0, 1] + m[1, 1] * right.m[1, 1] + m[1, 2] * right.m[2, 1];
   result.m[1, 2] = m[1, 0] * right.m[0, 2] + m[1, 1] * right.m[1, 2] + m[1, 2] * right.m[2, 2];
   result.m[1, 3] = m[1, 0] * right.m[0, 3] + m[1, 1] * right.m[1, 3] + m[1, 2] * right.m[2, 3] + m[1, 3];
   result.m[2, 0] = m[2, 0] * right.m[0, 0] + m[2, 1] * right.m[1, 0] + m[2, 2] * right.m[2, 0];
   result.m[2, 1] = m[2, 0] * right.m[0, 1] + m[2, 1] * right.m[1, 1] + m[2, 2] * right.m[2, 1];
   result.m[2, 2] = m[2, 0] * right.m[0, 2] + m[2, 1] * right.m[1, 2] + m[2, 2] * right.m[2, 2];
   result.m[2, 3] = m[2, 0] * right.m[0, 3] + m[2, 1] * right.m[1, 3] + m[2, 2] * right.m[2, 3] + m[2, 3];
   result.alpha = alpha * right.alpha;
   return result;
 }
开发者ID:arangas,项目名称:MediaPortal-1,代码行数:18,代码来源:TransformMatrix.cs

示例12: multiplyAssign

    // multiplication operators
    public TransformMatrix multiplyAssign(TransformMatrix right)
    {
      float t00 = m[0, 0] * right.m[0, 0] + m[0, 1] * right.m[1, 0] + m[0, 2] * right.m[2, 0];
      float t01 = m[0, 0] * right.m[0, 1] + m[0, 1] * right.m[1, 1] + m[0, 2] * right.m[2, 1];
      float t02 = m[0, 0] * right.m[0, 2] + m[0, 1] * right.m[1, 2] + m[0, 2] * right.m[2, 2];
      m[0, 3] = m[0, 0] * right.m[0, 3] + m[0, 1] * right.m[1, 3] + m[0, 2] * right.m[2, 3] + m[0, 3];
      m[0, 0] = t00;
      m[0, 1] = t01;
      m[0, 2] = t02;
      t00 = m[1, 0] * right.m[0, 0] + m[1, 1] * right.m[1, 0] + m[1, 2] * right.m[2, 0];
      t01 = m[1, 0] * right.m[0, 1] + m[1, 1] * right.m[1, 1] + m[1, 2] * right.m[2, 1];
      t02 = m[1, 0] * right.m[0, 2] + m[1, 1] * right.m[1, 2] + m[1, 2] * right.m[2, 2];
      m[1, 3] = m[1, 0] * right.m[0, 3] + m[1, 1] * right.m[1, 3] + m[1, 2] * right.m[2, 3] + m[1, 3];
      m[1, 0] = t00;
      m[1, 1] = t01;
      m[1, 2] = t02;
      t00 = m[2, 0] * right.m[0, 0] + m[2, 1] * right.m[1, 0] + m[2, 2] * right.m[2, 0];
      t01 = m[2, 0] * right.m[0, 1] + m[2, 1] * right.m[1, 1] + m[2, 2] * right.m[2, 1];
      t02 = m[2, 0] * right.m[0, 2] + m[2, 1] * right.m[1, 2] + m[2, 2] * right.m[2, 2];
      m[2, 3] = m[2, 0] * right.m[0, 3] + m[2, 1] * right.m[1, 3] + m[2, 2] * right.m[2, 3] + m[2, 3];
      m[2, 0] = t00;
      m[2, 1] = t01;
      m[2, 2] = t02;
      alpha *= right.alpha;

      return this;
    }
开发者ID:arangas,项目名称:MediaPortal-1,代码行数:28,代码来源:TransformMatrix.cs

示例13: assign

    // assignment operator
    public TransformMatrix assign(TransformMatrix right)
    {
      m[0, 0] = right.m[0, 0];
      m[0, 1] = right.m[0, 1];
      m[0, 2] = right.m[0, 2];
      m[0, 3] = right.m[0, 3];

      m[1, 0] = right.m[1, 0];
      m[1, 1] = right.m[1, 1];
      m[1, 2] = right.m[1, 2];
      m[1, 3] = right.m[1, 3];

      m[2, 0] = right.m[2, 0];
      m[2, 1] = right.m[2, 1];
      m[2, 2] = right.m[2, 2];
      m[2, 3] = right.m[2, 3];
      alpha = right.alpha;
      return this;
    }
开发者ID:arangas,项目名称:MediaPortal-1,代码行数:20,代码来源:TransformMatrix.cs

示例14: SetWindowTransform

 /// <summary>
 /// 
 /// </summary>
 /// <param name="matrix"></param>
 public static void SetWindowTransform(TransformMatrix matrix)
 {
   // reset the group transform stack
   GroupTransforms.Clear();
   GroupTransforms.Add(_guiTransform.multiply(matrix));
   _bypassUICalibration = 0;
   UpdateFinalTransform(GroupTransforms[0]);
 }
开发者ID:doskabouter,项目名称:MediaPortal-1,代码行数:12,代码来源:GraphicContext.cs

示例15: Draw

      public void Draw(float x, float y, float nw, float nh, float zrot, float uoff, float voff, float umax, float vmax,
                       int color)
      {
        if (_textureNumber >= 0)
        {
          // Rotate around the x,y point of the specified rectangle; maintain aspect ratio (1.0f)
          TransformMatrix localTransform = new TransformMatrix();
          localTransform.SetZRotation(zrot, x, y, 1.0f);
          TransformMatrix finalTransform = GUIGraphicsContext.GetFinalTransform();
          localTransform = finalTransform.multiply(localTransform);

          FontEngineDrawTexture(_textureNumber, x, y, nw, nh, uoff, voff, umax, vmax, color, localTransform.Matrix);
        }
        else
        {
          if (logTextures)
          {
            Log.Info("fontengine:Draw() ERROR. Texture is disposed:{0} {1}", _textureNumber.ToString(), _imageName);
          }
        }
      }
开发者ID:npcomplete111,项目名称:MediaPortal-1,代码行数:21,代码来源:CachedTexture.cs


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