KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I am not able to create a simple 3D sphere using the OpenGL library function glutSolidSphere() in C++. Here's what I tried: #include<GL/glu.h> void display() { glClear(GL_COLOR_BUFFER_BIT); glColor3f(1.0,0.0,0.0); glLoadIdentity(); glutSolidSphere( 5.0, 20.0, 20.0); glFlush(); } void myInit() { glClearColor(1.0,1.0,1.0,1.0); glColor3f(1.0,0.0,0.0); glMatrixMode(GL_PROJECTION); glLoadIdentity(); gluOrtho2D(0.0,499.0,0.0,499.0); glMatrixMode(GL_MODELVIEW); } void main(int argc,char **argv) { qobj = gluNewQuadric(); glutInit(&argc,argv); glutInitDisplayMode(GLUT_SINGLE|GLUT_RGB); glutInitWindowSize(500,500); glutCreateWindow("pendulum"); glutDisplayFunc(display); myInit(); glutMainLoop(); }
Tags (comma-separated)
Save Edits
Cancel