Grasshopper

algorithmic modeling for Rhino

Hi everyone, 

I stumbled upon this specific viewport setting in Rhino which turns the rhinoviewport into stereoscopic images/anaglyphs(see img "Rhino-Analglyphs").  

When turning on this preview all GH objects disappear, so I have tried making my own in GH - see img "GH-Anaglyphs". Its close but not there yet. 

So I thought what if I send my GH objects to the rhino display pipeline using the code bellow, would Rhino then pick it up as an object and preview it with the same preview as the "Rhino-anaglyh" image but it didn't. 

private void RunScript(Point3d p0, Point3d p1, int n, Mesh ms_in)
{


ms = ms_in;
_clippingBox.Union(ms.GetBoundingBox(true));

}


BoundingBox _clippingBox;
Mesh ms;


public override BoundingBox ClippingBox
{
get{
return _clippingBox;
}
}

public override void DrawViewportMeshes(IGH_PreviewArgs args)
{
base.DrawViewportMeshes(args);

args.Display.DrawMeshShaded(ms, new Rhino.Display.DisplayMaterial());

}

Are there anyone out there who have a little trick to make Rhino read the objects from GH as Rhino objects without baking? That being said I would love for this to become GH only components/preview instead of having to fudge it like this, but the current Rhino preview works really well, so I thought why not give it a shot. 

I have also attached the definition if that helps, however it doesn't work quite yet, and I havent had time to comment it(sorry guys)

Thank you for any help. 

Views: 632

Attachments:

Replies to This Discussion

For those (like me) who do not know this display:

http://wiki.mcneel.com/rhino/stereomode

I would try to do is create my own display (inheriting from DisplayPipeline) draw my geometry (of gh) on it and activate the stereoscopic mode. 

I've taken a quick look at Rhino SDK and I have not found how to activate it (just how to know if it is active)... So perhaps you should ask in the McNeel forum.

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service