Unfortunately, VTK's array calculator does not support true cross product computation. I have a patch in bug 2903 ( <a href="http://www.vtk.org/Bug/bug.php?op=show&bugid=2903&pos=19">http://www.vtk.org/Bug/bug.php?op=show&bugid=2903&pos=19
</a> ) that adds a "cross(X,Y)" function, but it hasn't been integrated yet. You can probably grab it & replace your vtkFunctionParser with it and it'll work.<br><br>In the meantime, you've got 2 options:<br>
1) Load your vectors in a 3-scalars, and then perform the cross product yourself as you've shown.<br> 2) Use V.ihat, V.jhat, and V.khat to access the 3 components (read: Vector dot i-unit vector, etc)<br><br>also, you can't directly write back the results into components.. So you'll have to compute each component & multiply by ihat/jhat/khat and then add the 3 parts together... It's gonna be one massive & messy function line. And slow to run......
<br><br><div><span class="gmail_quote">On 4/14/06, <b class="gmail_sendername">W.T. Bridgman</b> <<a href="mailto:William.T.Bridgman.1@gsfc.nasa.gov">William.T.Bridgman.1@gsfc.nasa.gov</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I want to do a cross product of two vector datasets.<br><br>I can't find any documentation (both the vtk list & Google) on<br>vtkArrayCalculator or vtkFunctionParser to implement this.<br><br>How would I code the SetFunction for this? Does the parser recognize
<br>vector components?<br><br>E[3]=V[2]*B[1]-V[1]*B[2], etc.<br><br>Thanks,<br>Tom<br>--<br>Dr. William T."Tom" Bridgman Scientific Visualization<br>Studio<br>Global Science & Technology, Inc. NASA/Goddard Space Flight
<br>Center<br>Email: <a href="mailto:William.T.Bridgman.1@gsfc.nasa.gov">William.T.Bridgman.1@gsfc.nasa.gov</a> Code 610.3<br>Phone: 301-286-1346 Greenbelt, MD 20771<br>FAX: 301-286-1634
<a href="http://svs.gsfc.nasa.gov/">http://svs.gsfc.nasa.gov/</a><br><br>_______________________________________________<br>This is the private VTK discussion list.<br>Please keep messages on-topic. Check the FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ">
http://www.vtk.org/Wiki/VTK_FAQ</a><br>Follow this link to subscribe/unsubscribe:<br><a href="http://www.vtk.org/mailman/listinfo/vtkusers">http://www.vtk.org/mailman/listinfo/vtkusers</a><br></blockquote></div><br>