hey, so im trying to do a smiley face and the i want to cut the upper half of the sphere for the mouth
this is my code
#include <windows.h>
#include <glut.h>
#include <math.h>
void display(void)
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glPushMatrix();
glColor3f(1.0, 1.0, 0.0);
glutSolidSphere(75, 75, 75);
glFlush();
glPushMatrix();
glColor3f(0.0, 0.0, 0.0);
glTranslated(30, 20, 0);
glutSolidSphere(11, 11, 11); //right eye
glFlush();
glRotatef(180, 0, 1, 1);
glPushMatrix();
glColor3f(0.0, 0.0, 0.0);
glTranslated(55, 20, 0);
glutSolidSphere(11, 11, 11); //left eye
glFlush();
glBegin(GL_LINES);
glVertex2i(70, 40);
glVertex2i(80, -40); //nose
glEnd();
GLdouble enq[4] = { 0.0,0.0,-1.0,0.0 };
glClipPlane(GL_CLIP_PLANE0, enq);
glEnable(GL_CLIP_PLANE0);
glPushMatrix();
glColor3f(1.0, 0.0, 0.0);
glTranslated(-26, 10, -50);
glutSolidSphere(20, 20, 10);
glFlush();
}
the problem I’m having is that idk what to put here >> GLdouble enq[4] = { 0.0,0.0,-1.0,0.0 };
<<
please help me
it works with me when i do this >> glTranslated(-26, 10, -0.5);
<< but i dont want these coordinates