<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
--></style>
</head>
<body class='hmmessage'>
I agree totally :)<br>that's what I was about to do :)<br><br>GC.<br><br>> From: david.gobbi@gmail.com<br>> Date: Thu, 11 Feb 2010 09:40:08 -0700<br>> Subject: Re: [vtkusers] set image as background<br>> To: ilferraresebono@hotmail.it<br>> CC: daviddoria+vtk@gmail.com; vtkusers@vtk.org<br>> <br>> Hi Giancarlo,<br>> <br>> Get out your pencil & paper and draw diagrams. Do a google image<br>> search on "view frustum" to see the kind of diagrams that I mean<br>> (though I always just draw them in 2D and use a trapezoid to represent<br>> the frustum).<br>> <br>> Also, even though VTK does a pretty good job of automatically setting<br>> the camera parameters, it's a good exercise to set up the camera and<br>> clipping range yourself every so often to remind yourself of how<br>> everything works. I even do so myself fairly often, because sometimes<br>> I forget how all this stuff fits together. By properly setting up the<br>> camera, you can get the image to the size that you want.<br>> <br>> David<br>> <br>> On Thu, Feb 11, 2010 at 9:37 AM, Giancarlo Amati<br>> <ilferraresebono@hotmail.it> wrote:<br>> > Thanks guys that's roughly what I wanted to get to.<br>> > althought he image should fill in the window viewport. :) instead of staying<br>> > right there<br>> ><br>> > Many thanks!!!<br>> ><br>> >> From: david.gobbi@gmail.com<br>> >> Date: Thu, 11 Feb 2010 09:24:39 -0700<br>> >> Subject: Re: [vtkusers] set image as background<br>> >> To: ilferraresebono@hotmail.it<br>> >> CC: daviddoria+vtk@gmail.com; vtkusers@vtk.org<br>> >><br>> >> I don't think that it is enough to just set up the layers, because by<br>> >> default the Renderer will always erase everything and set the<br>> >> background color.<br>> >><br>> >> Try renderer->EraseOff() on all but the rear-most renderer.<br>> >><br>> >> Note that EraseOff will also keep the depth buffer from being cleared<br>> >> between renders, so you will have to manually set the camera position<br>> >> and camera clipping planes in your background renderer so that the<br>> >> image is just barely in front of the rear clipping plane.<br>> >><br>> >> David<br>> >><br>> >><br>> >> On Thu, Feb 11, 2010 at 9:20 AM, Giancarlo Amati<br>> >> <ilferraresebono@hotmail.it> wrote:<br>> >> > Yup, it's roughly the same structure my code has.<br>> >> > But apparently whatever is the order or the AddRenderer..... the one<br>> >> > containing the image seems prevailing over the other one<br>> >> ><br>> >> > Many thanks anyway!<br>> >> ><br>> >> ><br>> >> > ________________________________<br>> >> > Date: Thu, 11 Feb 2010 11:08:50 -0500<br>> >> > From: daviddoria+vtk@gmail.com<br>> >> > CC: vtkusers@vtk.org<br>> >> > Subject: Re: [vtkusers] set image as background<br>> >> ><br>> >> > On Thu, Feb 11, 2010 at 10:54 AM, Giancarlo Amati<br>> >> > <ilferraresebono@hotmail.it> wrote:<br>> >> ><br>> >> > mmm now it get confusing because that's the style of my code:<br>> >> ><br>> >> > this is the declaration:<br>> >> > vtkSmartPointer<vtkRenderer> L0=<br>> >> > vtkSmartPointer<vtkRenderer>::New();<br>> >> > vtkSmartPointer<vtkCamera> camL0 = vtkCamera::New();<br>> >> ><br>> >> ><br>> >> > vtkSmartPointer<vtkRenderer> L1 =<br>> >> > vtkSmartPointer<vtkRenderer>::New();<br>> >> > vtkSmartPointer<vtkCamera> camL1 = vtkCamera::New();<br>> >> ><br>> >> ><br>> >> > vtkSmartPointer<vtkRenderWindow> renderWindow =<br>> >> > vtkSmartPointer<vtkRenderWindow>::New();<br>> >> > renderWindow->SetSize(720,576);<br>> >> ><br>> >> ><br>> >> > Than I create a plane with texture the image I load up and then... I add<br>> >> > the<br>> >> > plane to L1;<br>> >> > L0->AddActor(Scene);<br>> >> > L1->AddActor(texturedPlane);<br>> >> ><br>> >> > renderWindow->AddRenderer(L0);<br>> >> > renderWindow->AddRenderer(L1);<br>> >> ><br>> >> > and I call start() of the interactor.<br>> >> ><br>> >> > but I just got my Texture rendered..but not the 3D Model. so what u mean<br>> >> > with Layers?<br>> >> ><br>> >> > Regards.<br>> >> > Giancarlo<br>> >> ><br>> >> > I tried to make a demo of this:<br>> >> > http://www.vtk.org/Wiki/VTK/Examples/BackgroundImage<br>> >> > However, it seems like one renderer covers up the other. For now it is<br>> >> > just<br>> >> > trying to display an ImageActor in backgroundRenderer and then a sphere<br>> >> > in<br>> >> > sceneRenderer.<br>> >> > Thanks,<br>> >> ><br>> >> > David<br>> ><br>> > ________________________________<br>> > Troppe caselle di posta? Gestiscile da Hotmail!<br>                                            <br /><hr />Ci sai fare con le parole? <a href='http://typectionary.it.msn.com/' target='_new'> Scoprilo su Typectionary!</a></body>
</html>