Grasshopper

algorithmic modeling for Rhino

Hi,

I am trying to rotate a series of panels to an attractor point. So the start point of my panels rotates with the attract point. I am hoping that the rotation can be dictated by a vector (eg. sun angle). I have attached what I have got so far.

I have had a look at older posts, and this post details what I am hoping to achieve.

I have attached the image for your reference.

Much appreciated.

Views: 6801

Attachments:

Replies to This Discussion

Can you post your 3DM and GHX files to play with?

My apologies.

 

 

Attachments:
Didn't see these (^) yet, still hope this helps.
Attachments:
It works, thank you!

Is this the right link?

Hi Eleanor,

You are rotating the first panel only about all the other panels, which I don't think is intentional. Also you are basing the rotation on distance from the attractor rather that direction. If you want the panels to face the attractor point, like the other post, then you need to:

1) create a Vector between two points. Vector>Vector>Vector2Pt

2) create a reference vector to measure against. Vector>Vector>Unit X

3) Measure the angle between vectors. Vector>Vector>Angle

because the angle between two vectors is always shown as the reflex angle you will need to calculate the direction of rotation separately.

4) Calculate the Cross Product of the two vectors. Vector>Vector>Cross Product

5) Unitize the Cross Product. Vector>Vector>Unit Vector

6) Extract the Z component of the Unit Cross Product. Vector>Vector>Decompose

7) Multiply the Z component (either 1 or -1) with the Angle. Maths>Operators>Multiplication

8) Rotate each panel about its base point by the angle to the attractor. Transform>Euclidean>Rotate

 

Thank you, that was very thorough.

Dear Danny

 

I have using your example here to calculate a similiar scenario. It works! BUT

 

i dont really understand a few steps or why it works.

 

Would it be possible to explain the "why" for steps 3,4,5 and especially 7

 

Would be awesome if you can help me understand this

 

Kind regards

 

Gordon

In this example the vectors are in the xy plane and the cross product for two vectors in this plane will either be up or down. It will be +ve Z if the angle between them is going anti-clockwise and -ve Z when going clockwise. So unit-izing the result will give either a 1 or -1 in the Z component which can be applied to the actual angle and give direction for rotation in the world axis.

More about the cross product and right hand rule http://en.wikipedia.org/wiki/Right-hand_rule

Correction to the above post should be acute angle instead of reflex.

Thanks Danny !

 

 

Danny, 

I am trying to do something similar except I'm trying to rotate the scaled surface in relation to the attractor point in the XYand Z direction. If there is any advice you can give on my scrip that would be great. 

I'm trying to create something similar to this project:http://www.dezeen.com/2009/05/20/3d2real-by-ilek-students/

Thanks

Attachments:

RSS

About

Translate

Search

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service