PDA

View Full Version : problems with spheres



incredible_hulk
09-04-2002, 03:02 AM
Hello.
Further to my earlier post of 9/3/02(entitled "glut solidsphere seam") I've made some new discoveries...
I've been doing a bit more playing around with my code, and now I think that the seam might actually be built into the sphere model...! It appears regardless of whether I use glutSolidSphere or gluSphere, and if I rotate the sphere, the seam is rotated as well. It is only visible when the object is transparent, which makes me think that it might be something to do with seeing the inside faces of the model. Has anyone else had similar problems, and if so, how did you get around them?
I can email screenshots if you like, although code might be difficult to follow as the GL routines are scattered throughout a large program...
Hope someone can help!
Thanks,
James

lucidmm
09-04-2002, 10:08 AM
The seam you speak of may be caused by graphics card floating point error when computing the points of a circle.

incredible_hulk
09-04-2002, 10:24 AM
Really? My graphics card is NVidia GeForce 2 64MB, would it still be likely to have floating point errors? Well, assuming that this could be the case, can you suggest anything i could do to prevent it??? Failing that, does anyone have any alternative suggestions, as I'm not really convinced about floating point errors...

nexusone
09-04-2002, 10:51 AM
Can you post the part of the code with the sphere routine?

If I remember you are adding a texture to the sphere?

Check your texture image, around the edges and see if you have left any area that has no texture?
Also does you texture match if you where to bring say the right edge to the left, would the texture be in sync with each side?
Ether side being off would create a seam on your object.



Originally posted by incredible_hulk:
Hello.
Further to my earlier post of 9/3/02(entitled "glut solidsphere seam") I've made some new discoveries...
I've been doing a bit more playing around with my code, and now I think that the seam might actually be built into the sphere model...! It appears regardless of whether I use glutSolidSphere or gluSphere, and if I rotate the sphere, the seam is rotated as well. It is only visible when the object is transparent, which makes me think that it might be something to do with seeing the inside faces of the model. Has anyone else had similar problems, and if so, how did you get around them?
I can email screenshots if you like, although code might be difficult to follow as the GL routines are scattered throughout a large program...
Hope someone can help!
Thanks,
James

lucidmm
09-04-2002, 11:12 AM
When dealing with numbers like PI that have no finite decimal representation, there is bound to be floating point error regardless of how good of a card you have.

There are numerous examples of round off error. The red book on page 86 cautions programmers not rely on computers computing the sine and cosine of 0 and 2*PI*EDGES/EDGES and getting the same value for both computations.

I would like to think that the implementation of glut and glu spheres avoid this sort of thing, but I think it is still possible that your seam is caused by round off error.

No matter how fast computers become there will always be round off error. The only way to "fix" it, is to make the round off error so small that you don't care about it.

If anyone has other ideas about his seam, I'm interested in hearing them too.

Thanks.