The layering works fine as long as I do not add a 3D actor on the top layer or keep it invisible...<br><br>By the way, the 3D actor is 49 X 50 PNG image and I am using the following code to set up the camera:<br><br>m_renderer2-&gt;ResetCamera();
<br>vtkCamera * cam = m_renderer2-&gt;GetActiveCamera();<br>cam-&gt;ParallelProjectionOn();<br><br>// the origin, spacing and extent are from a reslice object<br>double xc = outputOrigin[0] + 0.5*(outputExtent[0] + outputExtent[1])*outputSpacing[0];
<br>double yc = outputOrigin[1] + 0.5*(outputExtent[2] + outputExtent[3])*outputSpacing[1];<br>double xd = (outputExtent[1] - outputExtent[0] + 1)*outputSpacing[0];<br>double yd = (outputExtent[3] - outputExtent[2] + 1)*outputSpacing[1];
<br>double d = cam-&gt;GetDistance();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>cam-&gt;SetParallelScale(0.5*yd);<br>cam-&gt;SetFocalPoint(xc,yc,0.0);<br>cam-&gt;SetPosition(xc,yc,+d);<br><br><br><div><span class="gmail_quote">On 12/10/06, 
<b class="gmail_sendername">Anja Ende</b> &lt;<a href="mailto:anja.ende@googlemail.com">anja.ende@googlemail.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi everyone,<br><br>Ok, I have almost tried everything unsuccessfully...exxcept for what would make this thing work! I have had no success in mixing 2d and 3d actors.<br><br>So, my latest brilliant idea was to use multiple renderers and layer them on the render window.
<br><br>So, only the top one would have the 3d actors and the bottom one would be my 2d actor.... I thought this would work for sure!<br><br>Well, my code is like this:<br><br>this-&gt;m_actor2D-&gt;SetMapper(this-&gt;m_imageMapper);
<br>this-&gt;m_renderer-&gt;AddViewProp(this-&gt;m_actor2D);<br>// first renderer<br>this-&gt;m_renderer-&gt;SetLayer(0);<br><br>vtkPNGReader * cursorImage = vtkPNGReader::New();<br>cursorImage-&gt;SetFileName(&quot;/home/anja/crosshair.png&quot;);
<br>cursorImage-&gt;Update();<br><br>vtkImageChangeInformation * imageChange = vtkImageChangeInformation::New();<br>imageChange-&gt;SetInput(cursorImage-&gt;GetOutput());<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>vtkImageActor * actor = vtkImageActor::New();
<br>actor-&gt;SetInput(imageChange-&gt;GetOutput());<br>imageChange-&gt;CenterImageOn();<br>// second renderer<br>this-&gt;m_renderer2-&gt;AddViewProp(actor);<br>this-&gt;m_renderer2-&gt;SetLayer(1);<br><br>// 2 layers &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;  
<br> this-&gt;m_renderWindow-&gt;SetNumberOfLayers(2);<br>// Add the layers to my render window.<br>this-&gt;m_renderWindow-&gt;AddRenderer(this-&gt;m_renderer);<br>this-&gt;m_renderWindow-&gt;AddRenderer(this-&gt;m_renderer2);
<br clear="all"><br>Well, no matter what layer I put the 2d actor in... all I can see is the 3d actor..always! I would die to see my 2d actor right now!!<br><br>Please help me here. I am totally out of ideas now!<br><br>
Cheers,
<br><span class="sg"><br>Anja

</span></blockquote></div><br><br clear="all"><br>-- <br>Cheers,<br><br>Anja