Two Spheres ..

Hello everybody …

I’m trying to draw two spheres like the following diagram:

but the smallest one doesn’t appear in front of the biggest one … I beleived there is a special function to help me do that …

Any ideas … ??

Thanks in Advance for any help …

Is the smaller one really in front of the big one?
Which is drawn first?
Do you have glEnable(GL_DEPTH_TEST) and glClear(GL_DEPTH_BUFFER_BIT) in your code before that?
Or should the smaller be inside the bigger, then you need to either draw the bigger as second with alpha blending or polygon stipple to look through it.

keep in mind to translate the small sphere in front of the big one.Translete on the z axis

Hi Relic …

Thank you for your quick responce …

for your questions …

Is the smaller one really in front of the big one?
Yes …

Which is drawn first?
The bigger one …

Do you have glEnable(GL_DEPTH_TEST) and glClear(GL_DEPTH_BUFFER_BIT) in your code before that?
Yes

Thanks again

Hello vietlf

Yes that’s it … using translate on the z axis …

It works with me now

Thanks alot …