Original Post
the prog i'm working on showes a cube where each face has a different texture on it. i also have lighting enabled. everything works just peachy except a new function i made that draws the origin on the screen. it uses GL_LINES to draw 3 white lines on each axis intersecting at 0, 0, 0. i set the color to white, but my lines show up black. my question is if lighting can effect the way lines are drawn, and what other possibilities there are for such undesirable effects. ie do lines require normals. . . etc...
here's my drawOrigin function
<textarea name="drawo" rows=8 cols 120>
here's where i use it
<textarea name="implementation" rows=8 cols 120>
here's my drawOrigin function
<textarea name="drawo" rows=8 cols 120>
void drawOrigin(float radius)
{
float r = radius/2.0f;
glColor3f(1.0f, 1.0f, 1.0f);
//x-axis
glBegin(GL_LINES);
glVertex3f(-r, 0.0f, 0.0f);
glVertex3f( r, 0.0f, 0.0f);
glEnd();
//y-axis
glBegin(GL_LINES);
glVertex3f(0.0f, -r, 0.0f);
glVertex3f(0.0f, r, 0.0f);
glEnd();
//z-axis
glBegin(GL_LINES);
glVertex3f(0.0f, 0.0f, -r);
glVertex3f(0.0f, 0.0f, r);
glEnd();
}
</textarea>
here's where i use it
<textarea name="implementation" rows=8 cols 120>
void view(GLvoid)
{
glMatrixMode(GL_MODELVIEW);
glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
glLoadIdentity();
glTranslatef(vector[X], vector[Y], vector[Z]);
glRotatef(angle[X], 1.0f, 0.0f, 0.0f);
glRotatef(angle[Y], 0.0f, 1.0f, 0.0f);
glRotatef(angle[Z], 0.0f, 0.0f, 1.0f);
rot +=.125f;
if(rot >= 365.000f)
rot -= 365.000f;
glColor3f(.8f, .8f, .8f);
drawCube(0.0f, 0.0f, -2.0f, 1.0f, 1.0f, 1.0f, rot);
drawOrigin(10.0f);
glFlush();
SwapBuffers(g_HDC);//bring back buffer to foreground
} </textarea>
[edited by - stond on May 18, 2003 8:23:10 PM]