seeing the inside of a sphere
I'm having the following problem:
I am working on a game where there are some guys in a big sphere. (I am drawing the sphere with gluQuadric). I want to be able to see the "inside" of the sphere, even if the camera is outside. To do so, I set the "front" of the sphere to be the interior (with gluQuadricOrientation(quadric, GLU_INSIDE); ), and then culled out the back
sides
This seems to work fine on the mac, but on the pc is the camera is at a certain distance from the sphere i stop seeing inside and i just see the exterior.
Do you think my technique is right? Do you think it's an opengl issue- a driver issue? CAn you think of workarounds?
Thanks
I am working on a game where there are some guys in a big sphere. (I am drawing the sphere with gluQuadric). I want to be able to see the "inside" of the sphere, even if the camera is outside. To do so, I set the "front" of the sphere to be the interior (with gluQuadricOrientation(quadric, GLU_INSIDE); ), and then culled out the back
sides
This seems to work fine on the mac, but on the pc is the camera is at a certain distance from the sphere i stop seeing inside and i just see the exterior.
Do you think my technique is right? Do you think it's an opengl issue- a driver issue? CAn you think of workarounds?
Thanks
©h€ck øut µy stuƒƒ åt ragdollsoft.com
New game in development Rubber Ninjas - Mac Games Downloads
Your technique sounds OK. Did you glEnable(GL_CULL_FACE)? Did you request a depth buffer? Got a screenshot?
Yeah I enabled cull face and glEnable(GL_DEPTH_TEST) :/
![[Image: 1qv4.png]](http://img529.imageshack.us/img529/7222/1qv4.png)
![[Image: 2zp5.png]](http://img529.imageshack.us/img529/6658/2zp5.png)
If camera goes just a bit further i just see the outside, while if it goes closer i can see just the interior...
![[Image: 1qv4.png]](http://img529.imageshack.us/img529/7222/1qv4.png)
![[Image: 2zp5.png]](http://img529.imageshack.us/img529/6658/2zp5.png)
If camera goes just a bit further i just see the outside, while if it goes closer i can see just the interior...
©h€ck øut µy stuƒƒ åt ragdollsoft.com
New game in development Rubber Ninjas - Mac Games Downloads
How about giving a stab at rendering the sphere yourself? Then you can be certain about windings and face-culling.
Also, if you render your sphere yourself, you can use a recursively subdivided isocahedron and have a much higher quality sphere without too many triangles. Those lat/long spheres can be ugly... if you want code to do this I'll post some.
Also, if you render your sphere yourself, you can use a recursively subdivided isocahedron and have a much higher quality sphere without too many triangles. Those lat/long spheres can be ugly... if you want code to do this I'll post some.
TomorrowPlusX Wrote:Those lat/long spheres can be ugly...Indeed, but lat/lon spheres look perfectly fine as long as there is sufficient interval used for the application. For a sky dome/sphere they should be plenty sufficient since you're only doing one and can afford the extra poly count -- say every ten degrees for interval. For smaller spheres, and where polycount is important (like needing many spheres on-screen), isocahedron is the way to go.
Agreed -- but looking at the screenshot with the per-vertex blending -- I stand by my isocahedron recommendation!
(I use nested lat/lon spheres for my skydome...)
(I use nested lat/lon spheres for my skydome...)
A third alternative which I've used with pretty nice results is a subdivided cube. Might be a bit easier to texture than an icosahedron or a lat/long sphere.
TomorrowPlusX Wrote:Agreed -- but looking at the screenshot with the per-vertex blending -- I stand by my isocahedron recommendation!That's a good point. An isocahedron might very well help get rid of that funky blended square panel look for the vertex blending. I didn't really notice that earlier. Of course, this is just guessing at what Najdorf is trying to accomplish in the end, but I see your angle. Not that this directly addresses his major problem at the moment though...
per-pixel lighting would definitely fix the ugly blended square panel look ^_^
AnotherJake Wrote:That's a good point. An isocahedron might very well help get rid of that funky blended square panel look for the vertex blending. I didn't really notice that earlier. Of course, this is just guessing at what Najdorf is trying to accomplish in the end, but I see your angle. Not that this directly addresses his major problem at the moment though...Wait, since when is the problem with the vertex blending, and not with the colors and normals he's supplying at each vertex? The blending will work fine once he supplies the same normals and colors for each shared vertex.
He is supplying the same color & normal for each shared vertex, but all the quads are divided into triangles along the same diagonal, and the colors are being interpolated across the triangles, not the quads.
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| Need ray-sphere intersection code | MattDiamond | 23 | 12,806 |
Aug 31, 2009 02:28 PM Last Post: Gengar003 |
|
| Lighting a sphere with OpenGL lights (normals wrong?) | cecilkorik | 3 | 7,072 |
Dec 27, 2007 02:40 PM Last Post: _ibd_ |
|
| Space Box/Sphere | misteranderson | 1 | 2,181 |
May 12, 2006 10:48 AM Last Post: TomorrowPlusX |
|
| texture mapped sphere | dave05 | 5 | 2,685 |
May 8, 2006 05:43 PM Last Post: dave05 |
|
| Generating a sphere | MacFiend | 4 | 3,574 |
May 7, 2003 06:38 PM Last Post: MacFiend |
|

