Hello sir,<br><br>Well, I dont know what you exactly mean by "at the same depth" in
regards to collection of glyph?<br>Actually, each nodes are at different depths (say range from 0 to 3000 for example). And I display<br>glyphs at these nodes. So, does it mean that my glyphs are not at same depth..??<br><br>Thanks<br><blockquote><br><br><br>---------- Original message ----------<br>From:David Gobbi< david.gobbi@gmail.com ><br>Date: 08 Feb 10 19:06:27<br>Subject: Re: [vtkusers] rescaling glyphs..??<br>To: Rakesh Patil <rakeshthp@in.com><br><br>Hi Rakesh,<br><br>The "ViewPort" is not what you think. It has nothing to do with the<br>problem you are working on.<br><br>The "position" in that code means world coordinates of whatever object<br>object you want to scale. When the camera is doing a perspective<br>projection (this is the default), then the scale of an object depends<br>on its depth within the scene. The position is used to compute the<br>depth.<br><br>If you have a collection of glyphs that are all at approximately the<br>same depth, you can
compute the centroid and use that as the position.<br> Setting a different scale for each glyph is possible, too, but is<br>more complicated.<br><br> David<br><br><br>On Sun, Feb 7, 2010 at 10:58 PM, Rakesh Patil <rakeshthp@in.com> wrote:<br>> Hello,<br>><br>> I have to scale my vector arrows (glyphs) in such a way that when it is<br>> zoomed in, the arrow size must become small and as I zoom out, it should<br>> grow up.. As my senior instructed me here,<br>><br>> <a target=\"_blank\" href="http://www.vtk.org/pipermail/vtkusers/2010-January/105915.html" target="_blank">http://www.vtk.org/pipermail/vtkusers/2010-January/105915.html</a><br>><br>> I tried my best and did this..<br>><br>> class vtkMyCallback : public vtkCommand<br>> {<br>> public:<br>> static vtkMyCallback *New(){<br>> return new vtkMyCallback;<br>> }<br>><br>> virtual void Execute(vtkObject *callee, unsigned long, void *)<br>> {<br>> vtkRenderer *ren
derer = reinterpret_cast<vtkrenderer>(callee);<br>> computeSomething(renderer->GetActiveCamera()->GetPosition(), renderer);<br>> }<br>> };<br>><br>> Here is a code for computeSomething()<br>><br>> computeSomething( const double position[3], vtkRenderer *renderer)<br>> {<br>> double vp[4];<br>> renderer->GetViewPort(vp);<br>> cout << vp[0] << vp[1] << vp[2] << vp[3];<br>> }<br>><br>> It is invoked as<br>><br>> vtkMyCallback * mo = vtkMyCallback::New();<br>> pRenderer->AddObserver(vtkCommand::StartEvent, mo);<br>><br>><br>> When i run this code, I get the viewport as<br>><br>> 0011<br>><br>> It remains same throughout. Even after zooming in and out...<br>><br>> after that I tried the code which was suggested to me by one of the senior<br>> developer here<br>><br>> The scale which it returns is 0. as the position i'm passing in<br>> computeSomething is s
ame as the camera position in else part. Actually, now<br>> i need to find the scale. So in order to do that, what position do i need to<br>> pass as a parameter for this function.? what is difference between, position<br>> and camera position??<br>><br>> Thanks in advance<br>> Rakesh Patil<br>><br>> Dear vtkusers ! Get Yourself a cool, short @in.com Email ID now!<br>> _______________________________________________<br>> Powered by <a target=\"_blank\" href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>><br>> Visit other Kitware open-source projects at<br>> <a target=\"_blank\" href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>><br>> Please keep messages on-topic and check the VTK FAQ at:<br>> <a target=\"_blank\" href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>><br>> Follow this
link to subscribe/unsubscribe:<br>> <a target=\"_blank\" href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>><br>><br></vtkrenderer></rakeshthp@in.com></rakeshthp@in.com></blockquote>