<div class="gmail_quote">On Wed, Nov 3, 2010 at 8:13 AM, D Haley <span dir="ltr"><<a href="mailto:mycae@yahoo.com">mycae@yahoo.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Dear List,<br>
<br>
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.<br>
<br>
However, I ran the OBJ reader, and the normals for the points are loaded, but the normals appear to not be recognised.<br>
<br>
The file contents look something like this:<br>
---------<br>
# OBJ file, containing only points and normals<br>
#<br>
<br>
v 315 -62.3371 156.152<br>
vn -0.157145 0.722267 -0.673525<br>
v 315 -44.3808 162.142<br>
vn 0.146189 0.69951 -0.69951<br>
v 315 -53.3286 163.284<br>
vn 0.26163 0.694284 -0.670462<br>
v 315 -35.2797 162.731<br>
vn -0.103498 0.690928 -0.715477<br>
---------<br>
and so on.<br>
<br>
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").<br>
<br>
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<br>
<br>
std::cerr << "Forcing normals" << std::endl;<br>
output->GetPointData()->SetNormals(new_normals);<br>
<br>
directly after<br>
<br>
if(everything_ok)<br>
{<br>
<br>
<br>
but this was unsuccesful, although the print statement is run.<br>
<br>
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.<br>
<br>
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?<br>
<br>
My next stop is to hack up an OpenGL tutorial...<br>
<br>
<br>
Thanks.<br></blockquote><div><br></div>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.</div>
<div class="gmail_quote"><br><div>David </div></div>