PDA

View Full Version : 3d objects in 2d world.



iNsaNEiVaN
05-06-2002, 05:59 PM
I want to use glusphere() to make a sphere, but in a 2d world. Using the 2d coord function, gluOrtho2D(0, 640, 0, 480), the sphere doesn't appear correctly. What am I doing wrong?

Shag
05-06-2002, 06:44 PM
Is the sphere square?

If not what is the problem you are encountering? MORE INFO please!!!!

More seriously ... is it a lighting issue?

Regards

iNsaNEiVaN
05-07-2002, 11:36 AM
Only the outline is being drawn.

Deiussum
05-07-2002, 12:17 PM
Only an outline as in, it looks like a disk? If that's the case, it sounds like you haven't enabled lighting.

V-man
05-07-2002, 12:50 PM
It should by default draw all polygons filled, but you get get outline then use

gluQuadricDrawStyle

and give it GLU_FILL

V-man

iNsaNEiVaN
05-07-2002, 03:35 PM
No, the outline is being drawn, but buggy-like. Im afraid you would have to try it to see what I'm talking about. But thanks anyways. Drawing the actual sphere works fine as long as its not in gluOrtho mode.

Furrage
05-10-2002, 05:30 AM
With gluOrtho your near and far planes are -1 and 1. If your sphere has a radius larger than 1 the top and bottom will be clipped and the remainder will look like an outline. I strongly suspect this is the problem as your gluOrtho call is 640 x 480 which would make a sphere with radius <= 1 take up only one or two pixels.

nexusone
05-10-2002, 06:41 AM
When he posted the question, I had the same thought that maybe his object was being cliped by the near/far plane settings.

http://www.opengl.org/discussion_boards/ubb/smile.gif



Originally posted by Furrage:
With gluOrtho your near and far planes are -1 and 1. If your sphere has a radius larger than 1 the top and bottom will be clipped and the remainder will look like an outline. I strongly suspect this is the problem as your gluOrtho call is 640 x 480 which would make a sphere with radius <= 1 take up only one or two pixels.