Human - Gradient on 3D View

unhandled

(Antoine Abelard) #1

Hello everyone, I met a problem with the 3D View of Human UI.

I’d like to link a gradient tool to the 3D View tool to get a color gradient of temperature on my 3D Graph (like the one I got in Rhino), I tried many combinations but impossible to get that gradient, the color of the 3D solid stay in a unique color.

Anyone knows if it’s possible to do that color gradient thing on Human UI? And if yes, how?

Searching desperatly for the answer …!

What I want :

What I did :

What I got :


(Andrew Heumann) #2

This is possible, but not exactly straightforward. The viewport library I use in Human UI does not (as far as I know) support per-vertex coloring the way rhino does. The (somewhat involved) workaround is as follows:

  • Create a bitmap from your gradient
  • Map the bitmap to your mesh’s texture vertices (in this particular case since the Z-height of the graph appears to correspond to the same measure as the coloration does, this might be quite simple)
  • use “Set 3d View Textured” and pass it the texture-mapped mesh and the created texture.

Attached is a definition that demonstrates this process. Included is a custom script to extract a gradient to a bitmap. It will also require Human to assign the mesh vertex texture coordinates. You can see they won’t look exactly the same because the viewport meshes are shaded.

Download the example here:
Mesh Vertex Coloring in HUI.gh (19.0 KB)


(Antoine Abelard) #3

It works great ! Thank you very much for your help, I couldn’t find the solution without this.