[Paraview] OBJ reader, Points+normals

David Doria daviddoria at gmail.com
Wed Nov 3 08:19:43 EDT 2010


On Wed, Nov 3, 2010 at 8:13 AM, D Haley <mycae at yahoo.com> wrote:

> 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.
>

Can you save the imported file as a vtp file and upload it somewhere and
post a link to it? We can poke around to see if it has been imported
properly and you are just missing a step in Paraview or if it has not been
imported properly.

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20101103/98bc8c6a/attachment-0001.htm>


More information about the ParaView mailing list