[vtkusers] Rotate vtkCubeAxesActor
Michka Popoff
michkapopoff at gmail.com
Mon Apr 22 09:56:36 EDT 2013
Hi
thank you for you answer. I found the following test : Rendering/Annotation/Testing/Cxx/TestCubeAxesOrientedBoundingBox.cxx.
Is this the test you ment ? From the code I see that I will have to use the SetAxisBaseFor methods and define the vectors by myself, which should be easy to do. (SetAxisBaseFor is not aviable in vtk5 so I suppose it was added since then).
Now I have to reinstall the latest vtk from source, but I am not sure how to do it, I downloaded the latest master from git, I know how to install vtk 5.10.1 with Python / PyQT wrapping, but the latest master has no VTK_WRAP_PYTHON_SIP nor VTK_USE_QT options in ccmake, so for the moment I am stuck.
Michka
Le 19 avr. 2013 à 17:08, Sebastien Jourdain a écrit :
> Hi Michka,
>
> the vtkCubeAxesActor will always be axis aligned no matter what, unless you update to vtk6 and create your own set of base vector for it.
> If you checkout the current version of the source code, you can look at the test made on the CubeAxis to see how to do what you try to achieve here.
>
> Seb
>
>
> On Fri, Apr 19, 2013 at 8:51 AM, Michka Popoff <michkapopoff at gmail.com> wrote:
> Hello
>
> I am using the latest vtk 5.10 and I am not able to rotate a vtkCubeAxesActor. The vtkCubeAxesActor has as parents
> vtkActor and vtkProp3D. The vtkProp3D class has RotateX, RotateY, and RotateZ methods, which I already use to rotate another vtkActor, which is a meshgrid (working nicely).
>
> But if I use one of these rotation methods on vtkCubeAxesActor, nothing happens (no rotation; no error message). Is this the way I should rotate vtkCubeAxesActor, or is there another way ? Here is a minimal example (in python with PyQT) to show you what I want to achieve. Adding or removing the RotateZ(45) gives twice the same result …
>
>
> #!/usr/bin/env python
>
> from PyQt4 import QtCore, QtGui
> from PyQt4.QtGui import QApplication
> import vtk
> from vtk.qt4.QVTKRenderWindowInteractor import QVTKRenderWindowInteractor
> import sys
>
> class SimpleView(QtGui.QMainWindow):
>
> def __init__(self, parent = None):
> QtGui.QMainWindow.__init__(self, parent)
>
> self.centralWidget = QtGui.QWidget()
> self.layout = QtGui.QVBoxLayout()
>
> self.widget = QVTKRenderWindowInteractor(self.centralWidget)
> self.renderer = vtk.vtkRenderer()
> self.widget.GetRenderWindow().AddRenderer(self.renderer)
> self.widget.Initialize()
> self.widget.Start()
>
> self.actorAxes = vtk.vtkCubeAxesActor()
> self.actorAxes.SetCamera(self.renderer.GetActiveCamera())
> self.actorAxes.RotateZ(45)
> self.renderer.AddActor(self.actorAxes)
>
> self.renderer.Render()
>
> self.renderer.ResetCameraClippingRange()
>
> self.renderer.ResetCamera()
>
> self.layout.addWidget(self.widget)
> self.centralWidget.setLayout(self.layout)
> self.setCentralWidget(self.centralWidget)
>
> if __name__ == "__main__":
>
> app = QApplication(sys.argv)
> window = SimpleView()
> window.show()
> window.resize(800, 600)
> sys.exit(app.exec_())
>
>
> Thank you in advance
>
> Michka Popoff
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20130422/e208bf07/attachment.htm>
More information about the vtkusers
mailing list