Notifications
Clear all
[Closed] How to get aspect ratio of current viewport/camera?
Jan 04, 2015 4:22 am
Just wondering how do I get the aspect ratio of the current viewport/camera with
the max sdk?
Thanks
Jack
1 Reply
Jan 04, 2015 4:22 am
where ip is a pointer to the max core interface
ViewExp *vpt = ip->GetActiveViewport();
GraphicsWindow *gw = vpt->getGW();
int sizeX = gw->getWinSizeX();
int sizeY = gw->getWinSizeY();
ip->ReleaseViewport(vpt);
float aspect = (float)sizeX/(float)sizeY;