algorithmic modeling for Rhino
I was wondering if anybody could point me to a sample where the display behavior in the rhino view-port of e.g. Rhino.Geometry.TextDot was customized.
I am looking for a feasible (meaning fast) way of doing this:
http://www.grasshopper3d.com/forum/topics/text-dot-size?commentId=2...
best
Richard
Tags:
TextDots can't be customized a great deal. What exactly are you looking to do? Draw camera aligned text in viewports?
--
David Rutten
david@mcneel.com
Both are possible. Are you doing this from within a GH_Component RenderXXXX() method?
How is the data you need to draw stored and what is the logical mapping from variables in memory to pixels on screen?
--
David Rutten
david@mcneel.com
Baked geometry will no longer update to align with the camera, that's a sacrifice you'll have to make.
You can either draw your graph as a 3D object in some world space rectangle (in which case it's easy to position it in the model and baking is possible) or you can draw it on the viewport near plane. This means it will be drawn in front of all other objects and it will face the camera. However exactly where you place the text and polygons and arrow depends on the viewport size. A simple mapping from world-space to screen-space will probably not suffice. You'll have to recalculate the drawn geometry on every redraw.
Option A is how the Legend object in GH works. Pick whichever approach suits you best (fixed 3D and bakeable or camera-oriented and not-bakeable).
--
David Rutten
david@mcneel.com
But would it be possible to create a custom Rhino.Geometry class taking care of this in rhino directly, if possible this should be way faster, than recalculating the preview constantly.
Adding a new object type to Rhino is not something to be undertaken lightly. Especially not something which jumps around in 'real' space just to anchor itself to the camera properties of every viewport.
I'm not even sure if it is possible in RhinoCommon, but even if it is, I'd recommend against it.
--
David Rutten
david@mcneel.com
Let me rephrase my question:
How did you do the point preview flavors? Would it be possible to do a similar thing with different geometry?
The point preview text is drawn in a display pipeline using the camera properties of whatever viewport they are drawn in. Similarly in the Dimensioning components I just released, the text orients itself based on camera position and direction and type (perspective vs orthogonal).
You can draw whatever geometry you like in this way, it is not limited to text.
--
David Rutten
david@mcneel.com
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