src/tools/transfab.cpp File Reference

#include <iostream>
#include <ctype.h>
#include <string>

Include dependency graph for transfab.cpp:

Go to the source code of this file.

Functions

int main ()


Function Documentation

int main (  ) 

Definition at line 32 of file transfab.cpp.

References c, good(), in, and x.

00032           {
00033     float sk[4][4]={{0,.1,0,0},
00034                     {-.1,0,0,0},
00035                     {0,0,.1,0},
00036                     //{1,.2,-1.05,1}};
00037                     {1/.025,.2/.025,-1.05/.025,1}};
00038 
00039     float sn[3][3]={{0,1,0},
00040                     {-1,0,0},
00041                     {0,0,1}};
00042 
00043     while(!std::cin.eof() && std::cin.good()){
00044         char name[1000];
00045         std::cin >> name;
00046         std::cout << name;
00047 
00048         float in[4];
00049         int n;
00050 
00051         if (!strcmp("*MESH_VERTEX",name)){
00052             std::cin >> n >> in[0] >> in[1] >> in[2];
00053             in[3]=1;
00054             std::cout << " " << n;
00055             int i,j;
00056 
00057             for(i=0;i<3;i++){
00058                 float x=0;
00059                 for(j=0;j<4;j++)
00060                     x+=sk[j][i]*in[j];
00061                 std::cout << " " << x;
00062             }
00063         }
00064 
00065         if (!strcmp("*MESH_FACENORMAL",name)){
00066             std::cin >> n >> in[0] >> in[1] >> in[2];
00067             in[3]=1;
00068             std::cout << " " << n;
00069             int i,j;
00070 
00071             for(i=0;i<3;i++){
00072                 float x=0;
00073                 for(j=0;j<3;j++)
00074                     x+=sn[j][i]*in[j];
00075                 std::cout << " " << x;
00076             }
00077         }
00078 
00079         char c;
00080         std::cin.get(c);
00081         while (isspace(c) && !std::cin.eof() && std::cin.good()){
00082             std::cout.put(c);
00083             std::cin.get(c);
00084         }
00085         std::cin.unget();
00086     }
00087 }

Here is the call graph for this function:


Generated on Sat Mar 15 23:12:16 2008 for Armagetron Advanced by  doxygen 1.5.4