plz help!!

i do the rigth code to show me a triangle… but no way… i didnt seen my triangle in my form…
can anybody help me??

How do you know you have the right code? Make sure you have the triangle within the viewing area. Make sure you are drawing it a different colour to the background.

ok… i copy the code of the program11, and… i cant see my triangle… does the code is complete…if it imcomplete… what the rest of the code plz… im a really beginner…

code please

One common beginner mistake is to forget to translate things into the viewing volume.

In many tutorials, the neat clipping plane is set to 1, so if you try to draw a triangle in XY plan without translating it, it will be culled.

glVertex3f(-1.0f, -1.0f, 0.0f);
glVertex3f( 1.0f, -1.0f, 0.0f);
glVertex3f( 0.0f, 1.0f, 0.0f);

Notice that here we set near clipping plane to 1, and far clipping plane to 10.
So before rendering our triangle, we move 5 units “into the screen”.

Of course you don’t need to reset the perspective every frame. I just put it here so that you can see where are clipping planes set up.

the code like this:
void make_shape ( void )
GLUtriangulatorObj *tess;
GLdouble outside [4][3] = { { -0.9, -0.9, 0.0 },
{ 0.9, -0.9, 0.0 },
{ 0.9, 0.9, 0.0 },
{ -0.9, 0.9, 0.0 } };
GLdouble inside [3][3] = { { 0.0, 0.3, 0.0 },
{ 0.3, -0.3, 0.0 },
{ -0.3, -0.3, 0.0 } };
list[0] = glGenLists ( 1 );
tess = gluNewTess ( );
gluTessCallback ( tess, GLU_BEGIN, ( void ( __stdcall *) ( void ))glBegin );
gluTessCallback ( tess, GLU_VERTEX, ( void ( __stdcall *) ( void ))glVertex3dv );
gluTessCallback ( tess, GLU_END, glEnd );
glNewList ( list[0], GL_COMPILE );
gluBeginPolygon ( tess );
for ( int i = 0; i < 4; i++ )
gluTessVertex ( tess, outside[i], outside[i] );
gluNextContour ( tess, GLU_INTERIOR );
for ( int i = 0; i < 3; i++ )
gluTessVertex ( tess, inside[i], inside[i] );

gluEndPolygon ( tess );
glEndList ( );
gluDeleteTess ( tess );

So im trying the code submit bye kehziah and i’ve not seen my triangle… sorry… i really not understand how to show my triangle;

Is your code supposed to draw a simple triangle?? If so, drop it. You’re taking a big hammer to squash a fly.

About the piece of code I posted :
did you properly calculate the aspect ratio of your viewport? (the “aspect” parameter in the gluPerspective call) I remind you that it is calculated by
aspect = width / height;
Be careful if you’re in windowed mode that height does not become 0, or make a test to avoid divide by 0.

with my code givin up… what u suggest that i can build and see my triangle…

How do you create your window? What are your transformation settings (MODELVIEW and PROJECTION)?

i’ve use the code gived by kehziah for my viewport and projection, i see my form in gray color that is the default givin by builder c++ … but i dont see my triangle

hm… Have you used wglMakeCurrent ()?

use the nehe tutorials if you really want to learn opengl…