pfCylIsectSphere

New Message Reply Date view Thread view Subject view Author view

Dietrich Opitz (dio++at++sage.mpik-tueb.mpg.de)
Mon, 23 Jan 1995 14:20:53 +0000


Hi,

Some problems with pfCylIsectSphere or just a lack of understanding ?

Why is the following program returning 1 (PFIS_MAYBE) as result of
pfCylIsectSphere instead of 4 (PFIS_ALL_IN) ?

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <Performer/pf.h>
#include "pfutil.h"
#include "pfflt.h"
#include "pfsgi.h"
#include "prmath.h"

void main()
{
   pfCylinder cyl;
   pfSphere tsph,fsph;
   long thit,fhit;

   pfMakeEmptyCyl(&cyl);
   pfMakeEmptySphere(&tsph);
   pfMakeEmptySphere(&fsph);

   pfSetVec3(tsph.center,0.0,0.0,0.0);
   pfSetVec3(fsph.center,0.0,0.0,0.0);
   tsph.radius = .02;
   fsph.radius = .02;

   pfSetVec3(cyl.center, 0.0,0.0,0.0);
   pfSetVec3(cyl.axis,0.0,0.0,1.0);
   cyl.radius = .01;
   cyl.halfLength = .01;

   thit = pfCylIsectSphere(&cyl,&tsph);
   fhit = pfCylIsectSphere(&cyl,&fsph);

   printf(" %ld , %ld \n",thit,fhit);

}

Thank you in advance.

Dietrich

--
Dietrich Opitz

MPI fuer biologische Kybernetik Spemannstr. 38 72076 Tuebingen GERMANY

Tel: ++49(07071) 601 606 FAX: ++49(07071) 601 575 e-mail: dio++at++sage.mpib-tuebingen.mpg.de


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:50:53 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.