本文整理匯總了C#中TerraViewer.RenderContext11.SetEclipseShadowMatrix方法的典型用法代碼示例。如果您正苦於以下問題:C# RenderContext11.SetEclipseShadowMatrix方法的具體用法?C# RenderContext11.SetEclipseShadowMatrix怎麽用?C# RenderContext11.SetEclipseShadowMatrix使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類TerraViewer.RenderContext11
的用法示例。
在下文中一共展示了RenderContext11.SetEclipseShadowMatrix方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: SetupShadow
private static Vector3d SetupShadow(RenderContext11 renderContext, Vector3d centerPoint, float width, SolarSystemObjects shadowCaster, int shadowIndex)
{
var device = renderContext.Device;
if (PlanetShadow == null)
{
PlanetShadow = Texture11.FromBitmap(device, Resources.planetShadow);
}
var invViewCam = renderContext.View;
invViewCam.Invert();
var sun = planet3dLocations[0];
sun.Subtract(centerPoint);
var moon = planet3dLocations[(int)shadowCaster];
moon.Subtract(centerPoint);
var biasd = Matrix3d.Scaling(0.5, 0.5, 0.5) * Matrix3d.Translation(new Vector3d(0.5, 0.5, 0.5));
var mat =
invViewCam *
Matrix3d.LookAtLH(sun, moon, new Vector3d(0, 1, 0)) *
Matrix3d.PerspectiveFovLH(width, 1, 0.001f, 200f) *
biasd;
renderContext.SetEclipseShadowMatrix(shadowIndex, mat.Matrix11);
return centerPoint;
}