本文整理汇总了C#中Rhino.SetFrustumNearFar方法的典型用法代码示例。如果您正苦于以下问题:C# Rhino.SetFrustumNearFar方法的具体用法?C# Rhino.SetFrustumNearFar怎么用?C# Rhino.SetFrustumNearFar使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Rhino
的用法示例。
在下文中一共展示了Rhino.SetFrustumNearFar方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RenderModel
/// <summary>
/// IRenderer interface method
/// Renders a model in a viewport
/// </summary>
public bool RenderModel(RMModel model, Rhino.DocObjects.ViewportInfo viewport)
{
if (null == model || null == viewport || !model.IsReadyForRendering)
return false;
Model = model;
CheckGLError ("intro call"); //HACK: necessary on some Android GPUs (don't delete this check)
viewport.SetFrustumNearFar (model.BBox);
// Disable Blending and set the depth function
GL.DepthFunc (DepthFunction.Gequal);
GL.Disable (EnableCap.Blend);
// Get the shader...
ActiveShader = FastDrawing ? GetShader ("PerVertexLighting") : GetShader ("PerPixelLighting");
// Render calls...
if (model != null) {
// First, render all opaque objects that are not instances
foreach (var obj in model.DisplayMeshes) {
if (obj != null)
RenderObject (obj, viewport, false);
}
// Second, render all opaque objects that are instances
foreach (var obj in model.DisplayInstanceMeshes) {
if (obj != null)
RenderObject (obj, viewport, true);
}
// Third, we're done drawing our instances, so set the ModelViewMatrix's XForm back to the identity matrix.
ActiveShader.SetModelViewMatrix (Rhino.Geometry.Transform.Identity);
// Fourth, render all transparent meshes...
RenderTransparentObjects (model);
}
// Disable the shader
ActiveShader.Disable ();
return true;
}