<P>hi,</P>
<P> I want to export my visualization result with VRML. </P>
<P> but I cannot get any vrml file.</P>
<P> what matter?</P>
<P>Thanks adv.</P>
<P>---------------------------------</P>
<P>package require vtk<BR>package require vtkinteraction<BR>package require vtktesting</P>
<P># Create the RenderWindow, Renderer and both Actors<BR>#<BR>vtkRenderer ren1<BR>vtkRenderWindow renWin<BR> renWin AddRenderer ren1<BR>vtkRenderWindowInteractor iren<BR> iren SetRenderWindow renWin</P>
<P># create pipeline<BR>#<BR>vtkPLOT3DReader pl3d<BR> pl3d SetXYZFileName "$VTK_DATA_ROOT/Data/combxyz.bin"<BR> pl3d SetQFileName "$VTK_DATA_ROOT/Data/combq.bin"<BR> pl3d SetScalarFunctionNumber 100<BR> pl3d SetVectorFunctionNumber 202<BR> pl3d Update<BR>vtkPlaneSource ps<BR> ps SetXResolution 4<BR> ps SetYResolution 4<BR> ps SetOrigin 2 -2 26<BR> ps SetPoint1 2 2 26<BR> ps SetPoint2 2 -2 32<BR>vtkPolyDataMapper psMapper<BR> psMapper SetInput [ps GetOutput]<BR>vtkActor psActor<BR> psActor SetMapper psMapper<BR> [psActor GetProperty] SetRepresentationToWireframe</P>
<P>vtkDashedStreamLine streamer<BR> streamer SetInput [pl3d GetOutput]<BR> streamer SetSource [ps GetOutput]<BR> streamer SetMaximumPropagationTime 100<BR> streamer SetIntegrationStepLength .2<BR> streamer SetStepLength .001<BR> streamer SetNumberOfThreads 1<BR> streamer SetIntegrationDirectionToForward<BR>vtkPolyDataMapper streamMapper<BR> streamMapper SetInput [streamer GetOutput]<BR> eval streamMapper SetScalarRange [[pl3d GetOutput] GetScalarRange]<BR>vtkActor streamline<BR> streamline SetMapper streamMapper</P>
<P>vtkStructuredGridOutlineFilter outline<BR> outline SetInput [pl3d GetOutput]<BR>vtkPolyDataMapper outlineMapper<BR> outlineMapper SetInput [outline GetOutput]<BR>vtkActor outlineActor<BR> outlineActor SetMapper outlineMapper</P>
<P># Add the actors to the renderer, set the background and size<BR>#<BR>ren1 AddActor psActor<BR>ren1 AddActor outlineActor<BR>ren1 AddActor streamline</P>
<P>ren1 SetBackground 1 1 1<BR>renWin SetSize 300 300<BR>ren1 SetBackground 0.1 0.2 0.4</P>
<P>set cam1 [ren1 GetActiveCamera]<BR>$cam1 SetClippingRange 3.95297 50<BR>$cam1 SetFocalPoint 9.71821 0.458166 29.3999<BR>$cam1 SetPosition 2.7439 -37.3196 38.7167<BR>$cam1 SetViewUp -0.16123 0.264271 0.950876</P>
<P># render the image<BR>#<BR>iren AddObserver UserEvent {wm deiconify .vtkInteract}</P>
<P>renWin Render</P>
<P>vtkVRMLExporter vrml<BR> vrml SetInput renWin<BR> vrml SetStartWrite {vrml SetFileName "c:\test.wrl"}<BR> vrml SetEndWrite {vrml SetFileName "c:\test.wrl"}<BR> vrml SetSpeed 0.5</P>
<P># prevent the tk window from showing up then start the event loop<BR>wm withdraw .</P>
<P><BR> </P><p><br><hr size=1><b>Do You Yahoo!?</b><br>
<a href="http://rd.yahoo.com/mail_cn/tag/?http://cn.ent.yahoo.com/newsletter/index.html">雅虎娱乐新鲜到底,电子周报快乐到家!</a>