Ekki,

Please pick up a copy of a tar file containing changes for
OFFPolyhedron. There is still a problem with the virtual public 
declaration of primitive.  It works as is.  If want to fix the virtual
declaration of primative in polyhedron be my guest. (and be sure to 
tell me what I was doing wrong) 

I could not find an anonymous FTP site that is up all of the 
time, so I put it two places.  You should be able to use
mosaic to get it at http://www.pitt.edu/~heidorn
I also put it in an anonymous ftp account at
ftp://owl.lis.pitt.edu/pub. That machine is not always run as
Unix however.  The file you need is OFFPhChange.tar. I suggest 
that you untar it in some temporary directory. 

I have tested this with the X11 shader only.  Maybe I'll move this
over the the SGI and try it with GL next week. I ran oout of disk space 
thee but the system admin says there should be room by Monday. 

Run the rtsh script 'acorns' for a test.

The problem with shading was with my normal calculation program not
OFFPolyhedron.  I have included code for two auxillery programs;
POVtoOFF.c that reads POV files containing only triangles and changes
them to OFF indexed polygon files. The second is Normal.c that does a
dirty calculation of vertex and polygon normals from *.geom files to
creat *.vnorm and *.pnorm files.

Thanks,
Bryan
----------------------------------

This tar file contains the changes and additions needed to add a new class 
to YART for reading OFF Type Format Polyhedron files.  This class is called 
OFFPolyhedron.  A command of the same name has been added to the rtsh 
interpreter.  The syntax is

OFFPolyhedron Name File(.no extension) 

Unlike OFFPolygon this class reads the file *.aoff rather than going directly
to the data files.  Only a very small subset of the OFF format is implemented.
It can read 'indexed-polygon' geometry files and indexed vertex color files. 
The default color for an object may be set with the 'polygon_colors default'
command as described in the DEC OFF documentation.

The following files are new and should be added to ../YART/src/high
aoff.h
offpolyh.h
offpolyh.C

The following demo files are added
acorn3.yrt
cup.aoff
cup.geom
cup.ivcol
nut.aoff
nut.geom
nut.ivcol

The following files should be changed as noted

$ diff Makefile.in Makefile.in.1.2
41a42
> 
89c90
< H_SRCS = high/off.C high/oba.C high/analytic.C high/font.C
high/text.C high/spline.C high/usefprim.C high/quadric.C
high/useftext.C high/usefmapp.C high/usefimag.C high/usefligh.C
high/lookat.C high/oneray.C high/recorder.C high/height.C
---
> H_SRCS = high/off.C high/oba.C high/analytic.C high/font.C
high/text.C high/spline.C high/usefprim.C high/quadric.C
high/useftext.C high/usefmapp.C high/usefimag.C high/usefligh.C
high/lookat.C high/oneray.C high/recorder.C high/height.C
high/offpolyh.C
92c93
< H_HDRS = high/off.h high/oba.h high/analytic.h high/font.h
high/text.h high/spline.h high/usefprim.h high/quadric.h
high/useftext.h high/usefmapp.h high/usefimag.h high/usefligh.h
high/lookat.h high/oneray.h high/recorder.h high/height.h
---
> H_HDRS = high/off.h high/oba.h high/analytic.h high/font.h
high/text.h high/spline.h high/usefprim.h high/quadric.h
high/useftext.h high/usefmapp.h high/usefimag.h high/usefligh.h
high/lookat.h high/oneray.h high/recorder.h high/height.h
high/offpolyh.h


$ diff strings.h strings.h.1.2
99a100,103
>     RT_String car( );
>     // return a String with the first word, OK it's lispy
>     RT_String cdr( );
>     // return a String with all but the first word

$ diff strings.C strings.C.1.2
190a191,220
> // return a String with all but the first word
> RT_String RT_String::cdr( ) {
>       static char buf[128];
>       int posi, LengthLeft;
> 
>       // copy the first word into the buffer
>       sscanf(val,"%s",buf);
>       // get the position of the first word
>       posi =  pos(buf);
>       // the length of the remainder of the string
>       LengthLeft = length() - posi - strlen(buf);
>       char *cp = val+posi+strlen(buf);
>       while ( isspace(*cp++)) LengthLeft--;
>       char *ret = new char[LengthLeft+1];
>       // copy the remainder to the ret buffer
>       strcpy( ret, val+strlen(val)-LengthLeft );
>       return RT_String( ret );
> }
> 
> // return a String with the first word, OK it's lispy
> RT_String RT_String::car( ) {
>       char buf[128];
>       // copy the first word into the buffer
>       sscanf(val,"%s",buf);
>       char *ret = new char[strlen(buf)];
>       strcpy( ret, buf );
>       return RT_String( ret );
> }
> 
> 
$ diff yart.h yart.h.1.2
37a38
> #include "high/offpolyh.h" // PBH new header 10/6/94

$ diff global.C global.C.1.2
272a273
>     RTM_primCommand( RTN_OFFPOLYHEDRON, RT_OFFPolyhedron::classCMD );

