Jump to content

  • Log In with Google      Sign In   
  • Create Account

Lyost

Member Since 13 Aug 2003
Offline Last Active Apr 16 2013 06:35 PM

Posts I've Made

In Topic: opengl not filling window

29 June 2005 - 05:39 AM

You can adjust the values passed to the call to glViewport. The typical values if you want to use the entire window is 0 (leftmost x value in pixels), 0 (topmost y value in pixels), window_size_x (rightmost x value in pixels), window_size_y (bottommost y value in pixels). So change the value of whichever one you need to. However, once you do that, you should call gluPerspective (or an equiviant function). Here's a code exept from a program where I needed to do it for creating a side bar.

glViewport(size_x - sep_x,0,sep_x,size_y);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective(45,(size_x - sep_x)/(GLfloat)size_y,.1,100);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glClear(GL_DEPTH_BUFFER_BIT);

In Topic: ms vc++ help

04 August 2004 - 01:02 AM

an alternative when using iostream (without the .h) to having to put std:: in front of all your cout and cin's is to do:

#include <iostream>
using namespace std;

int main()
{
    cout << "Hello, World\n";
    return 0;
}

sorry, accidently double posted (and forgot to fill in my passwd the first time)

In Topic: Reconstruct from a disparity map

23 July 2004 - 01:23 AM

for determining the grayscale value, how about:
y_range = max_y - min_y;
for (int i = 0; i < num_pnts; i++)
{
    gray_here = (int)((pnt[i].y - min_y) / y_range + . 5) * 255;
}

the only problem i can see with this is if original image used to create the heightmap doesn't include pure white and pure black, but the code above should produce at least one black value and one white value.

PARTNERS