void YsInverseViewportTransformation(YsVec3 &vOut,const YsVec3 &vIn,const int viewport[4]) { vOut.SetX((vIn.x()-(double)viewport[0])*2.0/(double)viewport[2]-1.0); vOut.SetY((vIn.y()-(double)viewport[1])*2.0/(double)viewport[3]-1.0); }
void YsViewportTransformation(YsVec3 &vOut,const YsVec3 &vIn,const int viewport[4]) { vOut.SetX((double)viewport[0]+(double)viewport[2]*(vIn.x()+1.0)/2.0); vOut.SetY((double)viewport[1]+(double)viewport[3]*(vIn.y()+1.0)/2.0); }