[vtkusers] How can one fully specify orientation of vtkGlyph3Dglyphs?

John Platt jcplatt at lineone.net
Fri Jul 8 03:34:38 EDT 2005


Hi Chris,

Have you looked at vtkTensorGlyph? You could try ThreeGlyphsOff(),
ExtractEigenValuesOff() and specify the orientation as the columns in
point tensor data.

HTH

John.

-----Original Message-----
From: vtkusers-bounces+jcplatt=lineone.net at vtk.org
[mailto:vtkusers-bounces+jcplatt=lineone.net at vtk.org] On Behalf Of
Christopher Bruns
Sent: 07 July 2005 22:37
To: vtkusers at vtk.org
Subject: [vtkusers] How can one fully specify orientation of
vtkGlyph3Dglyphs?


  Using glyphs is so very very much faster than using thousands of 
individual vtkActors.
  But I cannot figure out how to fully specify the orientation of the 
glyph at each position.
  Calling SetVectorModeToUseNormal() certainly has an effect on the
glyph
orientation, but leaves one entire degree of freedom unspecified.

  For example, suppose each glyph were the shape of a fish.  I could 
specify the
direction from the tail to the head of the fish by setting the normal 
vector at
each position appropriately.  But I cannot figure out how to also 
specify the
directions toward which the fish's tummy and back and left side and 
right side face.  There is
one rotational degree of freedom that is not captured by the normal
vector
orientation.

  So fish orientations cannot be fully specified in a vtkGlyph3D.  
Spheres are OK.
Cones are OK. Cylinders are OK.  Anything with an axis of radial 
symmetry is OK.
Tacos are not OK. Fish are not OK.

  Does anyone have an example of how to fully specify the orientation in

three
dimensions of each glyph?  Alternatively, are there non-glyph tricks for

getting
thousands of identical things rendered without resorting to 22nd century
hardware?

  Thanks in advance.

Chris Bruns

// This is in Java
vtkGlyph3D lineGlyph = new vtkGlyph3D();
vtkPoints linePoints = new vtkPoints();
vtkFloatArray lineNormals = new vtkFloatArray();
lineNormals.SetNumberOfComponents(3);
lineGlyph.SetVectorModeToUseNormal(); // Take direction from normal
lineGlyph.SetSource(complexAsymmetricShape.GetOutput());
...
// Populate the positions and normal vectors for each object...
  linePoints.InsertNextPoint(center.getX(), center.getY(),
center.getZ());
  lineNormals.InsertNextTuple3(direction.getX(), direction.getY(), 
direction.getZ());
...
vtkPolyData lineData = new vtkPolyData();
lineData.SetPoints(linePoints);
lineData.GetPointData().SetNormals(lineNormals);
...
(unhappy fish)

_______________________________________________
This is the private VTK discussion list. 
Please keep messages on-topic. Check the FAQ at:
http://www.vtk.org/Wiki/VTK_FAQ
Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers





More information about the vtkusers mailing list