[vtkusers] scaling of actors while preserving axes - scale.

Kleistereimer kleistereimer at gmx.de
Tue Sep 12 18:47:33 EDT 2006


dear list,

i display data and attached an vtkCubeAxesActor2D to show x,y,z axis in
data - coordinates. this works fine and looks very good out of the box.

now i have data with y ranging from 0 .. 1000 , and x from 0 .. 1. this
results in a very narrow visualization, which i want to stretch in x
direction while preserving the labels on the x axis. (still from 0 .. 1)

i tried using 'Actor->SetScale(x,y,z)' and it worked fine, it scales the
actor properly. but the axes adapt and show 'wrong' values now. (say, 0
.. 800 for a x-scaling-factor of 800)

so how to solve this?

naively i can imagine 3 possibilities:

1) change coordinate-system (x-spacing)
-> not good since other actors would be affected too.

2) relabel the axes while scaling
-> not good since i would need to keep scaling and axes in sync manualy.
besides this the line
'(vtkCubeAxesActor2D*)m_scales)->GetXAxisActor2D()->SetRange(0.0, 1.0);'
shows no effect in my test.

3) put object AND axes into another object, 'freeze' the axes (?) and
scale the outer object (?)


any idea / vtkClasses i could try?

thankyou for your help.


regareds
kl



More information about the vtkusers mailing list