本文整理汇总了C#中System.Windows.Media.Media3D.Matrix3D.Append方法的典型用法代码示例。如果您正苦于以下问题:C# Matrix3D.Append方法的具体用法?C# Matrix3D.Append怎么用?C# Matrix3D.Append使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Media.Media3D.Matrix3D
的用法示例。
在下文中一共展示了Matrix3D.Append方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: UpdateProjViewMat
/// <summary>
/// 当窗口大小发生改变时,更新视口投影矩阵
/// </summary>
public void UpdateProjViewMat(Double height, double width)
{
double aspectRatio = width / height;
double FoV = MathUtils.DegreesToRadians(45);
double zn = 0.125;
double xScale = 1 / Math.Tan(FoV / 2);
double yScale = aspectRatio * xScale;
//double yScale = 1 / Math.Tan(FoV / 2);
//double xScale = yScale / aspectRatio;
double m33 = -1;
double m43 = zn * m33;
projViewMat = new Matrix3D(
xScale, 0, 0, 0,
0, yScale, 0, 0,
0, 0, m33, -1,
0, 0, m43, 0);
double scaleX = width / 2;
double scaleY = height / 2;
projViewMat.Append(new Matrix3D(
scaleX, 0, 0, 0,
0, -scaleY, 0, 0,
0, 0, 1, 0,
scaleX, scaleY, 0, 1));
UpdateTo2DMat();
}
示例2: PhotoAlbum
public PhotoAlbum()
{
InitializeComponent();
dt.Interval = TimeSpan.FromSeconds(2);
dt.Tick += new EventHandler(dt_Tick);
for (int i = 0; i < 16; i++)
{
ImageBrush ib = new ImageBrush(new BitmapImage(new Uri("pack://application:,,,/images/albums/im" + i + ".jpg")));
ib.Stretch = Stretch.Uniform;
ModelVisual3D mv = new ModelVisual3D();
Material mat = new DiffuseMaterial(ib);
GeometryModel3D plane = new GeometryModel3D(planeFactory.Mesh, mat);
mv.Content = plane;
mvs[i] = mv;
myViewPort3D.Children.Add(mv);
Matrix3D trix = new Matrix3D();
double x = ran.NextDouble() * 50 - 50;
double y = ran.NextDouble() * 2 - 2;
double z = -i * 10;
p3s[i] = new Point3D(x, y, z);
trix.Append(new TranslateTransform3D(x, y, z).Value);
mv.Transform = new MatrixTransform3D(trix);
}
pa = new Point3DAnimation(p3s[0], TimeSpan.FromMilliseconds(300));
pa.AccelerationRatio = 0.3;
pa.DecelerationRatio = 0.3;
pa.Completed += new EventHandler(pa_Completed);
cam.BeginAnimation(PerspectiveCamera.PositionProperty, pa);
}
示例3: Push
/// <summary>
/// Empty => [matrix]
/// tail | [top] => tail | [top] | [matrix * top]
/// </summary>
public void Push(Matrix3D matrix)
{
if (_stack.Count > 0)
{
matrix.Append(Top);
}
_stack.Add(matrix);
}