Switch to orthographic projection

xs
Guillaume Seguin 2013-06-29 10:43:35 +02:00
parent 47b2c13c99
commit bb3ebb0244
1 changed files with 1 additions and 12 deletions

View File

@ -87,22 +87,11 @@ sub Resize {
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
my_gluPerspective(45, $x/$y, .5, 100);
glOrtho(-$x/2, $x/2, -$y/2, $y/2, 0.5, 100);
glMatrixMode(GL_MODELVIEW);
}
sub my_gluPerspective {
my ($fov, $ratio, $near, $far) = @_;
my $top = tan(deg2rad($fov)*0.5) * $near;
my $bottom = -$top;
my $left = $ratio * $bottom;
my $right = $ratio * $top;
glFrustum( $left, $right, $bottom, $top, $near, $far );
}
sub DESTROY {
my $self = shift;