Snippets

John Martini remap a maxscript value

Created by John Martini
1
2
3
4
5
6
7
8
9
fn remap_value val from1 to1 from2 to2 =
(
	return ((val - from1) / (to1 - from1) * (to2 - from2) + from2)
)

mult = remap_value ang 0 180 1.0 0.0

-- inverse
mult = remap_value ang 0 180 0.0 1.0

Comments (0)

HTTPS SSH

You can clone a snippet to your computer for local editing. Learn more.