source: proiecte/pmake3d/make3d_original/Make3dSingleImageStanford_version0.1/third_party/vrippack-0.31/src/vrip/vriphead.cc @ 37

Last change on this file since 37 was 37, checked in by (none), 14 years ago

Added original make3d

File size: 1.5 KB
Line 
1/*
2
3Brian Curless
4
5Computer Graphics Laboratory
6Stanford University
7
8---------------------------------------------------------------------
9
10Copyright (1997) The Board of Trustees of the Leland Stanford Junior
11University. Except for commercial resale, lease, license or other
12commercial transactions, permission is hereby given to use, copy,
13modify this software for academic purposes only.  No part of this
14software or any derivatives thereof may be used in the production of
15computer models for resale or for use in a commercial
16product. STANFORD MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND
17CONCERNING THIS SOFTWARE.  No support is implied or provided.
18
19*/
20
21
22#include <unistd.h>
23#include <stdio.h>
24#ifdef LINUX
25#include <stdlib.h>
26#endif
27
28#include "OccGridRLE.h"
29
30int main(int argc, char **argv)
31{
32   int xd, yd, zd, axis, flip;
33   vec3f origin;
34   float resolution;
35   
36   char *filename = argv[1];
37
38   FILE *fp = fopen(filename, "rb");
39   
40   if (fp == NULL) {
41      fprintf(stderr, "Could not open file.\n");
42      exit(1);
43   }
44   
45   fread(&xd, sizeof(int), 1, fp);
46   fread(&yd, sizeof(int), 1, fp);
47   fread(&zd, sizeof(int), 1, fp);
48   fread(&axis, sizeof(int), 1, fp);
49   fread(&flip, sizeof(int), 1, fp);
50   fread(&origin, sizeof(float), 3, fp);
51   fread(&resolution, sizeof(float), 1, fp);
52   fclose(fp);
53
54   printf("Dimensions: %d x %d x %d\n", xd, yd, zd);
55   printf("Axis: %d  Flip: %d\n", axis, flip);
56   printf("Origin: (%f, %f, %f)\n", origin[0], origin[1], origin[2]);
57   printf("Resolution: %f\n", resolution);
58
59   exit(0);
60}
Note: See TracBrowser for help on using the repository browser.