Skip to content

Alter an Arrow shape with a slider without re-declaring the shape #801

Answered by pfisterj
pfisterj asked this question in Q&A
Discussion options

You must be logged in to vote

Well, I eventually found a satisfying solution, if not elegant ; just call again __init__ :

class ArrowActor():

    def __init__(self):
        self.vedo_instance = vd.Arrow((0,0,0),(1,0,0),c='red')

   
    def apply_coordinates_transform(self,t):
        H,m = transform(t)

        # Change Arrow's frame
        self.vedo_instance.apply_transform(H)

        # Change the properties of the arrow 
        self.vedo_instance.__init__((0,0,0), (m[0],m[1],m[2]))

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@marcomusy
Comment options

@pfisterj
Comment options

Answer selected by pfisterj
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