Jump to content

Distance fall off


Recommended Posts

Hi

I am doing the entagma tutorial where he is blending from  low poly to high poly object. In their example they are using a single point  from a sphere to create the blend as in the image below . I would like to use a piece of animated logo to reveal between the two.

Using bit of vex I found on this site I think I am getting the distance from sphere to each point on the grid but when I visualise it as Cd. It only seems to be taking a few points into account. What I expect is  black circle around the sphere. 

 

Thanks

 

image.thumb.png.8b69513c80291814cb461640669c948b.png

finddistanceB.hipnc

Link to comment
Share on other sites

Hi,

I checked your hip. In your wrangle you wrote:

vector mypt = point(1, "P", 0);
f@dist = distance(@P, mypt);

The first expression stores the position of point 0 of all your scatter points. And if you put a blast under your scatter and delete all the points except pt0, you will see the your color is transfered form this point distance.

To fix it, replace it by vector mypt = point(1, "P", @ptnum);

It will calculate the distance from all the points of your scatter. I assume it then uses the closest one. If you want to make sure you can also isolate the lowest point of you scatter. There are plenty of ways to do that:

- You can add a sort by Y after your scatter and then let this expression in your wrangle vector mypt = point(1, "P", 0); It will work because the point 0 will be the lowest on Y axis.

- You can use the minpos() vex function to get the position of the closest point from the grid.

- You can get the bbox min in vex or with and expression function and delete all the points higher than that limit.

- etc etc

I hope that helped. Have a good day!

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...