Re: glDrawPixels.

New Message Reply Date view Thread view Subject view Author view

Benedikt Kessler (bjk++at++benedikt.munich.sgi.com)
Mon, 3 Feb 1997 12:29:32 +0100


Hi!

If you know where your current rasterpos is, you can move the starting
point of your bitmap relative to this position in screen pixel coordinates
using the glBitmap command (see an example fragment below).

In the example the glBitmap call will not draw anything; just move the
rasterpos.

As long as your glRasterPos3f is not clipped the resulting coordinate will
not be clipped. I know it works for bitmaps; should be the same for images
drawn with glDrawPixels.

Bye! Benedikt

GLvoid
printInputCommands( void *font )
{
        static char *lmouse = "left mouse - change incidence & azimuth";
        static char *mmouse = "middle mouse - change twist";
        static char *rmouse = "right mouse - zoom in and out";
        static char *Rkey = "R key - reset view";
        static GLubyte pseudoBitmap[] = { 0 };

        GLfloat xoffset, yoffset;
        GLsizei winHeight = glutGet(GLUT_WINDOW_HEIGHT);
        GLsizei winWidth = glutGet(GLUT_WINDOW_WIDTH);

        xoffset = -winWidth/2+15.0;
        yoffset = winHeight/2-30.0;
        glRasterPos3f( 0.0, 0.0, 0.0 );
        glBitmap(1, 1, 0.0, 0.0, xoffset, yoffset, pseudoBitmap);
        renderBitmapString( font, lmouse );

        yoffset -= 23.0;
        glRasterPos3f( 0.0, 0.0, 0.0 );
        glBitmap(1, 1, 0.0, 0.0, xoffset, yoffset, pseudoBitmap);
        renderBitmapString( font, mmouse );

        yoffset -= 23.0;
        glRasterPos3f( 0.0, 0.0, 0.0 );
        glBitmap(1, 1, 0.0, 0.0, xoffset, yoffset, pseudoBitmap);
        renderBitmapString( font, rmouse );

        yoffset -= 23.0;
        glRasterPos3f( 0.0, 0.0, 0.0 );
        glBitmap(1, 1, 0.0, 0.0, xoffset, yoffset, pseudoBitmap);
        renderBitmapString( font, Rkey );
}

On Feb 3, 11:34am, ceti wrote:
...
> A little Open GL question!
> I need to display a bitmap ( scannep map or aerial photo ) and animate
on
> it in a 2D navigation tool.
> I have already done this 4 years ago under HP starbase and Iris GL.
> Under OpenGL that 's good, but here there a difference between OpenGL
and
> Iris GL.
> When I zoom in or translate the bitmap, the glRasterPos doesn't work if
> the designated point is out of the screen.
>
> So how can I dispay this bitmap if the lower left coordinate is outside
> the screen (too left or too low) ???
> Is there a special trick, an other command to place the first coordinate
> out side the viewport ??
>
> Thanks,

-- 
+---------------------------------+----------------------------------+
|Benedikt J. Kessler              | Silicon Graphics GmbH            |
|Training Munich                  | Am Hochacker 3 - Technopark      |
|Silicon Graphics Computer Systems| 85630 Grasbrunn-Neukeferloh, FRG |
|    ---  __o       ,__o          |                                  |
| ------_ \<,_    _-\_<,          | Phone: (+int) 89 46108-212 or -0 |
|----- (*)/ (*)  (*)/'(*)         | Fax:   (+int) 89 46108-190 or 222|
+---------------------------------+----------------------------------+
|Network: <bjk++at++munich.sgi.com>                                       |
+--------------------------------------------------------------------+
=======================================================================
List Archives, FAQ, FTP:  http://www.sgi.com/Technology/Performer/
            Submissions:  info-performer++at++sgi.com
        Admin. requests:  info-performer-request++at++sgi.com

New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:54:34 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.