View Full Version : 3D Objects
01-07-2001, 06:34 AM
Hello there! How to draw 3D objects (Cube, Sphere, etc) by using OpenGL? I use glutSolidSphere (50.0, 200.0, 160.0); to draw a sphere but it looks like a circle, why? Do I need to use Light? Can you please show me the code of creating a 3D sphere? Thanks.
01-07-2001, 09:16 AM
You aren't setting up your worldspace correctly. Read up on gluPerspective or glOrtho on how to specify near and far clipping planes and create depth in a scene.
There is another thread, with someone who had the same problem here: http://www.opengl.org/discussion_boards/ubb/Forum2/HTML/002457.html
Most likelly you have lighting disabled, so you see the sphere in a solid, flat color (like a circle). Do this to start:
Read about these commands.
01-07-2001, 09:20 PM
Thanks for giving me the information. http://www.opengl.org/discussion_boards/ubb/smile.gif
01-07-2001, 09:45 PM
I read your question and started to wonder - hey i wonder what the hell his problem is-. (i'm sort of not new, but i don't practice enough so i don't know anything anyway) so i started playing around with the glutsphere (mine didn't look 3d at first either) and spent a whole afternoon making some program. anyway. its all simple and you might get something out of it, if you want it i'll email it to you.
modelview matrix rotations/translations
mouse and keybard input with glut
switch the scene to solid wire frame or point drawing mode
triangle strips, colors, normals
blah blah blah
it might be helpful if your real real new.
Powered by vBulletin® Version 4.2.2 Copyright © 2014 vBulletin Solutions, Inc. All rights reserved.