Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] morphing and actions don't sync up well? #369

Open
Sov-trotter opened this issue Jul 21, 2021 · 6 comments
Open

[BUG] morphing and actions don't sync up well? #369

Sov-trotter opened this issue Jul 21, 2021 · 6 comments
Labels
bug Something isn't working

Comments

@Sov-trotter
Copy link
Member

Sov-trotter commented Jul 21, 2021

For the code below :

using Javis

function ground(args...)
    background("black")
    sethue("white")
end

astar(args...; do_action=:stroke) = star(O, 50, 5, 0.5, 0, do_action)
acirc(args...; color = "red", do_action=:stroke) = circle(Point(0, 0), 50, do_action)

video = Video(500, 500)
back = Background(1:50, ground)
star_obj = Object(1:50, astar)
act!(star_obj, Action(10:25, morph_to(acirc)))
act!(star_obj, Action(26:35, anim_translate(Point(100, -100))))
act!(star_obj, Action(36:45, morph_to(astar)))


render(video, pathname = "testmorph.gif")

Expected Behaviour:
So what we want is the star to morph into a circle, then that circle should translate to (100, -100)(the Javis CRS)
and the morph back to a star positioned at O(0, 0).

Current Behaviour:
So translate() shifts the origin to 100, -100 and is never shifted back to 0,0. So the circle to star morphing takes place at 100, -100.

testmorph

Is this related to #367

@Sov-trotter Sov-trotter added the bug Something isn't working label Jul 21, 2021
@Wikunia
Copy link
Member

Wikunia commented Jul 21, 2021

Thanks for opening the issue. I feel like this might be more a problem of morphing as no new object is created during the morph I feel like all actions after morphing might potentially be broken 😞

@Sov-trotter Sov-trotter changed the title [BUG] anim_translate and actions don't sync up well? [BUG] morphing and actions don't sync up well? Jul 21, 2021
@Sov-trotter
Copy link
Member Author

Sov-trotter commented Jul 26, 2021

I now realize this is not realted to morphing. But anim_translate might be broken.

star_obj = Object(1:60, astar)
act!(star_obj, Action(30:40, anim_translate(Point(100, -100))))
act!(star_obj, Action(45:55, anim_translate(Point(100, -100))))

So by law it should translate to 100, -100 in frames 30:40 and then stay at that position for frames 45::55.
But instead, this happens
testmorph

How ever if I do something like

star_obj = Object(1:60, astar)
act!(star_obj, Action(30:40, anim_translate(Point(100, -100))))
act!(star_obj, Action(45:55, anim_translate(O))) # translate it to origin this time

It stays put for frames 45:55 while this time we can expect it to go back to origin.
testmorph

@Wikunia
Copy link
Member

Wikunia commented Jul 26, 2021

The docstring is simply wrong and fixed in: #370

@Sov-trotter
Copy link
Member Author

So this is expected behaviour?

@Wikunia
Copy link
Member

Wikunia commented Jul 26, 2021

Yes it will move by a vector instead of to a point. The other one is currently not really possible as one does not know where the point is at the beginning and it would have some unsolvable problems when one applies two of those actions at the same time. See also #367

@Sov-trotter
Copy link
Member Author

AH got it thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants