AM I TOO STUPID TO FIND 2-D GRAPHICS IN OPEN-GL??

AM I TOO STUPID TO FIND 2-D GRAPHICS IN OPEN-GL??

Post by Andy Vespe » Tue, 09 Dec 1997 04:00:00




> I have got 3-D open-gl graphics running fine in my flight sim.

> I can NOT seem to draw simple lines in 2-D, though.

> Take this example:

>         glBegin(GL_LINES);
>         glVertex2f(-50,-50);
>         glVertex2f( 50, 50);
>         glEnd();
>     glFinish();

> I do NOT get a line drawn across those pixels!

Err -- what pixels? The -50,-50 and 50,50 vertices are not
pixel addresses unless you have carefully setup the
three transformations -- modelview, projection and viewport.

OpenGL does not have 2D graphics separate from 3D graphics;
everything goes down the same (3D) pipeline.

The command:

        glVertex2f (-50.0, -50.0);

is exactly equivalent to:

        glVertex3f (-50.0, -50.0, 0.0);

which is exactly equivalent to:

        glVertex4f (-50.0, -50.0, 0.0, 1.0);

They all go through the same processing.

--
Andy V, OpenGL Alpha Geek  (never a Digital spokesperson)

(To send mail to me, change "NoSpamPlease" to "com".)

 
 
 

AM I TOO STUPID TO FIND 2-D GRAPHICS IN OPEN-GL??

Post by John Kichur » Tue, 09 Dec 1997 04:00:00




> > I have got 3-D open-gl graphics running fine in my flight sim.

> > I can NOT seem to draw simple lines in 2-D, though.

> > Take this example:

> >         glBegin(GL_LINES);
> >         glVertex2f(-50,-50);
> >         glVertex2f( 50, 50);
> >         glEnd();
> >     glFinish();

> > I do NOT get a line drawn across those pixels!

> Err -- what pixels? The -50,-50 and 50,50 vertices are not
> pixel addresses unless you have carefully setup the
> three transformations -- modelview, projection and viewport.

> OpenGL does not have 2D graphics separate from 3D graphics;
> everything goes down the same (3D) pipeline.

> The command:

>         glVertex2f (-50.0, -50.0);

> is exactly equivalent to:

>         glVertex3f (-50.0, -50.0, 0.0);

> which is exactly equivalent to:

>         glVertex4f (-50.0, -50.0, 0.0, 1.0);

> They all go through the same processing.

Also, 2D vertices have Z=0, and thus may be getting clipped
by the near clipping plane. If you think the projections and
viewport are setup correctly, you can do a quick test: Try
translating the  scene in the -Z direction using
glTranslatef(0.,0.,-some_value);.

- John

> --
> Andy V, OpenGL Alpha Geek  (never a Digital spokesperson)

> (To send mail to me, change "NoSpamPlease" to "com".)

--
________________________________________________________________________
John Kichury       Ph : 973-299-5713    Silicon Graphics, Cray Research
Systems Engineer   Fax:(973)263-8302    300 Interpace Parkway


 
 
 

1. Am I stupid or is Adobe stupid?

After trying to figure out why my web pictures look so bad, I found yet
another thing that makes me wonder what the heck Adobe is thinking.

I have PS7 set to work in the Adobe RGB working space through the color
preferences panel.  I open up my Adobe RGB files, *CONVERT* them to sRGB,
then "Save for the Web", but Photoshop still saves these files in the Adobe
RGB color space because that is my working space!!  Thus, my web images look
like garbage.  If a file is converted to be sRGB, shouldn't Adobe think that
it should be saved out as sRGB, regardless of your working space??
Especially if you are "saving for web"???  Geez...

Setting my working space to sRGB fixes the problem, but I still think it's
stupid that you should have to do this.

2. Algorithm to interpolate function inside of polygon

3. Am I missing something about open GL?

4. lost Z-buffer tutorial

5. Finding points in Open Gl Translations?

6. MoonThrone.com is looking for 3D Artists.

7. Where Can I Find Open GL

8. Stupid Beginner Question, but I am stuck!

9. Maybe I am just stupid

10. Am I just stupid or what?

11. Boy, am I stupid?

12. am i that stupid?