<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2600.0" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>thanks.</FONT></DIV>
<DIV><FONT face=Arial size=2>I have another problem:) </FONT><FONT face=Arial 
size=2>How to generate a multiple isosurface with Marching cubes in one render 
window?</FONT></DIV>
<DIV><FONT face=Arial size=2>thanks radim</FONT></DIV>
<BLOCKQUOTE 
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
  <DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
  <DIV 
  style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B> 
  <A title=amy.henderson@kitware.com href="mailto:amy.henderson@kitware.com">Amy 
  Henderson</A> </DIV>
  <DIV style="FONT: 10pt arial"><B>To:</B> <A title=kolarr@feec.vutbr.cz 
  href="mailto:kolarr@feec.vutbr.cz">Radim Kolář</A> ; <A 
  title=vtkusers@public.kitware.com 
  href="mailto:vtkusers@public.kitware.com">VTK</A> </DIV>
  <DIV style="FONT: 10pt arial"><B>Sent:</B> Tuesday, March 11, 2003 3:15 
  PM</DIV>
  <DIV style="FONT: 10pt arial"><B>Subject:</B> Re: [vtkusers] rendering a 
  sphere problem</DIV>
  <DIV><BR></DIV>The main reason this won't work is that vtkSphereSource 
  produces vtkPolyData output, not vtkImageData, so you can't volume render it 
  in VTK.&nbsp; You should use a vtkPolyDataMapper and a vtkActor to render the 
  output of vtkSphereSource instead.<BR><BR>- Amy<BR><BR>At 09:16 AM 3/11/2003 
  +0100, Radim Kolář wrote:<BR>
  <BLOCKQUOTE class=cite cite="" type="cite"><FONT face=arial size=2>Hi 
    all,</FONT><BR><FONT face=arial size=2>please could you help me with this 
    simple problem?</FONT><BR><FONT face=arial size=2>I want to render the 
    sphere with the vtkVolumeRayCastMapper. So I create sphere, mapper, volume 
    properties and finally vtkVolume and I render it with 
    vtkRenderWindowInteractor. But the program crash when I call 
    iren-&gt;Render(). Bellow is the short C++ code. Are there some 
    mistakes?</FONT><BR><FONT face=arial size=2>I'm using VTK 4.0 and Borland 
    C++ 6</FONT><BR><FONT face=arial size=2>Thanks a lot.</FONT><BR><FONT 
    face=arial size=2>Radim</FONT><BR>&nbsp;<BR><FONT face=arial 
    size=2>//---------------------------------------------------------------------------<BR>#include 
    "vtkSphereSource.h"<BR>#include "vtkVolumeRayCastMapper.h"<BR>#include 
    "vtkActor.h"<BR>#include "vtkRenderer.h"<BR>#include 
    "vtkRenderWindowInteractor.h"<BR>#include "vtkRenderWindow.h"<BR>#include 
    "vtkVolumeRayCastMIPFunction.h"<BR>#include "vtkImageData.h"<BR>#include 
    "vtkVolumeProperty.h"<BR>#include 
    "vtkPiecewiseFunction.h"</FONT><BR>&nbsp;<BR><FONT face=arial 
    size=2>#include &lt;vcl.h&gt;<BR>#pragma hdrstop</FONT><BR><FONT face=arial 
    size=2>//---------------------------------------------------------------------------</FONT><BR>&nbsp;<BR><FONT 
    face=arial size=2>#pragma argsused<BR>int main(int argc, char* 
    argv[])<BR>{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; vtkSphereSource 
    *sphere;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sphere = 
    vtkSphereSource::New();</FONT><BR>&nbsp;<BR><FONT face=arial 
    size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
    vtkVolumeRayCastMIPFunction *RayCastMethod = 
    vtkVolumeRayCastMIPFunction::New();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
    vtkVolumeRayCastMapper *mapper = 
    vtkVolumeRayCastMapper::New();</FONT><BR>&nbsp;<BR><FONT face=arial 
    size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
    mapper-&gt;SetVolumeRayCastFunction( RayCastMethod 
    );</FONT><BR>&nbsp;<BR><FONT face=arial 
    size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; vtkImageData 
    *vol;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; vol = 
    vtkImageData::New();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
    vol-&gt;SetSource( sphere );<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
    mapper-&gt;SetInput( vol );</FONT><BR>&nbsp;<BR><FONT face=arial 
    size=2>&nbsp;vtkColorTransferFunction *colorF = 
    vtkColorTransferFunction::New();<BR>&nbsp;&nbsp;&nbsp; 
    colorF-&gt;AddRGBSegment( 0, 0.0, 0.0, 0.0, 255, 0.5, 0.1, 1.0 
    );</FONT><BR>&nbsp;<BR><FONT face=arial 
    size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //-------- Mapping from scalar 
    -&gt; opacity ------------<BR>&nbsp;vtkPiecewiseFunction *opacityF = 
    vtkPiecewiseFunction::New();<BR>&nbsp;&nbsp;&nbsp;&nbsp; 
    opacityF-&gt;AddPoint( 10, 0.1 );<BR>&nbsp;&nbsp;&nbsp;&nbsp; 
    opacityF-&gt;AddPoint( 200, 0.9 );<BR>&nbsp;&nbsp;&nbsp;&nbsp; 
    opacityF-&gt;ClampingOff();</FONT><BR>&nbsp;<BR><FONT face=arial 
    size=2>vtkVolumeProperty *volumeP = 
    vtkVolumeProperty::New();<BR>&nbsp;&nbsp;&nbsp; volumeP-&gt;SetColor( colorF 
    );<BR>&nbsp;&nbsp;&nbsp;&nbsp; volumeP-&gt;SetScalarOpacity( opacityF 
    );</FONT><BR>&nbsp;<BR><FONT face=arial size=2>&nbsp;vtkVolume *volume = 
    vtkVolume::New();<BR>&nbsp;&nbsp;&nbsp;&nbsp; volume-&gt;SetMapper( mapper 
    );<BR>&nbsp;&nbsp;&nbsp;&nbsp; volume-&gt;SetProperty( volumeP 
    );</FONT><BR>&nbsp;<BR><FONT face=arial size=2><BR>vtkRenderer 
    *ren1;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ren1 = 
    vtkRenderer::New();<BR>&nbsp;&nbsp;&nbsp; ren1-&gt;AddProp( volume 
    );<BR>&nbsp;<BR>vtkRenderWindow *renWin; renWin = 
    vtkRenderWindow::New();<BR>&nbsp;&nbsp;&nbsp; renWin-&gt;AddRenderer( ren1 
    );<BR>&nbsp;<BR>vtkRenderWindowInteractor *iren; iren = 
    vtkRenderWindowInteractor::New();<BR>&nbsp;&nbsp;&nbsp; 
    iren-&gt;SetRenderWindow( renWin 
    );<BR>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
    iren-&gt;Render();&nbsp;&nbsp;&nbsp;&nbsp; //here it 
    crash<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
    iren-&gt;Start();<BR>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
    iren-&gt;Delete();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
    renWin-&gt;Delete();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
    ren1-&gt;Delete();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
    RayCastMethod-&gt;Delete();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
    volume-&gt;Delete();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
    vol-&gt;Delete();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
    mapper-&gt;Delete();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
    sphere-&gt;Delete();<BR>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
    return 
    0;<BR>}<BR>//---------------------------------------------------------------------------</FONT></BLOCKQUOTE><BR></BLOCKQUOTE></BODY></HTML>