# 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

##### Share on other sites

seems the file didnt upload correctly.

finddistanceB.hipnc

Edited by Dubtronics

##### Share on other sites

Hi,

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!

• 1

##### Share on other sites

Thanks for pointing me in the right direction, after a bit of trial and error and copying of random bits of vex I have something working althought it dosent make sense to me 100%. i  have attached the file in case some one find its it useful.

finddistance_working.hipnc

• 1

##### Share on other sites

@Dubtronics Thanx

## Create an account

Register a new account