0

I'm working on a project where you can import a picture, mark some positions, create a line between them and then export it again.

enter image description here enter image description here

My next goal is, that the exported file is an animation that reveals the path like e.g. this. The camera movement and all that fancy stuff is not important fow now, just the reveal animation.

I've been trying to research some way to do this but couldn't find anything relevant to create animations. I don't need specific code, i'd be happy to get some keywords from you guys so i know where to look.

Thanks in advance!

JustADude
  • 77
  • 6
  • What kind of animation is that? – Ecto Dec 03 '20 at 12:38
  • What do you mean? I don't really care about the filetype of the output if thats the question – JustADude Dec 03 '20 at 13:12
  • Well then just export a file with the few points in it and play the animation within your program only. – Ecto Dec 03 '20 at 21:57
  • Do you want to use AWT/Swing, or do you want to use a JavaScript canvas? You have specified tags for both. – VGR Dec 03 '20 at 23:13
  • @Ecto my bad, the exported file should still be animated – JustADude Dec 04 '20 at 08:13
  • @VGR the jquery tag wasn't added by me :/ I'd prefer to stay within Java, but if it's only possible in JS i'd try my luck with that i guess – JustADude Dec 04 '20 at 08:14
  • You could regularly create image samples and then use a library to convert it into an animation (maybe JavaCV) – Ecto Dec 04 '20 at 11:47
  • There is no built-in class or method for drawing a partial line. You’ll have to do the math yourself. Fortunately, it’s pretty simple; no trigonometry is required, just some ratios and some multiplication. As for creating a video file, I would just create a BufferedImage, draw an animation frame on it, write it to a file, and repeat for each frame, then use ProcessBuilder to invoke `ffmpeg`. Or, you can [write your images into an animated GIF](https://stackoverflow.com/questions/19634293/animating-multiple-images-using-java). – VGR Dec 04 '20 at 23:10

0 Answers0