Home Technical Talk

3ds Max script for interpolation between two values

polycounter lvl 5
Offline / Send Message
Matthewz polycounter lvl 5
Hi everyone! I recently made a 3D model that need to be scaled in width and length separately with different measures. For this purpose I used a morph modifier, using one channel to target at the largest model and another one to the longest, so currently I have two channels that go from 0% to 100% (you can go beyond of 100 setting the limits but that's not my case). No problem so far, the mesh deform as I want when I move the sliders.

The problem is, I need of an extra-controller (in the same object), to guide the percentage value, so I created and extra slider, called "width", that go from 90 to 180 and I used the "Wire parameter" windows dialog to connect the width parameter to the first channel of the morph modifier.
I would like to map from x-min and x-max values to y-min and y-max (for instance x-min = 90 goes to y = 0 and x-max = 180 goes to y= 100). Also I created an extra-checkbox parameter (1,0) for the length. I want the second morph channel to go from 0% to 100% when I click in the the checkbox.
I have no idea how to do this in Max :'( . I did something similar already in After Effects and Unity with a "lerp" function but unfortunately in max I can't get it work.
I know that maybe there is some function/formula behind which I need to put in the wire parameter window and that it is about interpolating two values but I'm not sure.
Can somebody help me please?

Replies

Sign In or Register to comment.