home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 1997 March / VPR9703A.ISO / VPR_DATA / DOGA / SOURCES / POLYEDIT.LZH / READER / TEST.C < prev    next >
C/C++ Source or Header  |  1994-08-21  |  849b  |  49 lines

  1.  
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4.  
  5. #include "reader.h"
  6.  
  7. void    main( argc, argv )
  8. int        argc ;
  9. char    *argv[] ;
  10. {
  11.     int        type ;
  12.     char    name[64] ;
  13.     Color    col, amb, dif, spc, size ;
  14.     int        h ;
  15.     float    x, y, z, vx, vy, vz, u, v ;
  16.  
  17.     ReaderInit();
  18.     MatrixInit();
  19.  
  20.     printf( "start\n" );
  21.  
  22.     if ( AtrReadOpen( "dman.atr" ) == FALSE )
  23.         exit( 1 );
  24.  
  25.     while( AtrReadNext() )
  26.     {
  27.         AtrReadName( name );
  28.         printf( "atrname : %s\n", name );
  29.         type = AtrReadColor( &col, &amb, &dif, &spc, &size, &h );
  30.     }
  31.     AtrReadClose();
  32.  
  33.     if ( ObjReadOpen( "dman.suf" ) == FALSE )
  34.         exit( 1 );
  35.  
  36.     ObjReadName( name );
  37.     while( ObjReadPoly( name, &type ) )
  38.     {
  39.         printf( "ReadPoly\n" );
  40.         while( ObjReadVertex( &x, &y, &z, &vx, &vy, &vz, &u, &v ) )
  41.         {
  42.             printf( "( %g, %g, %g )\n", x, y, z );
  43.         }
  44.         printf( "\n" );
  45.     }
  46.     ObjReadClose();
  47. }
  48.  
  49.