algorithmic modeling for Rhino
Hi
My problem is that when i display some lines in the DrawViewportWires method, they disappear when i zoom closer to them.
I tried to use the
args.Display.Viewport.SetClippingPlanes(boundingBox);
but it does not help.
If i bake this boundingBox i have no problem to see the lines at all time. But obviously I don't want this box to be shown.
What am I doing wrong?
public override void DrawViewportWires(IGH_PreviewArgs args)
{
for (int i = 0; i < lines.Count; i++)
{
if (!this.Attributes.Selected)
{
args.Display.DrawLine(lines[i], args.WireColour);
}
else
{
args.Display.DrawLine(lines[i], args.WireColour_Selected);
}
}
args.Display.Viewport.SetClippingPlanes(boundingBox);
// overwrite the original
base.DrawViewportWires(args);
}
Tags:
Hi Jesper,
it's not technically clipping planes but it's the front and back limits of the depth buffer. You need to inform Rhino that you are going to draw objects in a specific location before the real drawing starts, so Rhino can figure out what range the depth buffer needs to handle. To do this override the ClippingBox() property and return a boundingbox that contains all your geometry.
To be absolutely safe, return the union of your own boundingbox and the base class clipping box.
--
David Rutten
david@mcneel.com
Hi David, Thank once again for the help :-)
This piece of code solved the problem:
public override BoundingBox ClippingBox
{
get
{
return this.boundingBox;
}
}
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by