Grasshopper

algorithmic modeling for Rhino

Hi, 

I'm trying to make a cylinder bend in (in Rhino) in different directions and with different magnitudes using a joystick. The setup of the bending cylinder has already been done thanks to the Jackalope plugin.

I'm able to read the joystick values (x and y) within Grasshopper. My goal now is to convert these values into to the direction (0 degrees to 360 degrees) where the cylinder has to be bent aswel as the magnitude of the bending.

I just have no idea how I would convert the x and y values in order to control two different parameters. Has anyone done this before?

Simon

Views: 362

Replies to This Discussion

Hi SimonVP, you're probably looking for the Atan2(x,y) function. For vector amplitude use pythagoras.

Thanks Pieter. The direction now works.

For the amplitude, Should I write an expression like √((x²) + (y²))?

that's an option yes, I would use hypot(x,y).

It works partly (kind of). The base value resulting from the Pythagoras expression is now 735. The min and max values I got are 0 and 1446. Is there a way to use these values to control my vector amplitude (which ranges from 0 to 18?)

Thanks

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