Hello,<br><br>I have to scale my vector arrows (glyphs) in such a way that when it is zoomed in, the arrow size must become small and as I zoom out, it should grow up.. As my senior instructed me here,<br><br>http://www.vtk.org/pipermail/vtkusers/2010-January/105915.html<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 *renderer =
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
developer here<br><br>The
scale which it returns is 0. as the position i'm passing in
computeSomething is same as the camera position in else part. Actually,
now i need to find the scale. So in order to do that, what position do i
need to pass as a parameter for this function.? what is difference between, position and camera position?? <br><br>Thanks in advance<br>Rakesh
Patil<br><br><div style="border-top:1px dashed #ccc; border-bottom:1px dashed #ccc; padding:5px;"><a href="http://mail.in.com/mails/new_reg.php?utm_source=invite&utm_medium=outgoing" style="font:13px arial; color:#1E56A1; text-decoration:none;">Dear <b>vtkusers !</b> Get Yourself a cool, short <b>@in.com</b> Email ID now!</a></div>