Grasshopper

algorithmic modeling for Rhino

Hello there.

I'm trying to create a definition that will assign a specif colour to a given geometry. By, lets say, distance to point (similar to an attractor point definition). But I don't know how to tell GH to pick a colour. Can I use the image component...?

Any ideas

thank you all

Views: 23550

Replies to This Discussion

Use the Gradient component under Params -> Special
Colors are just numbers... numbers from either 0-255 or 0-1 for the Red, Green, and Blue channels. The "easiest" way to generate colors is from a vector, which you can either break down manually, or simply pass to a shader as you would a color.

Here's a really simple example. Just take two points, make a vector and a line between them. Unitize the vector and pass that to a shader, then use the geometry preview. The line should change color as you move the points around.

wow I'll give it a try thank you
nice, but where do you find this kind of shader? and is there a way to render with these shaders? can you import any other like mentalray or vray materials?
The Shader parameter allows you to pick an existing material from the Rhino material table (you need to have the RDK installed though in order to get this feature).

You cannot import shaders from mentalray or vray, it is only possible to display basic Rhino materials, and I don't support textures at all.

--
David Rutten
david@mcneel.com
Seattle, WA
Note that when you use the Vector -> Color inbuild conversion, the actual numeric range is -1.0 to +1.0.

X maps onto Red
Y maps onto Green
Z maps onto Blue

By picking the -1.0 to +1.0 range, it means that all unitized vectors (no matter where they are pointing) give you a unique colour.

--
David Rutten
david@mcneel.com
Seattle, WA
It would technically be stored as a unique color. But since a standard graphics card can only display 256 colors per channel and an LCD screen even less, in practical terms vectors with a difference of up to 0.007% could still share the same color.
As for what the the OP was actually asking, it would go something like this:


It would be better to substitute the attractor formula for one that doesen't tend to infinity.
Hey, can anyone explain me how to render in rhino render using ghp sheyders?
is it possible to export sheyders to vray, flamingo, e.t.c. (maybe using exel eport?)
Check this page half way down:
http://gracefulspoon.com/blog/tag/grasshopper/
Maybe this can help you..

Hi there!, i don´t know how threads work in the forum since i´m relatively new to the software, i am trying to achieve the definition you created, but i dont know many components by icon, is there any possible way you could share your definition with me?, i would greatly apreciate it, or at least show me a print screen with full names?, i want to get around at how does this work.

Best regards, Jaime.

Hi Jaime,

this is a terribly old thread. There have been so many changes since then it may be easier to start anew. 

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service