Switch to orthographic projection
This commit is contained in:
parent
47b2c13c99
commit
bb3ebb0244
@ -87,22 +87,11 @@ sub Resize {
|
|||||||
|
|
||||||
glMatrixMode(GL_PROJECTION);
|
glMatrixMode(GL_PROJECTION);
|
||||||
glLoadIdentity();
|
glLoadIdentity();
|
||||||
my_gluPerspective(45, $x/$y, .5, 100);
|
glOrtho(-$x/2, $x/2, -$y/2, $y/2, 0.5, 100);
|
||||||
|
|
||||||
glMatrixMode(GL_MODELVIEW);
|
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 {
|
sub DESTROY {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user