opengl – Strip separating gentle from shadow

opengl – Strip separating gentle from shadow

[ad_1]

I’ve a stripe separating gentle from shadow (I don’t have shadows), it strikes with the digital camera.

enter image description here

Opengl code:

glPolygonMode(GL_FRONT, GL_FILL);
glPolygonMode(GL_BACK, GL_FILL);
glEnable(GL_DEPTH_TEST);

glEnable(GL_NORMALIZE);

glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);

glEnable(GL_STENCIL_TEST);
glStencilOp(GL_KEEP, GL_KEEP, GL_REPLACE);

glEnable(GL_TEXTURE_2D);
glEnable(GL_COLOR_MATERIAL);

GLfloat light_position[] = { 0.0, 0.0, 0.0, -1.0 };

glLightfv(GL_LIGHT0, GL_POSITION, light_position);

glEnable(GL_LIGHT0);

glEnable(GL_LIGHTING);

glEnable(GL_FOG);
glFogi(GL_FOG_MODE, GL_EXP2);
glFogfv(GL_FOG_COLOR, config::fog_color);
glFogf(GL_FOG_DENSITY, 0.014);
glHint(GL_FOG_HINT, GL_FASTEST);

Cubes code:

glColor4f(coloration.x, coloration.y, coloration.z, transparency / 255.0);

glBegin(GL_QUADS);

glVertex3f(-size / 2, -size / 2, -size / 2);
glVertex3f(-size / 2, dimension / 2, -size / 2);
glVertex3f(-size / 2, dimension / 2, dimension / 2);
glVertex3f(-size / 2, -size / 2, dimension / 2);

glVertex3f(dimension / 2, -size / 2, -size / 2);
glVertex3f(dimension / 2, -size / 2, dimension / 2);
glVertex3f(dimension / 2, dimension / 2, dimension / 2);
glVertex3f(dimension / 2, dimension / 2, -size / 2);

glVertex3f(-size / 2, -size / 2, -size / 2);
glVertex3f(-size / 2, -size / 2, dimension / 2);
glVertex3f(dimension / 2, -size / 2, dimension / 2);
glVertex3f(dimension / 2, -size / 2, -size / 2);

glVertex3f(-size / 2, dimension / 2, -size / 2);
glVertex3f(-size / 2, dimension / 2, dimension / 2);
glVertex3f(dimension / 2, dimension / 2, dimension / 2);
glVertex3f(dimension / 2, dimension / 2, -size / 2);

glVertex3f(-size / 2, -size / 2, -size / 2);
glVertex3f(dimension / 2, -size / 2, -size / 2);
glVertex3f(dimension / 2, dimension / 2, -size / 2);
glVertex3f(-size / 2, dimension / 2, -size / 2);

glVertex3f(-size / 2, -size / 2, dimension / 2);
glVertex3f(dimension / 2, -size / 2, dimension / 2);
glVertex3f(dimension / 2, dimension / 2, dimension / 2);
glVertex3f(-size / 2, dimension / 2, dimension / 2);
glEnd();

[ad_2]

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply