From: Juan Manuel Cappi (jcappi++at++sol.info.unlp.edu.ar)
Date: 04/14/2004 15:45:26
Hi Paolo,
thanks for the quick response. In the original code I added
the line you mentioned, but it seems I made a mistake in the
copy-paste process :-). I´m actually using Performer for
windows in MS VC++, I don´t know if this may have something
to do with it.
Thanks again,
Juan
Wednesday, April 14, 2004, 7:16:52 PM, usted escribió:
PF> Hi Juan Manuel,
PF> I tried compiling your few lines of code, and on my sytem
PF> the printf result is 7, as you originally expected.
PF> What could be causing your problem is that you don't seem
PF> to initialize the values of your pfBox.
PF> Try adding the following line to your code before extending
PF> the pfBox: "pfMakeEmptyBox(&box);"
PF> This is the program I tested,
PF> (on irix) compile with: cc -o test test.c -lpf
PF> #include <stdio.h>
PF> #include <Performer/pf.h>
PF> int main( int argc, char**argv )
PF> {
PF> pfBox box;
PF> pfSphere sph;
PF> pfBox *boxes[1];
PF> pfVec3 pnt;
PF> pfInit();
PF> pfConfig();
PF> // TRY ADDING pfMakeEmptyBox(&box); HERE!
PF> pnt[0]=-2;
PF> pnt[1]=-2;
PF> pnt[2]=-2;
PF> pfBoxExtendByPt(&box,pnt);
PF> pnt[0]=2;
PF> pnt[1]=2;
PF> pnt[2]=2;
PF> pfBoxExtendByPt(&box,pnt);
PF> boxes[0]=&box;
PF> pfSphereAroundBoxes(&sph, (const pfBox **)&boxes, 1);
PF> printf("%i\n" , pfSphereContainsBox(&sph,&box));
PF> pfExit();
PF> }
PF> Hope this helps.
PF> Best Regards,
PF> Paolo
PF> Juan Manuel Cappi wrote:
>>Hi,
>> a couple of months ago I started to use the Performer framework and
>>today I ran into something I don't understand and I guessed you could
>>help me. The code I'm using is:
>>
>>pfBox box;
>>pfSphere sph;
>>pfBox *boxes[1];
>>pfVec3 pnt;
>>
>>pnt[0]=-2;
>>pnt[1]=-2;
>>pnt[2]=-2;
>>pfBoxExtendByPt(&box,pnt);
>>
>>pnt[0]=2;
>>pnt[1]=2;
>>pnt[2]=2;
>>pfBoxExtendByPt(&box,pnt);
>>
>>boxes[0]=&box;
>>
>>pfSphereAroundBoxes(&sph, (const pfBox **)&boxes, 1);
>>
>>printf("%i\n" , pfSphereContainsBox(&sph,&box));
>>
>>
>>The thing is that the printf output is the number 3, but, as I
>>understand from the man pages, the result should be 7 (i.e., the box
>>is contained entirely inside the sphere). Am i wrong? Any help would
>>be appreciated.
>>
>>Regards,
>> Juan
>>
>>
>>-----------------------------------------------------------------------
>> List Archives, Info, FAQ: http://www.sgi.com/software/performer/
>> Open Development Project: http://oss.sgi.com/projects/performer/
>> Submissions: info-performer++at++sgi.com
>> Admin. requests: info-performer-request++at++sgi.com
>>-----------------------------------------------------------------------
>>
>>
>>
>>
This archive was generated by hypermail 2b29 : Wed Apr 14 2004 - 15:47:38 PDT