I had to make some changes (not enough memory for the Bunyk on my linux box) but I got it running on Linux. Still, just a big black window. I also added a small piece of code to remove all the Arrays except the 1 I want.<br>
<br> Here's the modified code:<br><br>=======================<br>#include <vtkColorTransferFunction.h><br>#include <vtkDataSetReader.h><br>#include <vtkPiecewiseFunction.h><br>#include <vtkProjectedTetrahedraMapper.h
><br>#include <vtkUnstructuredGrid.h><br>#include <vtkDataSet.h><br>#include <vtkRenderWindow.h><br>#include <vtkRenderer.h><br>#include <vtkRenderLargeImage.h><br>#include <vtkPNGWriter.h
><br>#include <vtkVolumeProperty.h><br>#include <vtkDataSetTriangleFilter.h><br>#include <vtkImagingFactory.h><br>#include <vtkGraphicsFactory.h><br>#include "stat.h"<br>int main(void) {
<br> int i;<br> vtkGraphicsFactory *factGraphics = vtkGraphicsFactory::New();<br> factGraphics->SetUseMesaClasses(1);<br> factGraphics->SetOffScreenOnlyMode(1);<br> factGraphics->Delete();<br> vtkImagingFactory *factImage = vtkImagingFactory::New();
<br> factImage->SetUseMesaClasses(1);<br> factImage->Delete();<br> vtkDataSetReader *reader = vtkDataSetReader::New();<br> reader->SetFileName("step_127.vtk");<br> reader->ReadAllScalarsOn();
<br> reader->Update();<br> PrintStatistics(reader->GetOutput());<br><br> for(i=0; i< reader->GetOutput()->GetPointData()->GetNumberOfArrays();) {<br> if (strcmp(reader->GetOutput()->GetPointData()->GetArray(i)->GetName(),
<br> "Temperature") == 0) {<br> i++;<br> } else {<br> reader->GetOutput()->GetPointData()->RemoveArray(<br> reader->GetOutput()->GetPointData()->GetArray(i)->GetName());
<br> }<br> }<br><br> vtkDataSetTriangleFilter *tri = vtkDataSetTriangleFilter::New();<br> tri->SetInput(reader->GetOutput());<br> tri->Update();<br> PrintStatistics(tri->GetOutput());<br>
<br><br> vtkColorTransferFunction *color = vtkColorTransferFunction::New();<br><br> color->AddRGBPoint(250, 0, 0, 1);<br> color->AddRGBPoint(450, 1, 0, 0);<br> color->AddRGBPoint(2600, 1, 1, 0);<br> color->AddRGBPoint(5000, 1, 1, 1);
<br><br> vtkPiecewiseFunction *opacity = vtkPiecewiseFunction::New();<br> opacity->AddPoint(250, 0.1);<br> opacity->AddPoint(450, 0.1);<br> opacity->AddPoint(2600, 0.25);<br> opacity->AddPoint(5000,
1.0);<br><br> vtkVolumeProperty *volProp = vtkVolumeProperty::New();<br> volProp->SetColor(color);<br> volProp->SetScalarOpacity(opacity);<br> volProp->SetInterpolationTypeToNearest();<br><br> vtkProjectedTetrahedraMapper *mapper =
<br> vtkProjectedTetrahedraMapper::New();<br> mapper->SetScalarModeToUsePointFieldData();<br> mapper->SelectScalarArray("Temperature");<br> mapper->SetInput(tri->GetOutput());<br>
<br> vtkVolume *volume = vtkVolume::New();<br> volume->SetMapper(mapper);<br> volume->SetProperty(volProp);<br> volume->Update();<br> vtkRenderWindow *renWin = vtkRenderWindow::New();<br> vtkRenderer *ren1 = vtkRenderer::New();
<br> renWin->OffScreenRenderingOn();<br> renWin->AddRenderer(ren1);<br><br> ren1->AddVolume(volume);<br> ren1->ResetCamera();<br> renWin->SetSize(1024, 1024);<br> renWin->Modified();<br>
<br> vtkRenderLargeImage *w2if = vtkRenderLargeImage::New();<br> w2if->SetInput(ren1);<br> w2if->SetMagnification(1);<br><br> vtkPNGWriter *png = vtkPNGWriter::New();<br> png->SetInput(w2if->GetOutput());
<br> png->SetFileName("output.png");<br> png->Write();<br>}<br><br><br><br><br><br>==================<br><br><div><span class="gmail_quote">On 12/28/05, <b class="gmail_sendername">Dominik Szczerba</b>
<<a href="mailto:domi@vision.ee.ethz.ch">domi@vision.ee.ethz.ch</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;">smells like platform specific problems. get a linux test box.
<br>--domi<br><br>Randall Hand wrote:<br><br></blockquote></div><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>