Grasshopper

algorithmic modeling for Rhino

is it possible to connect the current camera view's coordinates to a component in grasshopper? i'd like to dynamically grab the distance of the current view to an object(s).

in rhinoscript it would be done using 'rhino.viewCamera' which would return a coordinate, from which i could obtain the distance to an object. i just can't figure out the equivalent in grasshopper.. thanks for any tips!

Views: 1715

Replies to This Discussion

Yes, you'll just need to do it through a scripting component. The following line should do it in a standard scripting component. Note this takes the camera position from the active viewport.

A = app.ActiveView.ActiveViewport.Target
Great, thanks a lot for the help!
I think that gets you the position of the target point, not the camera. I can't seem to find how to get the camera position directly on the mrhinoviewport class (it has to be there, just like the target).
But it's easy to find it on the onviewport class:

Dim vp As ionviewport = app.ActiveView.ActiveViewport.vp
a = vp.CameraLocation
Yep, sorry about that...

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