vex control normals

   1758   3   1
User Avatar
Member
90 posts
Joined: March 2013
Offline
So I'm trying to have the inner most normals laying down so to speak and the further the points get out to have an up vector for the normals. Not really sure how to pull this off. I tried to use the lerp function in a foreach loop. It's not doing what I want. Check out the last wrangle. Any advice?
Edited by tadian - March 20, 2018 15:24:53

Attachments:
normalsTest.hiplc (81.7 KB)

User Avatar
Member
670 posts
Joined: Sept. 2013
Online
It´s more efficient to create all points in advance and wrangle them like this:

float grad = @ptnum / float(@numpt);                           // gradient from 0 to 1 ranging across all points
@P = set( cos(@ptnum * 5), 0, sin(@ptnum * 5)) * grad;         // position circling outwards with sine and cosine
@N = lerp(normalize(@P), {0, 1, 0}, grad);                     // normals fading from centered to upwards

Attachments:
normalsTest_2.hipnc (69.9 KB)

https://procegen.konstantinmagnus.de/ [procegen.konstantinmagnus.de]
User Avatar
Member
90 posts
Joined: March 2013
Offline
Whoa nice! And only in 3 lines of code. Pretty impressive.
User Avatar
Member
2036 posts
Joined: Sept. 2015
Offline
I've added two nodes colored red.

The first one is not really necessary and could have simply used one of the bbox functions in the second wrangle. But since I don't know what it is you want to do overall, I just did ‘brute force’ for max-distance.

But you can use the ramps to adjust to your hearts content in the Controls folder of the second red wrangle.
Edited by BabaJ - March 20, 2018 20:00:54

Attachments:
normalsTest.hiplc (91.1 KB)

  • Quick Links