No color shown in this simple code?

glBegin(GL_QUADS);
	glColor3f(0.0,1.0,1.0);
	glVertex2f(0.0,-0.15);
	glVertex2f(0.0, 0.35);
	glVertex2f(0.35,0.35);
	glVertex2f(0.35,-0.15);
	glEnd();
	glFlush();

This is a simple code to draw a quad, I want it is a blue one, but no blue color appears, what’s matter?

Do you mean that nothing is drawn or that the color is not the one you want?

Also, (0.0,1.0,1.0) is more turquoise than blue.

[QUOTE=Agent D;1265582]Do you mean that nothing is drawn or that the color is not the one you want?

Also, (0.0,1.0,1.0) is more turquoise than blue.[/QUOTE]
Just no color I want, it is (0.0, 0.0, 1.0), not (0,1,1).

using version3.3, do the glbegin and glend still valid?

Assuming you created a compatibility context, yes.

then, what’s matter with the color shown?

If changing the value you pass for glColor gets you a different color, then it seems clear that the problem is not with the code you’ve shown. Perhaps you could try playing with the given color and seeing if you can determine some kind of pattern as to which colors you get.

Also, you said, "Just no color I want, it is (0.0, 0.0, 1.0), not (0,1,1). ". How do you know that the color you’re getting is (0, 0, 1) rather than (0, 1, 1)? That is, what are you comparing the color you get to, such that you know that it’s not the right color?

[QUOTE=Alfonse Reinheart;1265599]
Also, you said, "Just no color I want, it is (0.0, 0.0, 1.0), not (0,1,1). ". How do you know that the color you’re getting is (0, 0, 1) rather than (0, 1, 1)? That is, what are you comparing the color you get to, such that you know that it’s not the right color?[/QUOTE]
is Not how know, I enforce it to show(or render) in such color. I assign it this color. or toher color as well.

That’s very simple, just see the result from exacutable file. run it.

If changing the value you pass for glColor gets you a different color, then it seems clear that the problem is not with the code you’ve shown. Perhaps you could try playing with the given color and seeing if you can determine some kind of pattern as to which colors you get.

We can easily think of that naturally. as I said, no matter how I change the value of color, it obstinately persist one color.
but when use default redering pipeline, it can show graduate color inside.

According to books, to guides, to all or any docs, this is absolute standard written.

We can easily think of that naturally. as I said, no matter how I change the value of color, it obstinately persist one color.
but when use default redering pipeline, it can show graduate color inside.

I don’t know what you mean by “show graduate color inside” (I’m guessing you’re referring to a “gradient” of colors). But you spoke of the “default redering[sic] pipeline”. Does that mean that you’re not using the “default redering pipeline” normally? What do you mean by the “default” pipeline; are you referring to the fixed function pipeline? Does that mean that your example code was originally using shaders?

So it is, it’s gradient. and rendering. I think a native-speaking eng can recognize it easily and promptly.

What do you mean by the “default” pipeline; are you referring to the fixed function pipeline? Does that mean that your example code was originally using shaders?

What it is uniform shader or fixed is not problem. I havn’t yet use any functional glsl.
If I draw the triangle by shader(vao,vbo0, it has default gradient color inside(the triangle). but when I draw the triangle like above code, its color can not be changed.

After reading through some of the earlier posts in this thread, I think I came across a statement that shed some light on the problem:

it obstinately persist one color.

Is your problem that you’re not getting the color you want, or that there is no color gradient? (these are in fact two different problems).

If so, first, you should have said that earlier; it shouldn’t have taken you 9 posts before the word “gradient” came up. Second, why would you expect to see a color gradient? To get the “default gradient color inside(the triangle)”, you had to pass an array of colors along with an array of positions. Your fixed-function quad has 4 positions, but only 1 color.

If you want a color gradient, then you need to provide multiple colors to be interpolated across. One for each vertex. Just like your shader example.

[QUOTE=Alfonse Reinheart;1265617]After reading through some of the earlier posts in this thread, I think I came across a statement that shed some light on the problem:

Is your problem that you’re not getting the color you want, or that there is no color gradient? (these are in fact two different problems).

If so, first, you should have said that earlier; it shouldn’t have taken you 9 posts before the word “gradient” came up. Second, why would you expect to see a color gradient? To get the “default gradient color inside(the triangle)”, you had to pass an array of colors along with an array of positions. Your fixed-function quad has 4 positions, but only 1 color.

If you want a color gradient, then you need to provide multiple colors to be interpolated across. One for each vertex. Just like your shader example.[/QUOTE]
I wonder if you are vague, or you intend to mislead the content, the last thing I 'll see.

you needn’t waste either your time or my time at that meaningfulless trick.
of cuase you can keep picking up interesting letters or words to confuse the thread. and show how your eng is good. and even choose sentences to analysis from grammar or custom, that is really not pure englsih. Indeed, I like to hear that and read your conclusion.

Well, the problem is how to get a different color for different objects in a code?(blue or cyn or otherwise) if you can go further more to make two different complex gradient triangles or quads, that will be aslo wecome.

You’d better be pleased with finding why there is no 's followed the persist? that is very important to taunt.

I get it. it’s issue of switcher. Now the beautiful graphics with a riot of colors are shown on the screen.

not bad to argue the off topic with one.