Closed rensx closed 3 months ago
You can use the MoveAlongPath animation:
Shape movePath = Shape.regularInscribedPolygon(5);
playAnimation(
MoveAlongPath.make(5, movePath, P, Anchor.Type.CENTER, false, true)
);
In the manual (chapter "Animating Objects") you can find information about this animation.
Great! thank you very much for your kindly help.
David Gutiérrez @.***> 于2024年7月25日周四 15:36写道:
You can use the MoveAlongPath animation:
Shape movePath = Shape.regularInscribedPolygon(5);playAnimation( MoveAlongPath.make(5, movePath, P, Anchor.Type.CENTER, false, true) );
In the manual (chapter "Animating Objects") you can find information about this animation.
— Reply to this email directly, view it on GitHub https://github.com/davidgutierrezrubio/jmathanim/issues/16#issuecomment-2249656810, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALBRNZL7YSQMQHP4JGM4SU3ZOCTGDAVCNFSM6AAAAABLNT3WYKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENBZGY2TMOBRGA . You are receiving this because you authored the thread.Message ID: @.***>
Below example animate a triangle with two fixed point(P1,P2) and a dynamic Point(P) located on a circle path, is there a simple way to animate a triangle with the dynamic Point(P) locate on a more general shape such as polygon?
import com.jmathanim.jmathanim.; import com.jmathanim.mathobjects.;
public class dynamicTriangle extends Scene2D { public static void main(String[] args) { System.setProperty("prism.forceGPU", "true"); JMathAnimScene scene = new dynamicTriangle(); scene.execute(); } @Override public void setupSketch() { config.parseFile("#preview.xml"); config.parseFile("#darkCGBlue.xml"); //config.setCreateMovie(true); }
}