Giter VIP home page Giter VIP logo

Comments (3)

bwoodsend avatar bwoodsend commented on May 27, 2024 1

In 3D, rotation is a bit more complex because there are 3 axes to rotate around rather than just one which means that you'll need 6 keys instead of just 4 to control them all (assuming you're interested in all 3).

As for actually controlling the orientation, the only function vtkplotlib provides is view() which sets absolute orientations using unit vectors but I imagine that you want the exact opposite - to incrementally adjust the orientation using yaw, pitch and roll angles. In which case you can use VTK's own methods directly. The camera is located at fig.camera. To give you an example:

import vtkplotlib as vpl

fig = vpl.figure()
vpl.mesh_plot(vpl.data.get_rabbit_stl())
text = vpl.text("", color="r")

while True:
    text.text = "Incrementing Yaw"
    for i in range(120):
        fig.camera.Yaw(3)
        fig.reset_camera()
        fig.update()

    text.text = "Incrementing Pitch"
    for i in range(120):
        fig.camera.Pitch(3)
        fig.reset_camera()
        fig.update()

    text.text = "Incrementing Roll"
    for i in range(120):
        fig.camera.Roll(3)
        fig.reset_camera()
        fig.update()

from vtkplotlib.

TheRealVira avatar TheRealVira commented on May 27, 2024

Thank you - that was very useful!

from vtkplotlib.

bwoodsend avatar bwoodsend commented on May 27, 2024

You're welcome.

from vtkplotlib.

Related Issues (14)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.