IkerCLoN
10-26-2008, 12:31 PM
Hi, folks! Those days I'm playing with math formulas at home, for trying to improve my math skills as well as understanding how to implement them in MAXScript. I was trying to make a 'sphere constraint' for a point, so it's always moving on a surface of a sphere.
In my way on doing that, and checking some other things, I came across a little problem that I'm going to reproduce here. You need one sphere and one point on your scene. I want the radius of the sphere to be measured by the distance between the center of that sphere and the point. There it comes the script controller you should use in the Radius track:
sqrt (($Point02.pos.x - $Sphere01.pos.x)^2 + ($Point02.pos.y - $Sphere01.pos.y)^2 + ($Point02.pos.z - $Sphere01.pos.z)^2)
It works fine, but the scene only is redrawn when I play the scene or I move the timeline slider forward and backwards. I'd like to have it 'in real time', so as I move the point in the 3D space, the radius on the sphere changes.
Could you help me out on this? Thanks!
In my way on doing that, and checking some other things, I came across a little problem that I'm going to reproduce here. You need one sphere and one point on your scene. I want the radius of the sphere to be measured by the distance between the center of that sphere and the point. There it comes the script controller you should use in the Radius track:
sqrt (($Point02.pos.x - $Sphere01.pos.x)^2 + ($Point02.pos.y - $Sphere01.pos.y)^2 + ($Point02.pos.z - $Sphere01.pos.z)^2)
It works fine, but the scene only is redrawn when I play the scene or I move the timeline slider forward and backwards. I'd like to have it 'in real time', so as I move the point in the 3D space, the radius on the sphere changes.
Could you help me out on this? Thanks!
