<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    Hello VTK users,<br>
    <br>
    This may seem like a simple question, but it seemed like it was
    possible to display the magnitude of a vector field (on an
    unstructured grid) without having to convert the vector field to a
    scalar field simply by setting the appropriate values in the lookup
    table and/or the mapper. However, no matter what I try, I can't get
    this to work and I can't find a VTK example that demonstrates this.<br>
    <br>
    Here's the code that I tried. Is there anything obvious missing?<br>
    <title>Snippet</title>
    <pre style="font-family:Consolas;font-size:13;color:black;background:white;">&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:blue;">vtkLookupTable</span>&nbsp;*<span style="color:navy;">lookup</span>&nbsp;=&nbsp;<span style="color:blue;">vtkLookupTable</span>::<span style="color:#880000;">New</span>();
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:navy;">lookup</span>-&gt;<span style="color:#880000;">SetHueRange</span>(2.0/3.0,&nbsp;0.0);
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:blue;">if</span>&nbsp;(<span style="color:navy;">PostField</span>)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:navy;">lookup</span>-&gt;<span style="color:#880000;">SetTableRange</span>(<span style="color:navy;">PostField</span>-&gt;<span style="color:#880000;">getMini</span>(),&nbsp;<span style="color:navy;">PostField</span>-&gt;<span style="color:#880000;">getMaxi</span>());
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:blue;">else</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:navy;">lookup</span>-&gt;<span style="color:#880000;">SetTableRange</span>(0.0,&nbsp;1.0);
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:navy;">lookup</span>-&gt;<span style="color:#880000;">Build</span>();
<title>Snippet</title>
&nbsp;&nbsp;&nbsp; <span style="color:blue;">vtkDataSetMapper</span>&nbsp;*<span style="color:navy;">mapper</span>&nbsp;= <span style="color:blue;">vtkDataSetMapper</span>::<span style="color:#880000;">New</span>();
 &nbsp;&nbsp; <span style="color:blue;">vtkActor</span>&nbsp;*<span style="color:navy;">actor</span>&nbsp;= <title>Snippet</title><span style="color:blue;">vtkActor</span>::<span style="color:#880000;">New</span>();
 
&nbsp;&nbsp;&nbsp; <span style="color:navy;">mapper</span>-&gt;<span style="color:#880000;">SetInputConnection</span>(producer-&gt;GetOutputPort());
&nbsp;&nbsp;&nbsp; <span style="color:navy;">mapper</span>-&gt;<span style="color:#880000;">SetLookupTable</span>(<span style="color:navy;">lookup</span>);
&nbsp;&nbsp;&nbsp; <span style="color:navy;">mapper</span>-&gt;<span style="color:#880000;">SetScalarRange</span>(<span style="color:navy;">lookup</span>-&gt;<span style="color:#880000;">GetTableRange</span>());
&nbsp;&nbsp;&nbsp; <span style="color:navy;">actor</span>-&gt;<span style="color:#880000;">SetMapper</span>(<span style="color:navy;">mapper</span>);
&nbsp;&nbsp;&nbsp; <span style="color:navy;">renderer</span>-&gt;<span style="color:#880000;">AddActor</span>(<span style="color:navy;">actor</span>);
 
&nbsp;&nbsp;&nbsp; <span style="color:navy;">m_</span><title>Snippet</title><span style="color:navy;">m_vtk_render_window</span>-&gt;<span style="color:#880000;">Render</span>();

<pre style="font-family:Consolas;font-size:13;color:black;background:white;"></pre></pre>
    Any help would be appreciated!<br>
    <br>
    Note that I saw that it's done in ParaView, but maybe they do the
    vector to scalar conversion invisibly to the user?<br>
    <div class="moz-signature">-- <br>
      <meta http-equiv="content-type" content="text/html;
        charset=ISO-8859-1">
      <title>Signature</title>
      <a href="http:://www.infolytica.com">www.infolytica.com </a><br>
      300 Leo Pariseau, Suite 2222, Montreal, QC, Canada, H2X 4B3<br>
      (514) 849-8752 x236, Fax: (514) 849-4239
    </div>
  </body>
</html>