本文整理汇总了C#中TerraViewer.Vector3d.RotateX方法的典型用法代码示例。如果您正苦于以下问题:C# Vector3d.RotateX方法的具体用法?C# Vector3d.RotateX怎么用?C# Vector3d.RotateX使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TerraViewer.Vector3d
的用法示例。
在下文中一共展示了Vector3d.RotateX方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SkyLabel
public SkyLabel(RenderContext11 renderContext, double ra, double dec, string text, LabelSytle style, double distance)
{
RA = ra;
Dec = dec;
Text = text;
Style = style;
Distance = distance;
if (texture == null)
{
texture = Texture11.FromBitmap(Resources.circle, 0);
}
var up = new Vector3d();
var textPos = new Vector3d();
if (Earth3d.MainWindow.SolarSystemMode)
{
pos = Coordinates.RADecTo3d(ra, -dec, distance);
up = Coordinates.RADecTo3d(ra, -dec + 90, distance);
pos.RotateX(Coordinates.MeanObliquityOfEcliptic(SpaceTimeController.JNow) / 180.0 * Math.PI);
pos.Add(Planets.GetPlanet3dLocation(SolarSystemObjects.Earth));
up.RotateX(Coordinates.MeanObliquityOfEcliptic(SpaceTimeController.JNow) / 180.0 * Math.PI);
up.Add(Planets.GetPlanet3dLocation(SolarSystemObjects.Earth));
}
else
{
pos = Coordinates.RADecTo3d(ra+12, dec, distance);
textPos = Coordinates.RADecTo3d(ra + 12, dec + 2, distance);
up = Coordinates.RADecTo3d(ra+12, dec + 92, distance);
}
center = new Vector3(9, 9, 0);
textBatch = new Text3dBatch(24);
if (style == LabelSytle.Telrad)
{
// Telrad-style labels are always screen-aligned
var t3 = new Text3d(new Vector3d(0, 0, 0.1), new Vector3d(0, 1, 0), text, 20, .01);
t3.alignment = Text3d.Alignment.Left;
textBatch.Add(t3);
}
else
{
up.Normalize();
textPos.Normalize();
textBatch.Add(new Text3d(textPos, up, text, 20, .0005));
}
}
示例2: GetPlanetPositionDirect
//.........这里部分代码省略.........
case SolarSystemObjects.Mercury:
L = CAAMercury.EclipticLongitude(jd);
B = CAAMercury.EclipticLatitude(jd);
R = CAAMercury.RadiusVector(jd);
break;
case SolarSystemObjects.Venus:
L = CAAVenus.EclipticLongitude(jd);
B = CAAVenus.EclipticLatitude(jd);
R = CAAVenus.RadiusVector(jd);
break;
case SolarSystemObjects.Earth:
{
//double x = HiResTimer.TickCount;
L = CAAEarth.EclipticLongitude(jd);
B = CAAEarth.EclipticLatitude(jd);
R = CAAEarth.RadiusVector(jd);
//x = (HiResTimer.TickCount - x) / HiResTimer.Frequency;
//System.Console.WriteLine("Earth orbit time: " + x * 1000.0 + "ms");
}
break;
case SolarSystemObjects.Mars:
L = CAAMars.EclipticLongitude(jd);
B = CAAMars.EclipticLatitude(jd);
R = CAAMars.RadiusVector(jd);
break;
case SolarSystemObjects.Jupiter:
L = CAAJupiter.EclipticLongitude(jd);
B = CAAJupiter.EclipticLatitude(jd);
R = CAAJupiter.RadiusVector(jd);
break;
case SolarSystemObjects.Saturn:
L = CAASaturn.EclipticLongitude(jd);
B = CAASaturn.EclipticLatitude(jd);
R = CAASaturn.RadiusVector(jd);
break;
case SolarSystemObjects.Uranus:
L = CAAUranus.EclipticLongitude(jd);
B = CAAUranus.EclipticLatitude(jd);
R = CAAUranus.RadiusVector(jd);
break;
case SolarSystemObjects.Neptune:
L = CAANeptune.EclipticLongitude(jd);
B = CAANeptune.EclipticLatitude(jd);
R = CAANeptune.RadiusVector(jd);
break;
case SolarSystemObjects.Pluto:
L = CAAPluto.EclipticLongitude(jd);
B = CAAPluto.EclipticLatitude(jd);
R = CAAPluto.RadiusVector(jd);
break;
case SolarSystemObjects.Moon:
L = CAAMoon.EclipticLongitude(jd);
B = CAAMoon.EclipticLatitude(jd);
R = CAAMoon.RadiusVector(jd)/149598000;
break;
case SolarSystemObjects.Io:
{
var galileanInfo = CAAGalileanMoons.Calculate(jd);
var position = galileanInfo.Satellite1.EclipticRectangularCoordinates;
return new Vector3d(position.X, position.Z, position.Y);
}
case SolarSystemObjects.Europa:
{
var galileanInfo = CAAGalileanMoons.Calculate(jd);
var position = galileanInfo.Satellite2.EclipticRectangularCoordinates;
return new Vector3d(position.X, position.Z, position.Y);
}
case SolarSystemObjects.Ganymede:
{
var galileanInfo = CAAGalileanMoons.Calculate(jd);
var position = galileanInfo.Satellite3.EclipticRectangularCoordinates;
return new Vector3d(position.X, position.Z, position.Y);
}
case SolarSystemObjects.Callisto:
{
var galileanInfo = CAAGalileanMoons.Calculate(jd);
var position = galileanInfo.Satellite4.EclipticRectangularCoordinates;
return new Vector3d(position.X, position.Z, position.Y);
}
}
// Enabling this code transforms planet positions from the mean ecliptic/equinox of
// date to the J2000 ecliptic. It is necessary because the VSOP87D series used
// for planet positions is in the mean-of-date frame. The transformation is currently
// disabled in order to better match planet positions calculated elsewhere in the code.
//CAA2DCoordinate prec = CAAPrecession.PrecessEcliptic(L, B, jd, 2451545.0);
//L = prec.X;
//B = prec.Y;
L = CAACoordinateTransformation.DegreesToRadians(L);
B = CAACoordinateTransformation.DegreesToRadians(B);
var eclPos = new Vector3d(Math.Cos(L) * Math.Cos(B), Math.Sin(L) * Math.Cos(B), Math.Sin(B)) * R;
// Transform from the ecliptic of date to the J2000 ecliptic; this transformation should be deleted
// once the precession is turned one.
var eclipticOfDateRotation = (Coordinates.MeanObliquityOfEcliptic(jd) - Coordinates.MeanObliquityOfEcliptic(2451545.0)) * RC;
eclPos.RotateX(eclipticOfDateRotation);
return new Vector3d(eclPos.X, eclPos.Z, eclPos.Y);
}