Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Trying to make an animation of PNG files and clueless about Java

 
Katie Piorkowski
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm a mechanical engineering student and I've been programming in Scilab to make a matrix of temperatures of soil at varying depths. Our goal is to make an animation of the change in temperature at different time intervals. My research partner found this site (http://www.caps.ou.edu/wx/p/20110322/r/spmeso/fcst_22.1200Z/1200Z/anim/soilt/) and this animation is exactly what we want to do. He e-mailed the creator and the creator said they created a series of PNG files and made the animation using a JavaScript file. I know nothing about JavaScript. My question is: is it worth trying to learn JavaScript to build our animation? Or is there some kind of program out there that will make an animation that will allow us to change our variables like the animation in the link I provided?

Thank you!
 
Joanne Neal
Rancher
Posts: 3742
16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Katie Piorkowski wrote:I know nothing about JavaScript.

The first thing you should learn is that JavaScript and Java are not the same thing.
Hopefully a moderator will move this to the Javascript forum where you will probably get better answers.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64827
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If this is in a web page, then yes, JavaScript is what you would need to use.

It's not that complicated. You would use window.setInterval() to cause to code to execute periodically. In the callback, you would locate the image element and replace its src properly with a new image each time. The display will automatically update with the new image.
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
View the page source, you can see the code.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic