[vtk-developers] Re: Question about textures and vtkGlyph3D

Prabhu Ramachandran prabhu_r at users.sf.net
Sun Jul 10 05:40:20 EDT 2005


>>>>> "Prabhu" == Prabhu Ramachandran <prabhu_r at users.sf.net> writes:

    Prabhu> Hi, I noticed an interesting modification to the behavior
    Prabhu> of vtkGlyph3D in CVS.  The specific checkin is Revision
    Prabhu> 1.114 (by Henderson).  The change basically copies the
    Prabhu> tcoords data from the input points to the *entire* glyph.

Mhh, reading code at 2:00 am is never very accurate is it?  The
checkin I refer to has a bug.  Here is the patch:

--- vtkGlyph3D.cxx      5 Jul 2005 13:26:33 -0000       1.122
+++ vtkGlyph3D.cxx      10 Jul 2005 09:33:27 -0000
@@ -521,7 +521,7 @@
       {
       for (i = 0; i < numSourcePts; i++)
         {
-        sourceTCoords->GetTuple(inPtId, tc);
+        sourceTCoords->GetTuple(i, tc);
         newTCoords->InsertTuple(i+ptIncr, tc);
         }
       }

Since we are copying the source's TCoords, the index should be 'i' and
not inPtId.  This is interesting because one would get garbage (or a
segfault) if the source had tcoords and number of source points is
much smaller than the number of input points.  I wonder why no one
picked up the bug.

I've checked this in and will see if I can work out a simple test
case.

cheers,
prabhu




More information about the vtk-developers mailing list