Skip to content

Commit

Permalink
fdsafd
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmedtd committed May 25, 2012
1 parent 60fa848 commit b0e7f14
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
4 changes: 2 additions & 2 deletions assignment-2/scan-convert.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -452,8 +452,8 @@ void reshapeCallback(int new_width, int new_height)
clip_tl.x(0);
clip_tl.y(window_height);

clip_br.x(window_width);
clip_br.y(0);
clip_br.x(window_width);
clip_br.y(0);
}

// Update the projection matrix to account for the window shape
Expand Down
13 changes: 13 additions & 0 deletions assignment-5/raytrace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -457,9 +457,22 @@ void keyboardCallback(unsigned char key, int x, int y)

void reshapeCallback(int new_width, int new_height)
{
double pixels_per_meter = 20;

renderbuffer.reshape(new_width, new_height);

glViewport(0, 0, new_width, new_height);

glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(0.0,
((double)new_width)/pixels_per_meter,
((double)new_width)/pixels_per_meter,
0.0,
-1.0,
1.0);

glMatrixMode(GL_MODELVIEW);
}

int main(int argc, char **argv)
Expand Down

0 comments on commit b0e7f14

Please sign in to comment.