I've spent the last week beating my head against the wall trying to figure out why my colormap didn't work in my application, but smaller test cases would work. I finally figured it out just now. (Filed as bug 2546)<br><br>
When using a vtkColorTransferFunction, and adding a large number of points (Over 100) in an out-of-order fashion (In my case, I'm reading them from a file and the X's are fairly random, not simply incrementing), it will destroy the colormap. The problem comes when you add the 100'th point and it tries to resize the colormap. In this case, it uses a memcpy to copy the colormap into the newly allocated (and large) array. If that 100th's point is not the highest point in the list, it uses 2 memcpy's, one shifted by one entry to create a "hole" for the newly added entry in the middle. Unfortunately, it indexes wrong! So the net result: Blue becomes red, green becomes blue, red becomes the next entry's X, and in general it's just all b0rked.
<br><br>Attached to the bug ( <a href="http://www.vtk.org/Bug/bug.php?op=show&bugid=2546&pos=3">http://www.vtk.org/Bug/bug.php?op=show&bugid=2546&pos=3</a> ) you'll find a test-case that uses a Mandelbrot fractal source to illustrate the problem.
<br clear="all"><br>-- <br>Randall Hand<br>Visualization Scientist, <br>ERDC-MSRC Vicksburg, MS<br>Homepage: <a href="http://www.yeraze.com">http://www.yeraze.com</a>