本文整理汇总了C#中Rotation.Init方法的典型用法代码示例。如果您正苦于以下问题:C# Rotation.Init方法的具体用法?C# Rotation.Init怎么用?C# Rotation.Init使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Rotation
的用法示例。
在下文中一共展示了Rotation.Init方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: Generate
/// <summary>
/// Compute surface data.
/// </summary>
protected void Generate(FracValues act_val, int zyklen, double screensize, int formula, bool perspective)
{
Random rand = new Random();
_maxUpdateSteps = ParameterDict.Current.GetInt("View.UpdateSteps");
double[] col = null;
double xd, yd, zd;
double x, y, z;
double dephAdd = ParameterDict.Current.GetInt("View.DephAdd") * screensize;
act_val = act_val.Clone();
Formulas formulas = new Formulas(_pData);
_lastUsedFormulas = formulas;
if (ParameterDict.Current["Intern.Formula.Source"].Trim() == "")
{
formulas.InternFormula = new Fractrace.TomoGeometry.VecRotMandel2d();
}
else
{
Fractrace.TomoGeometry.TomoFormulaFactory fac = new Fractrace.TomoGeometry.TomoFormulaFactory();
formulas.InternFormula = fac.CreateFromString(ParameterDict.Current["Intern.Formula.Source"]);
}
if (formulas.InternFormula == null)
return;
formulas.InternFormula.Init();
double centerX = ParameterDict.Current.GetDouble("Scene.CenterX");
double centerY = ParameterDict.Current.GetDouble("Scene.CenterY");
double centerZ = ParameterDict.Current.GetDouble("Scene.CenterZ");
Rotation rotView = new Rotation();
rotView.Init(centerX, centerY, centerZ, ParameterDict.Current.GetDouble("Transformation.Camera.AngleX"), ParameterDict.Current.GetDouble("Transformation.Camera.AngleY"),
ParameterDict.Current.GetDouble("Transformation.Camera.AngleZ"));
formulas.Transforms.Add(rotView);
// TODO: only use in compatibility mode.
Rotation rot = new Rotation();
rot.Init();
formulas.Transforms.Add(rot);
if (_isRightView)
{
RightEyeView stereoTransform = new RightEyeView();
stereoTransform.Init();
formulas.Transforms.Add(stereoTransform);
}
col = formulas.col;
_maxxIter = _width;
_maxyIter = (int)(ParameterDict.Current.GetDouble("View.Deph") * screensize);
if(IsSmallPreview())
_maxyIter = _maxxIter;
_maxzIter = _height;
int MINX_ITER = 0;
int MINY_ITER = 0;
int MINZ_ITER = 0;
double fa1;
int xschl = 0, yschl = 0, zschl = 0, xx = 0, yy = 0;
double wix = 0, wiy = 0, wiz = 0;
double jx = 0, jy = 0, jz = 0, jzz = 0;
jx = ParameterDict.Current.GetDouble("Formula.Static.jx");
jy = ParameterDict.Current.GetDouble("Formula.Static.jy");
jz = ParameterDict.Current.GetDouble("Formula.Static.jz");
jzz = ParameterDict.Current.GetDouble("Formula.Static.jzz");
// Innenbereich
int minCycle = (int)ParameterDict.Current.GetDouble("Formula.Static.MinCycle");
if (minCycle == 0)
minCycle = zyklen;
// Offset für den Maximalzyklus für die klassische 2D-Darstellung
int cycleAdd = 128;
wix = act_val.arc.x;
wiy = act_val.arc.y;
wiz = act_val.arc.z;
xd = (act_val.end_tupel.x - act_val.start_tupel.x) / (_maxxIter - MINX_ITER);
yd = (act_val.end_tupel.y - act_val.start_tupel.y) / (_maxyIter - MINY_ITER);
zd = (act_val.end_tupel.z - act_val.start_tupel.z) / (_maxzIter - MINZ_ITER);
if (_oldData != null)
{
yd = yd / (_updateCount);
if (_updateCount < 5)
{
_maxyIter *= _updateCount;
}
}
if (_transformUpdate)
{
yd *= 3.0;
}
double xcenter = (act_val.start_tupel.x + act_val.end_tupel.x) / 2.0;
double ycenter = (act_val.start_tupel.y + act_val.end_tupel.y) / 2.0;
double zcenter = (act_val.start_tupel.z + act_val.end_tupel.z) / 2.0;
//.........这里部分代码省略.........
示例3: 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;
}