Added remap reading.

This commit is contained in:
Federico Ponchio 2004-07-01 21:33:46 +00:00
parent fe151470b5
commit 95a66a4153
1 changed files with 22 additions and 1 deletions

View File

@ -24,6 +24,9 @@
History History
$Log: not supported by cvs2svn $ $Log: not supported by cvs2svn $
Revision 1.1 2004/06/23 00:10:38 ponchio
Created
****************************************************************************/ ****************************************************************************/
@ -35,7 +38,8 @@ using namespace std;
#include <GL/gl.h> #include <GL/gl.h>
#include <GL/glu.h> #include <GL/glu.h>
#include <wrap/nexus/crude.h> #include <apps/nexus/crude.h>
#include <apps/nexus/vert_remap.h>
using namespace vcg; using namespace vcg;
using namespace nxs; using namespace nxs;
@ -100,6 +104,19 @@ int main(int argc, char *argv[]) {
} }
Box3f box = crude.GetBox(); Box3f box = crude.GetBox();
bool vremap = false;
bool fremap = false;
VertRemap vert_remap;
if(vert_remap.Load(argv[1] + string(".vrm"))) {
cerr << "Found vert remap.\n";
vremap = true;
}
VFile<unsigned int> face_remap;
if(face_remap.Load(argv[1] + string(".frm"))) {
cerr << "Found face remap.\n";
fremap = true;
}
if(!init()) { if(!init()) {
cerr << "Could not init SDL window\n"; cerr << "Could not init SDL window\n";
return -1; return -1;
@ -167,6 +184,10 @@ int main(int argc, char *argv[]) {
for(unsigned int i = 0;i < crude.Faces(); i++) { for(unsigned int i = 0;i < crude.Faces(); i++) {
Crude::Face &face = crude.GetFace(i); Crude::Face &face = crude.GetFace(i);
if(fremap) {
unsigned int val = face_remap[i];
glColor3ub((val * 27)%255, (val * 37)%255, (val * 87)%255);
}
for(int k = 0; k < 3; k++) { for(int k = 0; k < 3; k++) {
Point3f &p = crude.GetVertex(face[k]); Point3f &p = crude.GetVertex(face[k]);
glVertex3f(p[0], p[1], p[2]); glVertex3f(p[0], p[1], p[2]);