[Plib-devel] ssgaSpheres?
Brought to you by:
sjbaker
From: Bram S. <br...@sa...> - 2005-02-01 23:25:39
|
Hello, I'm doing intersections tests of spheres against scenegraphs. To aide debugging, I want to visualize the sgSphere I use for testing, with ssgaSpheres. Strangely enough, I cannot make them scale to the same size. I suspect a bug in ssgaSphere. At the very least, the different lat-long styles are broken, because this code: ssgaSphere sphere0; ssgaSphere sphere1; sphere0.setLatLongStyle(FALSE); sphere0.setSize(1.0); sgSphere *bounds0=3Dsphere0.getBSphere(); const float *c0 =3D bounds0->getCenter(); printf("bounds0: center=3D%f,%f,%f radius=3D%f\n", c0[0],c0[1],c0=20 [2],bounds0->getR adius()); sphere1.setLatLongStyle(TRUE); sphere1.setSize(1.0); sgSphere *bounds1=3Dsphere1.getBSphere(); const float *c1 =3D bounds1->getCenter(); printf("bounds1: center=3D%f,%f,%f radius=3D%f\n", c1[0],c1[1],c1=20 [2],bounds1->getR adius()); gives this output: bounds0: center=3D-0.124761,0.005011,0.317507 radius=3D1.860521 bounds1: center=3D0.000000,0.000000,-0.000000 radius=3D0.947555 ...which looks wrong for three reasons: 1) radius of non latlong sphere is roughly twice as big 2) radii are not 1.0 3) center of bounding sphere for non latlong sphere is not 0,0,0 Now, it is not just a bounds-only bug, because when rendering them, switching styles clearly affects the size of the sphere I see on-=20 screen. Any ideas? This is on linux, from CVS. Bram |