-
Hi, Based on Remote selection example I'm trying to translate most likely Doing it in the following form seems to bring incorrect results (I feel like the coordinates are shifted or something): # callback when selection is done
def on_box_selection_change(selection):
x0 = selection["selection"][0]
y0 = selection["selection"][2]
x1 = selection["selection"][1]
y1 = selection["selection"][3]
coordinate = vtkCoordinate()
coordinate.SetCoordinateSystemToDisplay()
coordinate.SetValue(x0,y0)
p0 = coordinate.GetComputedWorldValue(renderer)
coordinate.SetValue(x1,y0)
p1 = coordinate.GetComputedWorldValue(renderer)
coordinate.SetValue(x1,y1)
p2 = coordinate.GetComputedWorldValue(renderer)
coordinate.SetValue(x0,y1)
p3 = coordinate.GetComputedWorldValue(renderer)
... I was hoping there is a way to make it work correct. |
Beta Was this translation helpful? Give feedback.
Answered by
jourdain
Oct 7, 2024
Replies: 1 comment 1 reply
Answer selected by
kerim371
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Maybe that is a good example for you.