Orhographic Projection を使用し、次のような reshape 関数があると仮定します。
void reshape(f32 width, f32 height){
aspect = width/height;
glViewport(0, 0, width, height);
// guaranted 960x640 HUD canvas
if(640*aspect>=960){
ortho.x = 640*aspect;
ortho.y = 640;
}else{
ortho.x = 960;
ortho.y = 960/aspect;
}
glOrtho(0, ortho.x, ortho.y, 0, -1.0f, 1.0f);
}
すべての頂点 >ortho.x または >ortho.y (通常はオフスクリーン) が描画されていないことを確認するにはどうすればよいですか? ウィンドウを 1.5f (960/640) より大きな縦横比の何かにスケーリングすると、オブジェクトが表示されますが、完全には表示されません (ビューポートがウィンドウのように大きいため)。正投影で切り抜き枠のようなものはありますか?