本文整理汇总了C#中Rotation.TransformForNavigation方法的典型用法代码示例。如果您正苦于以下问题:C# Rotation.TransformForNavigation方法的具体用法?C# Rotation.TransformForNavigation怎么用?C# Rotation.TransformForNavigation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Rotation
的用法示例。
在下文中一共展示了Rotation.TransformForNavigation方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: UpdateCenterDiff
/// <summary>
/// Set centerDiffX, centerDiffY and centerDiffZ.
/// </summary>
public void UpdateCenterDiff()
{
// For Zerotest
double minDoubleVal = 0.0000000000000001;
Rotation rotView = new Rotation();
rotView.Init(0, 0, 0, -ParameterDict.Current.GetDouble("Transformation.Camera.AngleX"), ParameterDict.Current.GetDouble("Transformation.Camera.AngleY"),
ParameterDict.Current.GetDouble("Transformation.Camera.AngleZ"));
centerDiffX = rotView.TransformForNavigation(new Vec3(1, 0, 0));
rotView = new Rotation();
rotView.Init(0, 0, 0, -ParameterDict.Current.GetDouble("Transformation.Camera.AngleX"), ParameterDict.Current.GetDouble("Transformation.Camera.AngleY"),
ParameterDict.Current.GetDouble("Transformation.Camera.AngleZ"));
centerDiffY = rotView.TransformForNavigation(new Vec3(0, -1, 0));
rotView = new Rotation();
rotView.Init(0, 0, 0, -ParameterDict.Current.GetDouble("Transformation.Camera.AngleX"), ParameterDict.Current.GetDouble("Transformation.Camera.AngleY"),
ParameterDict.Current.GetDouble("Transformation.Camera.AngleZ"));
centerDiffZ = rotView.TransformForNavigation(new Vec3(0, 0, -1));
// Set 0-Entries
if (centerDiffX.X > -minDoubleVal && centerDiffX.X < minDoubleVal)
centerDiffX.X = 0;
if (centerDiffX.Y > -minDoubleVal && centerDiffX.Y < minDoubleVal)
centerDiffX.Y = 0;
if (centerDiffX.Z > -minDoubleVal && centerDiffX.Z < minDoubleVal)
centerDiffX.Z = 0;
if (centerDiffY.X > -minDoubleVal && centerDiffY.X < minDoubleVal)
centerDiffY.X = 0;
if (centerDiffY.Y > -minDoubleVal && centerDiffY.Y < minDoubleVal)
centerDiffY.Y = 0;
if (centerDiffY.Z > -minDoubleVal && centerDiffY.Z < minDoubleVal)
centerDiffY.Z = 0;
if (centerDiffZ.X > -minDoubleVal && centerDiffZ.X < minDoubleVal)
centerDiffZ.X = 0;
if (centerDiffZ.Y > -minDoubleVal && centerDiffZ.Y < minDoubleVal)
centerDiffZ.Y = 0;
if (centerDiffZ.Z > -minDoubleVal && centerDiffZ.Z < minDoubleVal)
centerDiffZ.Z = 0;
}
示例2: UpdateCenterDiff
/// <summary>
/// Set centerDiffX, centerDiffY and centerDiffZ.
/// </summary>
public void UpdateCenterDiff()
{
double centerX = ParameterDict.Current.GetDouble("Scene.CenterX");
double centerY = ParameterDict.Current.GetDouble("Scene.CenterY");
double centerZ = ParameterDict.Current.GetDouble("Scene.CenterZ");
//Rotation rotView = null;
double centerXChange = centerX + 1;
double centerYChange = centerY + 1;
double centerZChange = centerZ + 1;
// For Zerotest
double minDoubleVal = 0.0000000000000001;
// This does not work for angle combinations:
Rotation rotView = new Rotation();
rotView.Init(0, 0, 0, -ParameterDict.Current.GetDouble("Transformation.Camera.AngleX"), ParameterDict.Current.GetDouble("Transformation.Camera.AngleY"),
ParameterDict.Current.GetDouble("Transformation.Camera.AngleZ"));
centerDiffX = rotView.TransformForNavigation(new Vec3(1, 0, 0));
rotView = new Rotation();
rotView.Init(0, 0, 0, -ParameterDict.Current.GetDouble("Transformation.Camera.AngleX"), ParameterDict.Current.GetDouble("Transformation.Camera.AngleY"),
ParameterDict.Current.GetDouble("Transformation.Camera.AngleZ"));
centerDiffY = rotView.TransformForNavigation(new Vec3(0, -1, 0));
rotView = new Rotation();
rotView.Init(0, 0, 0, -ParameterDict.Current.GetDouble("Transformation.Camera.AngleX"), ParameterDict.Current.GetDouble("Transformation.Camera.AngleY"),
ParameterDict.Current.GetDouble("Transformation.Camera.AngleZ"));
centerDiffZ = rotView.TransformForNavigation(new Vec3(0, 0, -1));
// Set 0-Entries
if (centerDiffX.X > -minDoubleVal && centerDiffX.X < minDoubleVal)
centerDiffX.X = 0;
if (centerDiffX.Y > -minDoubleVal && centerDiffX.Y < minDoubleVal)
centerDiffX.Y = 0;
if (centerDiffX.Z > -minDoubleVal && centerDiffX.Z < minDoubleVal)
centerDiffX.Z = 0;
if (centerDiffY.X > -minDoubleVal && centerDiffY.X < minDoubleVal)
centerDiffY.X = 0;
if (centerDiffY.Y > -minDoubleVal && centerDiffY.Y < minDoubleVal)
centerDiffY.Y = 0;
if (centerDiffY.Z > -minDoubleVal && centerDiffY.Z < minDoubleVal)
centerDiffY.Z = 0;
if (centerDiffZ.X > -minDoubleVal && centerDiffZ.X < minDoubleVal)
centerDiffZ.X = 0;
if (centerDiffZ.Y > -minDoubleVal && centerDiffZ.Y < minDoubleVal)
centerDiffZ.Y = 0;
if (centerDiffZ.Z > -minDoubleVal && centerDiffZ.Z < minDoubleVal)
centerDiffZ.Z = 0;
}