This technique could be used by animators and computer games designers to automatically generate realistic trees that move in a natural way.
Most computer games and animations have a static background, or use a large team of animators to painstakingly draw each tree individually.
Dr Peter Hall and Chris Li, of the University's Department of Computer Science, have developed a program that will let the computer "watch" video footage of a tree to enable it to make computer-animations that mimic the way branches and leaves move in the wind.
The user simply has to draw around the tree outline in the first frame of the video. The program then makes a model of the tree and tracks how the leaves and branches move in the video.
It then uses algorithms to copy this movement and can use this information to "grow" lots more trees that are all slightly different.
Dr Hall explained: "Rendering trees has always been a headache for animators. Trees move in irregular ways, and it's very hard to achieve natural-looking movement.
"It is so expensive that traditional animation often uses static trees -- except in big-budget films. In computer graphics, tree models are just as hard to produce.
"With our system, the user can produce new trees of the same variety, with each one an individual. We can also very finely control the movement of the tree for different weather conditions, different seasons, and can even make it dance to music!"
Chris Li, who is developing this software as part of his PhD at Bath, said: "Our system will make it faster and cheaper for animators to create animated backgrounds.
"In the future we want to use this same technique to animate other objects like clouds, water, fire and smoke."
Several major players of the animation industry, including Bristol-based creators of Wallace and Grommit, Aardman, have already expressed an interest in the project, which was funded by the Engineering & Physical Sciences Research Council (EPSRC).
A video that demonstrates the animations can be viewed on the University's website at http://www.bath.ac.uk/news/2010/01/25/cgi-trees/.