List of Screen-Time-Value Macros

3DS Max Plug-In SDK

List of Screen-Time-Value Macros

The following macros are available for use when working with Track View. These are used to scale into and out of screen space.

#define TimeToScreen(t,scale,scroll)

(int(floor((t)*(scale)+0.5)) - (scroll))

Given a TimeValue t, if you have the time scale and time scroll factors, this macro returns the screen space X for that time.

#define ScreenToTime(s,scale,scroll)

((int)floor((s)/(scale) + (scroll)/(scale)+0.5))

Given a screen coordinate s, if you have the scale and scroll factors, this macro will return a TimeValue for that screen position.

#define ValueToScreen(v,h,scale,scroll)

(h-int(floor((v)*(scale)+0.5)) - (scroll))

Given a Value v, if you have the value scale and value scroll factors, this macro returns the screen space Y for that value.

#define ScreenToValue(s,h,scale,scroll)

((float(h)-(float(s)+float(scroll)))/(scale))

Given a screen coordinate s, if you have the scale and scroll factors, this macro will return a value for that screen position.