Click here to Skip to main content
15,890,512 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
please Explain that how to create circle
how to use funcations
#include <Windows.h>
#include <GL\glew.h>
#include <GL\freeglut.h>
#include <iostream>

using namespace std;


void init(void)
{
	glClearColor(0.0, 0.0, 1.0, 0.0);
	glMatrixMode(GL_PROJECTION);
	gluOrtho2D(0.0, 300.0, 0.0, 170.0);

}

void DrawSnowman(void)
{

	glColor3f(1.0, 1.0, 1.0);

	
	glTranslatef(70, 100, 3.00);
	glutSolidSphere(12.0, 30, 50);






	glFlush();

}
void main(int argc, char** argv)
{
	glutInit(&argc, argv);

	glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);
	glutInitWindowPosition(0, 0);
	glutInitWindowSize(1366, 768);
	glutCreateWindow("Snowman");
	init();
	glutDisplayFunc(DrawSnowman);
	glutMainLoop();
}


What I have tried:

i am tried but not fill the color in the circle
this is code
Posted
Updated 9-Mar-18 6:47am
Comments
CPallini 8-Mar-18 7:32am    
Sorry, what circle?

1 solution

Your question is really not clear. If I understand you correctly, you can make a circle (assuming you mean the two dimensional shape) from a solid sphere by setting the z scaling factor to zero (1,1,0) and that should flatten the sphere and make it into a circle.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900