[Paraview] OBJ reader, Points+normals

D Haley mycae at yahoo.com
Wed Nov 3 08:13:04 EDT 2010


Dear List,

I recently compiled paraview 3.8 in order to use the new wavefront/OBJ reader. I have a vector cloud in an OBJ file (point+attached vector) that I would like to visualise, and thought this might be a solution.

However, I ran the OBJ reader, and the normals for the points are loaded, but the normals appear to not be recognised.

The file contents look something like this:
---------
# OBJ file, containing only points and normals
#

v 315 -62.3371 156.152
vn -0.157145 0.722267 -0.673525
v 315 -44.3808 162.142
vn 0.146189 0.69951 -0.69951
v 315 -53.3286 163.284
vn 0.26163 0.694284 -0.670462
v 315 -35.2797 162.731
vn -0.103498 0.690928 -0.715477
---------
and so on.

There is a 1:1 correspondence between points and normals. However when using the as-given reader, applying the glyph filter with 2D arrow mode shows all the normals as pointing along the X axis with the same magnitude (scaling mode set to "vector").

I tried hacking up the code in IO/vtkOBJReader.cxx , but to be honest I don't know what I am doing. I forced an unconditional call to

std::cerr << "Forcing normals" << std::endl;
output->GetPointData()->SetNormals(new_normals);

directly after

if(everything_ok)
{


but  this was unsuccesful, although the print statement is run.

I checked that the vn lines are being parsed by using print statements, and it appears that they are. The points are also loaded just fine, and the visualisation output is correct.

Any hints? I am unfamiliar with the VTK library unfortunately -- perhaps there is an alternate representation (not OBJ) that I can use to do this? Alternatively someone can suggest an easy patch to this?

My next stop is to hack up an OpenGL tutorial...


Thanks.


      


More information about the ParaView mailing list