3d objects in 2d world.

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?

Is the sphere square?

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

More seriously … is it a lighting issue?

Regards

Only the outline is being drawn.

Only an outline as in, it looks like a disk? If that’s the case, it sounds like you haven’t enabled lighting.

It should by default draw all polygons filled, but you get get outline then use

gluQuadricDrawStyle

and give it GLU_FILL

V-man

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.

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.

When he posted the question, I had the same thought that maybe his object was being cliped by the near/far plane settings.

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.