- fixed writing face indices in different configurations regarding vertex texture coordinates and vertex normals
- adjusted the intial patch provided by Robert Luo refs #1560 git-svn-id: http://www.openmesh.org/svnrepo/OpenMesh/trunk@824 fdac6126-5c0c-442c-9429-916003d36597
This commit is contained in:
@@ -270,6 +270,10 @@ write(std::ostream& _out, BaseExporter& _be, Options _opt, std::streamsize _prec
|
||||
|
||||
int lastMat = -1;
|
||||
|
||||
// we do not want to write seperators if we only write vertex indices
|
||||
bool onlyVertices = !_opt.check(Options::VertexTexCoord)
|
||||
&& !_opt.check(Options::VertexNormal);
|
||||
|
||||
// faces (indices starting at 1 not 0)
|
||||
for (i=0, nF=_be.n_faces(); i<nF; ++i)
|
||||
{
|
||||
@@ -305,6 +309,7 @@ write(std::ostream& _out, BaseExporter& _be, Options _opt, std::streamsize _prec
|
||||
idx = vhandles[j].idx() + 1;
|
||||
_out << " " << idx;
|
||||
|
||||
if (!onlyVertices) {
|
||||
// write separator
|
||||
_out << "/" ;
|
||||
|
||||
@@ -312,13 +317,14 @@ write(std::ostream& _out, BaseExporter& _be, Options _opt, std::streamsize _prec
|
||||
if (_opt.check(Options::VertexTexCoord))
|
||||
_out << idx;
|
||||
|
||||
// write vertex normal index
|
||||
if ( _opt.check(Options::VertexNormal) ) {
|
||||
// write separator
|
||||
_out << "/" ;
|
||||
|
||||
// write vertex normal index
|
||||
if ( _opt.check(Options::VertexNormal) )
|
||||
_out << idx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
_out << std::endl;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user