Skip to content

How to disable rotation in interactive Plotter? #991

Answered by marcomusy
baba-yaga asked this question in Q&A
Discussion options

You must be logged in to vote

Hi you can use or even create new interactors eg.:

from vedo import *
from vedo.interactor_modes import MousePan

def onleftclick(event):
    pt3 = event.picked3d
    printc(f'Click at: {pt3[:2]}')
    px.append([int(pt3[0]), int(pt3[1])])
    plt.add(Point(pt3, r=15, c='red').pickable(False))
    msg.text(f'Pixel {px[-1]} is clicked.')
    plt.remove(msg)
    plt.add(msg)
    plt.render()

px = []  # detected pixel coordinates of the clicks
img = Image(dataurl+"images/embryo.jpg").pickable(True)
msg = Text2D(pos='top-center', bg='r9', alpha=1, font="VictorMono")

mode = MousePan()

plt = Plotter(size=img.shape, axes=0)
plt.add_callback('left click', onleftclick)
plt.show(img, mode=mode, z…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@baba-yaga
Comment options

Answer selected by baba-yaga
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants