I know this is an openGL question, but the openGL newgroup has very little 
activity.  I was hoping someone here might be able to shed some light on this 
problem.

I am trying to determine how to draw a dot in openGL (for a class project).

This code will draw a triangle, but why does the for loop not draw a green 
diagonal line?  What state in openGL would do that?

  int i;
//         float c[] = {(float)$r, (float)$g, (float)$b};
  float c[3];
  c[0] = 0.0;
  c[1] = 1.0;
  c[2] = 0.0;
  for (i = 1; i < 100; i++) {
    glRasterPos2i (i, i);
    glDrawPixels(1, 1, GL_RGB, GL_FLOAT, c);     
  };
  glRotatef( 1.0f, 0.0f, 0.0f, 1.0f );
  glBegin( GL_TRIANGLES );
    glColor3f( 1.0f, 0.0f, 0.0f ); glVertex2f( 0.0f, 1.0f );
    glColor3f( 0.0f, 1.0f, 0.0f ); glVertex2f( 0.87f, -0.5f );
    glColor3f( 0.0f, 0.0f, 1.0f ); glVertex2f( -0.87f, -0.5f );
  glEnd();
  glPopMatrix();


Thanks and best regards,

Jimmy J. Johnson

 


Reply via email to