Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 2 of 2

Thread: Achieving quality postscript

  1. #1
    Junior Member Newbie
    Join Date
    May 2004
    Posts
    2

    Achieving quality postscript

    Hi OpenGL

    I found this link from the official site of opengl. The example from this link works just fine. But i tried to add some code that display some text. So from the red book (chapter 8) i copy some code (see below) and try to compile and run the whole application. Everything is fine until i run the application. I see all the examples (torus and teapot) but i dont see the letters that i include to the examples. maybe i did something wrong and hope someon can tell me what.

    linkt to the article:
    http://www.opengl.org/resources/code...ript#first_hit

    code that i add:
    GLubyte rasters[24] = {
    0xc0, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0xc0, 0x00,
    0xc0, 0x00, 0xff, 0x00, 0xff, 0x00, 0xc0, 0x00,
    0xc0, 0x00, 0xc0, 0x00, 0xff, 0xc0, 0xff, 0xc0}; // contains the letter f

    //add to the render function and changed case 0 from glutSolidSphere(..) to this
    glClear(GL_COLOR_BUFFER_BIT);
    glColor3f(1.0, 1.0, 1.0);
    glRasterPos2i (20.5, 20.5);
    glBitmap(10, 12, 0.0, 0.0, 12.0, 0.0, rasters);
    glBitmap(10, 12, 0.0, 0.0, 12.0, 0.0, rasters);
    glBitmap(10, 12, 0.0, 0.0, 12.0, 0.0, rasters);

    regards

  2. #2
    Junior Member Regular Contributor
    Join Date
    Jun 2001
    Posts
    198

    Re: Achieving quality postscript

    Originally posted by naruto:
    Hi OpenGL

    I found this link from the official site of opengl. The example from this link works just fine. But i tried to add some code that display some text. So from the red book (chapter 8) i copy some code (see below) and try to compile and run the whole application. Everything is fine until i run the application. I see all the examples (torus and teapot) but i dont see the letters that i include to the examples. maybe i did something wrong and hope someon can tell me what.

    linkt to the article:
    http://www.opengl.org/resources/code/rendering/mjktips/Feedback.html?opengl +to+postscript#first_hit
    [...]
    regards
    If you read the code you'll see that the method doesn't work for textured rendering (bitmap are textures at the end of the day):
    Be warned that operations such as depth testing (for hidden surface removal) and texturing and blending are therefore not available in feedback mode.
    So it only works with colored geometry (it defines & uses the postscript function gouraudtriangle to render all the geometry).

    A quick fix is to use geometry for text instead of bitmaps (in Windows it would be wglUseFontOutlines function).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •