mirror of
https://github.com/lucaspalomodevelop/meshlab.git
synced 2026-03-14 08:34:37 +00:00
files import_obj.h, import_3ds.h, io_3ds.h and io_obj.h have been moved from test/io to meshio
This commit is contained in:
parent
86c65a0b95
commit
5d988fb88d
@ -259,14 +259,17 @@ static int Open( OpenMeshType &m, const char * filename, Lib3dsFile *file, _3dsI
|
||||
textureIdx = (int)size;
|
||||
}
|
||||
|
||||
// TODO: questo nel caso di wedge texture coords, tuttavia le ccordinate
|
||||
// di texture sembrano essere per vertice e non per wedge nei 3ds, sistemare
|
||||
for (int i=0; i<3; ++i)
|
||||
if ( info.mask & vcg::tri::io::Mask::IOM_WEDGTEXCOORD )
|
||||
{
|
||||
(*fi).WT(i).u() = mesh->texelL[f->points[i]][0];
|
||||
(*fi).WT(i).v() = mesh->texelL[f->points[i]][1];
|
||||
// TODO: questo nel caso di wedge texture coords, tuttavia le coordinate
|
||||
// di texture sembrano essere per vertice e non per wedge nei 3ds, sistemare
|
||||
for (int i=0; i<3; ++i)
|
||||
{
|
||||
(*fi).WT(i).u() = mesh->texelL[f->points[i]][0];
|
||||
(*fi).WT(i).v() = mesh->texelL[f->points[i]][1];
|
||||
|
||||
(*fi).WT(i).n() = textureIdx;
|
||||
(*fi).WT(i).n() = textureIdx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -275,26 +278,34 @@ static int Open( OpenMeshType &m, const char * filename, Lib3dsFile *file, _3dsI
|
||||
faceColor = Point4f(0.8, 0.8, 0.8, 1.0);
|
||||
}
|
||||
|
||||
if( info.mask & vcg::tri::io::Mask::IOM_FACECOLOR)
|
||||
{
|
||||
// assigning face color
|
||||
// --------------------
|
||||
(*fi).C()[0] = faceColor[0];
|
||||
(*fi).C()[1] = faceColor[1];
|
||||
(*fi).C()[2] = faceColor[2];
|
||||
(*fi).C()[3] = faceColor[3];
|
||||
}
|
||||
|
||||
// assigning face color
|
||||
// --------------------
|
||||
(*fi).C()[0] = faceColor[0];
|
||||
(*fi).C()[1] = faceColor[1];
|
||||
(*fi).C()[2] = faceColor[2];
|
||||
(*fi).C()[3] = faceColor[3];
|
||||
|
||||
|
||||
// assigning face normal
|
||||
// ---------------------
|
||||
// we do not have to multiply normal for current matrix (as we did for vertices)
|
||||
// since translation operations do not affect normals
|
||||
(*fi).N() = f->normal;
|
||||
if ( info.mask & vcg::tri::io::Mask::IOM_FACENORMAL )
|
||||
{
|
||||
// assigning face normal
|
||||
// ---------------------
|
||||
// we do not have to multiply normal for current matrix (as we did for vertices)
|
||||
// since translation operations do not affect normals
|
||||
(*fi).N() = f->normal;
|
||||
}
|
||||
|
||||
for (int i=0; i<3; ++i)
|
||||
{
|
||||
// per wedge normal
|
||||
(*fi).WN(i) = normalL[3*p+i];
|
||||
|
||||
if ( info.mask & vcg::tri::io::Mask::IOM_WEDGNORMAL )
|
||||
{
|
||||
// assigning per wedge normal
|
||||
// --------------------------
|
||||
(*fi).WN(i) = normalL[3*p+i];
|
||||
}
|
||||
|
||||
// assigning face vertices
|
||||
// -----------------------
|
||||
(*fi).V(i) = &(m.vert[ (numVertices + f->points[i]) ]);
|
||||
@ -335,11 +346,11 @@ static int Open( OpenMeshType &m, const char * filename, Lib3dsFile *file, _3dsI
|
||||
lib3ds_file_eval(file,0);
|
||||
}
|
||||
|
||||
bool bHasPerWedgeTexCoord = false;
|
||||
bool bHasPerWedgeNormal = false;
|
||||
bool bUsingMaterial = false;
|
||||
bool bHasPerWedgeTexCoord = true;
|
||||
bool bHasPerFacenormal = true;
|
||||
bool bHasPerWedgeNormal = true;
|
||||
bool bHasPerVertexColor = false;
|
||||
bool bHasPerFaceColor = false;
|
||||
bool bHasPerFaceColor = true;
|
||||
|
||||
int numVertices, numTriangles;
|
||||
|
||||
@ -354,6 +365,8 @@ static int Open( OpenMeshType &m, const char * filename, Lib3dsFile *file, _3dsI
|
||||
|
||||
if (bHasPerWedgeTexCoord)
|
||||
info.mask |= vcg::tri::io::Mask::IOM_WEDGTEXCOORD;
|
||||
if (bHasPerFacenormal)
|
||||
info.mask |= vcg::tri::io::Mask::IOM_FACENORMAL;
|
||||
if (bHasPerWedgeNormal)
|
||||
info.mask |= vcg::tri::io::Mask::IOM_WEDGNORMAL;
|
||||
if (bHasPerVertexColor)
|
||||
@ -25,6 +25,9 @@
|
||||
History
|
||||
|
||||
$Log$
|
||||
Revision 1.1 2006/01/29 17:14:20 buzzelli
|
||||
files import_obj.h, import_3ds.h, io_3ds.h and io_obj.h have been moved from test/io to meshio
|
||||
|
||||
Revision 1.24 2006/01/27 01:07:40 buzzelli
|
||||
Added a better distinction beetween critical and non critical error messages
|
||||
|
||||
@ -24,6 +24,9 @@
|
||||
History
|
||||
|
||||
$Log$
|
||||
Revision 1.69 2006/01/29 17:14:20 buzzelli
|
||||
files import_obj.h, import_3ds.h, io_3ds.h and io_obj.h have been moved from test/io to meshio
|
||||
|
||||
Revision 1.68 2006/01/29 17:07:16 buzzelli
|
||||
missing texture files warning has been added
|
||||
|
||||
@ -42,15 +45,6 @@
|
||||
Revision 1.63 2006/01/26 22:51:57 fmazzant
|
||||
removed last links to the Exporter mask
|
||||
|
||||
Revision 1.62 2006/01/26 18:39:20 fmazzant
|
||||
moved mask dialog exporter from mashio to meshlab
|
||||
|
||||
Revision 1.61 2006/01/23 15:54:04 fmazzant
|
||||
added m.mask = mask to show Mesh information
|
||||
|
||||
Revision 1.60 2006/01/23 01:26:30 buzzelli
|
||||
added handling of non critical errors which may occurr during obj file importing
|
||||
|
||||
*****************************************************************************/
|
||||
#include <Qt>
|
||||
#include <QtGui>
|
||||
@ -58,11 +52,11 @@
|
||||
#include "meshio.h"
|
||||
|
||||
// temporaneamente prendo la versione corrente dalla cartella test
|
||||
#include "../../test/io/import_obj.h"
|
||||
#include "import_obj.h"
|
||||
#include "export_obj.h"
|
||||
|
||||
#include <lib3ds/file.h>
|
||||
#include "../../test/io/import_3ds.h"
|
||||
#include "import_3ds.h"
|
||||
#include "export_3ds.h"
|
||||
|
||||
#include <wrap/io_trimesh/import_ply.h>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user