svdelle

04-05-2004, 04:23 AM

I'm trying to get this ball to scale based on the distance to another object.

Imagine thousands of balls (sized 1m in diameter for easy math) placed in colums and rows (like a grid).

Now I want these balls to scale from 0 (or very close to) to 1 based on the position of a Null. I want each ball to be 1m in diameter if the Null is placed directly at the same position as the ball (that is on the groundplane x,z plane - Y should not be concidered) and slowly decrease in size as the Null moves away from the ball (making other balls scale up as it gets closer to them).

I guess I'll have to calculate the distance (radius in some way) from each balls center to the Null, and based on that distance, set the scale of the ball.

I don't know whether this is a job for LScript or Expressions. I've tried to use Expression in a very simple way, just for testing. [ball.Scale.X] = [manip.Position.X], but this seems to make the ball follow the Null (called manip) instead of scaling it.

Any hints for pointing me in the right direction?

Thanks

Imagine thousands of balls (sized 1m in diameter for easy math) placed in colums and rows (like a grid).

Now I want these balls to scale from 0 (or very close to) to 1 based on the position of a Null. I want each ball to be 1m in diameter if the Null is placed directly at the same position as the ball (that is on the groundplane x,z plane - Y should not be concidered) and slowly decrease in size as the Null moves away from the ball (making other balls scale up as it gets closer to them).

I guess I'll have to calculate the distance (radius in some way) from each balls center to the Null, and based on that distance, set the scale of the ball.

I don't know whether this is a job for LScript or Expressions. I've tried to use Expression in a very simple way, just for testing. [ball.Scale.X] = [manip.Position.X], but this seems to make the ball follow the Null (called manip) instead of scaling it.

Any hints for pointing me in the right direction?

Thanks