Exemplo n.º 1
0
  virtual void init()
  {
    // Initialize OpenKernel
    kernel = kernelInit();

    // Open window
    mainDisplay = kernel->beginDisplay(0, "Main", true, 200, 150);
    kernel->endDisplay();
    if(mainDisplay == 0)
      return;

    displayChain = kernel->beginDisplayChain();

      kernel->display(mainDisplay, -1.0f, -1.0f, 1.0f, 1.0f);

    kernel->endDisplayChain();

    //(resize screen)
    glMatrixMode(GL_PROJECTION);
    glLoadIdentity();
    glViewport(0, 0, 200, 150);
    glFrustum(-1.f, 1.f, -800.0f/600.0f, 800.0f/600.0f, 1.0f, 100.0f);
    glMatrixMode(GL_MODELVIEW);

    glShadeModel(GL_SMOOTH);
    glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
    glClearDepth(1.0f);
    glEnable(GL_DEPTH_TEST);
    glDepthFunc(GL_LEQUAL);
    glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);
    glFlush();
  }
Exemplo n.º 2
0
int main()
{
    Matrix matrix;
    Kernel kernel;

    matrix.convoluted(kernel);

    cout << "RANDOMLY GENERATED 8X8 MATRIX" << endl;
    cout << "VALUES ARE BETWEEN 0 AND 9" << endl;
    matrix.displayGrid();
    cout << "RANDOMLY GENERATED 3X3 KERNEL MATRIX" << endl;
    cout << "VALUES ARE BETWEEN 0 AND 1" << endl;
    kernel.display();
    cout << "6X6 GRID AFTER CONVOLUTION" << endl;
    matrix.displayCMatrix();
}