[vtk-developers] Bug in vtkOBJReader.cxx

David Doria daviddoria+vtk at gmail.com
Sun May 2 14:31:42 EDT 2010


At line 208, I believe this:
if (sscanf(pLine, "%f %f %f", xyz, xyz+1, xyz+2) == 3)
        {
        normals->InsertNextTuple(xyz);
        }

should be changed to:

if (sscanf(pLine, "%f %f %f", xyz, xyz+1, xyz+2) == 3)
        {
        normals->InsertNextTuple(xyz);
        hasNormals = true;
        }

without that new line, the output of the reader for files only
containing 'v' and 'vn' lines does not contain normals in the
PointData.

an example input can be simply:

v -3.28898 2.08496 -1.32544
v -3.03471 1.52055 -1.32818
vn -0.0741801 -0.00133945 0.997244
vn -0.0434592 0.0161964 0.998924

Thanks,

David



More information about the vtk-developers mailing list