Re: [Plib-devel] ssgaSpheres?
Brought to you by:
sjbaker
From: Bram S. <br...@sa...> - 2005-02-02 13:21:13
|
On 02/02/05 09:30:56, Steve Baker wrote: > If you follow that tortured explanation then you'll see that the > bounding > sphere for a sphere is not an exact fit for the sphere. Steve, This is not the problem. As I said, the spheres are also visually wrong. If you render both styles, they have different sizes. And both sizes are also a mismatch against a sgSphere with radius 1, judging from the hits I get from sgIsect() (although this latter problem could be a bug in my isect program). Rendering this scenegraph: scene =3D new ssgRoot ; balltrf0 =3D new ssgTransform ; balltrf1 =3D new ssgTransform ; ball0 =3D new ssgaSphere(); ball1 =3D new ssgaSphere(); ball0->setLatLongStyle(FALSE); ball0->setSize(1.0); ball0->setColour(blu); ball1->setLatLongStyle(TRUE); ball1->setSize(1.0); ball1->setColour(red); scene->addKid(balltrf0); scene->addKid(balltrf1); balltrf0->addKid(ball0); balltrf1->addKid(ball1); sgVec3 pos0=3D{-1,0,0}; sgVec3 pos1=3D{ 1,0,0}; balltrf0->setTransform(pos0); balltrf1->setTransform(pos1); ssgSimpleState *state =3D new ssgSimpleState(); state->setShininess(8.0); ball0->setKidState(state); ball1->setKidState(state); sgCoord campos ; sgSetCoord ( & campos, 0.0f, -5.0f, 1.0f, 0.0, 0.0f, 0.0f ) ; ssgSetCamera ( & campos ) ; Will give you the output as can be seen in attached jpeg. This is clearly wrong. Changing topology of the sphere should not affect size. I also expect the mismatch against sgSphere. I have some isect test prog if you want that. Also, you have to make a decision on the definition of ssgaSphere of size 1: do you want its radius to be 1, or its diameter? From what I'm seeing: neither sphere style has neither radius 1 nor diameter 1, judging from isects with sgSphere radius 1. Bram |