Grasshopper

algorithmic modeling for Rhino

rotation of object around world's x-, y- and z-axis

hello!

at first I have to say that i'm rather new to grasshopper. maybe my question is easy to solve or i simply have a wrong way of thinking..

anyways.. what i have and what i want:

i have an object (in this case a box).

(it's dimensions: a * b * h

it's position in space: -a/2 to a/2, -b/2 to b/2, h)

so the world's origin is the midpoint of the bottom surface of the box

now i want to be able to rotate it around the world's x, y and z-axis and not only in this order and not only once for each direction.

the reason for that is that i need to be able to recognise the rotation angles in the end for manufacturing purposes

what the outcome of my code is:

i can perfectly rotate the object step by step around z, x and y. but after these three rotations, when i try to change the rotation around the z-axis again, the object rotates around it's own z-axis rather than around the world's z-axis, which i initially had explicitly defined in my code. so i get the notion that it never really rotated around the world's z-axis because at the beginning the two axes where the same.

maybe there is someone who can help me out with this?!

Views: 5323

Attachments:

Replies to This Discussion

Hi Shapeless,

your images look correct. If you first rotate around Z and then X & Y, then it will appear that the axis of rotation of your first operation will tilt. Grasshopper operations do not rely on previous iterations. The file is always solved from scratch. Meaning that:

  1. Set Z slider to 38
  2. Set X slider to 49
  3. Set Z slider to 64

Will result in the exact same state as:

  1. Set Z slider to 64
  2. Set X slider to 49

In other words, the only thing that matters is what value each slider has, not what values it used to have some time in the past.

If you want to be able to specify more than one rotation per world axis (not a variable amount mind you, but a predefined amount of operations) then you can use a Gene Pool object and stack your rotational angles:

It might be possible to trick Grasshopper into paying attention to previous slider states using a [Data Recorder] object. But it sounds pretty darn complicated.

--

David Rutten

david@mcneel.com

Tirol, Austria

Attachments:

thank you so much for your quick reply!

mh it works the way i wanted it to behave..

i think my main error in reasoning was to think that there is a global "world coordinate-system" in grasshopper as there is in rhino ..

i didn't mainly want grasshopper to remember the values of the slider but just keep the initial coordinate system like it is shown in the rhino window..

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