From cd986bc6993454a6ae3985a6139d1cc7210652a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= Date: Fri, 23 Oct 2009 12:57:37 +0000 Subject: [PATCH] Fixes to obj writer * Missing / when skipping texture coordinates * wrong identifier for vertex normals git-svn-id: http://www.openmesh.org/svnrepo/OpenMesh/trunk@215 fdac6126-5c0c-442c-9429-916003d36597 --- src/OpenMesh/Core/IO/writer/OBJWriter.cc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/OpenMesh/Core/IO/writer/OBJWriter.cc b/src/OpenMesh/Core/IO/writer/OBJWriter.cc index f5168885..db100c57 100644 --- a/src/OpenMesh/Core/IO/writer/OBJWriter.cc +++ b/src/OpenMesh/Core/IO/writer/OBJWriter.cc @@ -259,7 +259,7 @@ write(std::fstream& _out, BaseExporter& _be, Options _opt) const _out << "v " << v[0] <<" "<< v[1] <<" "<< v[2] << std::endl; if (_opt.check(Options::VertexNormal)) - _out << "n " << n[0] <<" "<< n[1] <<" "<< n[2] << std::endl; + _out << "vn " << n[0] <<" "<< n[1] <<" "<< n[2] << std::endl; if (_opt.check(Options::VertexTexCoord)) _out << "vt " << t[0] <<" "<< t[1] << std::endl; @@ -299,11 +299,15 @@ write(std::fstream& _out, BaseExporter& _be, Options _opt) const idx = vhandles[j].idx() + 1; _out << " " << idx; + _out << "/" ; + if (_opt.check(Options::VertexTexCoord)) - _out << "/" << idx; + _out << idx; + + _out << "/" ; if ( _opt.check(Options::VertexNormal) ) - _out << "/" << idx; + _out << idx; } _out << std::endl;