OpenGL simple question

Hi,

I know this is not a list for OpenGL doubts, but i believe a lot of
people uses OpenGl here and this is a simple question… i think…

I’m trying to draw a plain color quad, but it only appear in black.
The only way i have to see the quad (or everything else i draw) is
applying a texture to it.

glColor3f(1.0f,1.0f,1.0f);
glBegin(GL_QUADS);
glTexCoord2f(0,0);
glVertex3f(hw,-hh,-hh);
glTexCoord2f(1,0);
glVertex3f(-hw,-hh,-hh);
glTexCoord2f(1,1);
glVertex3f(-hw,hh,-hh);
glTexCoord2f(0,1);
glVertex3f(hw,hh,-hh);
glEnd();

I even tried to disable CULL_FACE attribue, but nothing…

What else can affect the viewing of what we draw?

Thx

Best regards,

Nuno

Put your glColor3f() statement inside your glBegin() … glEnd()
stanza, like this:

glBegin(GL_QUADS);
glColor3f(1.0f,1.0f,1.0f);
glTexCoord2f(0,0);
glVertex3f(hw,-hh,-hh);
glTexCoord2f(1,0);
glVertex3f(-hw,-hh,-hh);
glTexCoord2f(1,1);
glVertex3f(-hw,hh,-hh);
glTexCoord2f(0,1);
glVertex3f(hw,hh,-hh);
glEnd();On 12/9/06, Nuno Santos wrote:

I’m trying to draw a plain color quad, but it only appear in black. The only
way i have to see the quad (or everything else i draw) is applying a texture
to it.


Rasmus Neckelmann

If you just want a colored quad, take away the glTexCoord commands,
you don’t need those. If you still get nothing, check that -hh is
within your visible depth range.
Good luck!On 12/9/06, Nuno Santos wrote:

Hi,

I know this is not a list for OpenGL doubts, but i believe a lot of people
uses OpenGl here and this is a simple question… i think…

I’m trying to draw a plain color quad, but it only appear in black. The only
way i have to see the quad (or everything else i draw) is applying a texture
to it.

glColor3f(1.0f,1.0f,1.0f);
glBegin(GL_QUADS);
glTexCoord2f(0,0);
glVertex3f(hw,-hh,-hh);
glTexCoord2f(1,0);
glVertex3f(-hw,-hh,-hh);
glTexCoord2f(1,1);
glVertex3f(-hw,hh,-hh);
glTexCoord2f(0,1);
glVertex3f(hw,hh,-hh);
glEnd();


Anthony Lenton
Except - http://except.com.ar

Hi,

Did i got you right: you can see the quad, if you apply a texture to it?
If so, you might haven’t disabled texturing. glBindTexture(…, 0) is
not sufficient, you have to do glDisable(GL_TEXTURE2D).
If texturing also doesn’t work, check if lighting is disabled
(glDisable(GL_LIGHTING)).

Matthias

Nuno Santos schrieb:> Hi,

I know this is not a list for OpenGL doubts, but i believe a lot of
people uses OpenGl here and this is a simple question… i think…

I’m trying to draw a plain color quad, but it only appear in black.
The only way i have to see the quad (or everything else i draw) is
applying a texture to it.

glColor3f(1.0f,1.0f,1.0f);
glBegin(GL_QUADS);
glTexCoord2f(0,0);
glVertex3f(hw,-hh,-hh);
glTexCoord2f(1,0);
glVertex3f(-hw,-hh,-hh);
glTexCoord2f(1,1);
glVertex3f(-hw,hh,-hh);
glTexCoord2f(0,1);
glVertex3f(hw,hh,-hh);
glEnd();

I even tried to disable CULL_FACE attribue, but nothing…

What else can affect the viewing of what we draw?

Thx

Best regards,

Nuno


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

Hi guys,

Thx for the help. I’ve managed to solve this issue already.

It seems that the emails are a little bit lagged… no?

Cheers,

Nuno

Matthias Weigand escreveu:> Hi,

Did i got you right: you can see the quad, if you apply a texture to it?
If so, you might haven’t disabled texturing. glBindTexture(…, 0) is
not sufficient, you have to do glDisable(GL_TEXTURE2D).
If texturing also doesn’t work, check if lighting is disabled
(glDisable(GL_LIGHTING)).

Matthias

Nuno Santos schrieb:

Hi,

I know this is not a list for OpenGL doubts, but i believe a lot of
people uses OpenGl here and this is a simple question… i think…

I’m trying to draw a plain color quad, but it only appear in black.
The only way i have to see the quad (or everything else i draw) is
applying a texture to it.

glColor3f(1.0f,1.0f,1.0f);
glBegin(GL_QUADS);
glTexCoord2f(0,0);
glVertex3f(hw,-hh,-hh);
glTexCoord2f(1,0);
glVertex3f(-hw,-hh,-hh);
glTexCoord2f(1,1);
glVertex3f(-hw,hh,-hh);
glTexCoord2f(0,1);
glVertex3f(hw,hh,-hh);
glEnd();

I even tried to disable CULL_FACE attribue, but nothing…

What else can affect the viewing of what we draw?

Thx

Best regards,

Nuno


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

Hi, what was your solution?

Thanks,

jim

Nuno Santos wrote:> Hi guys,

Thx for the help. I’ve managed to solve this issue already.

It seems that the emails are a little bit lagged… no?

Cheers,

Nuno