Grasshopper

algorithmic modeling for Rhino

Hi there!

I'm relatively new to C#, and I have started working on some custom parameters and types. One of them, my Node, I'd like to preview as a circle with a cross in 2D space (much like the GH Point3d, but with a circle around it). I have tried the different 3d methods in args.pipeline, but they don't seem to suffice.

I've been trying to google this but it's hard to find documentation. Should I use sprites? From what I've read, these consist of a bitmap which may not be the best of ideas.

The other alternative is to draw a circle and cross in 3d space and always turn it against the user in some way.

I've tried to look into the RhinoCommon SDK on the display conduit, but with no luck on finding specific information about drawing in 2d space. (I have also tried to look into screen->world coordinate transformation, but I can't really wrap my head around it)

Any idea on how I should approach this?

Many thanks,

Gustav

Views: 608

Replies to This Discussion

Hi Gustav, 

sprites are an option, but personally I prefer to draw using geometry. Especially if you have a limited number of these objects (no more than a couple thousand or so) the performance impact shouldn't be too high.

The trick to drawing objects like these is to align them with the camera near plane and scale them according to distance, see attached:

Attachments:

nice, I was looking for something similar too!

Wow, that was easier than I thought! Thank you very much for the help, exactly what I wanted.

You're always very fast with replying David! Much appreciated. 

Cheers,

Gustav

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