本文整理汇总了C#中VisionViewBase.RenderSolidTriangle方法的典型用法代码示例。如果您正苦于以下问题:C# VisionViewBase.RenderSolidTriangle方法的具体用法?C# VisionViewBase.RenderSolidTriangle怎么用?C# VisionViewBase.RenderSolidTriangle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VisionViewBase
的用法示例。
在下文中一共展示了VisionViewBase.RenderSolidTriangle方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RenderShape
public override void RenderShape(VisionViewBase view, ShapeRenderMode mode)
{
if (TimeOfDay == null)
return;
const int iSteps = 24;
float fStep = 1.0f / (float)iSteps;
float fLen = 200.0f * EditorManager.Settings.GlobalUnitScaling;
float fTime = 0.0f;
Vector3F lastCorner = Vector3F.Zero;
for (int i=0; i<iSteps; i++,fTime += fStep)
{
if (!EditorManager.RendererNodeManager.GetTimeOfDaySnapshot(fTime, daytimeParams))
continue;
Vector3F newCorner = Position + daytimeParams.SunDirection * fLen * 0.75f;
if (i > 0)
{
view.RenderSolidTriangle(Position, newCorner, lastCorner, VisionColors.Get(daytimeParams.AmbientColor));
view.RenderSolidTriangle(Position, lastCorner, newCorner, VisionColors.Get(daytimeParams.AmbientColor));
}
Vector3F vEnd = Position + daytimeParams.SunDirection * fLen;
view.RenderLine(Position, vEnd, VisionColors.Get(daytimeParams.SunColor), 1.0f);
uint iColor = (i == 12) ? VisionColors.White : VisionColors.Yellow;
view.WriteText3D(vEnd, i.ToString()+":00", iColor); // time
lastCorner = newCorner;
}
}