PDA

View Full Version : Animating swaying trees in Unreal 3


easterislandnick
07-23-2008, 04:18 PM
Hi, My next unreal level in unreal is going to be a forested canyon and I was wondering how I might go about animating the trees swaying in the wind. Are there any tutorials about adding animations to static meshes knocking around as I cant seem to find any. In the past I have animated branches with a panning texture but I want something slightly more realistic. I won't be animating them myself, a friend at work is going to be doing them in Max.

Any ideas?

Thanks, Nick

Kawe
07-23-2008, 04:33 PM
well. as the name suggests. static meshes are static. you could animate them separately with kismet/matinee but uhm.. ya. maybe better to import an animated tree using bones and stuff instead. not entirely sure how you do that. gotta use the actorx exporter I believe.

easterislandnick
07-26-2008, 03:32 AM
"Static meshes are static"!!!!!!!!!! I feel a bit stupid for not considering that! Any ideas what would be the best way of approaching it?

kamfriek
07-26-2008, 10:19 AM
can you have vertex shaders on static meshes in UE3?You could add some sine-controlled sway to geometry with that,increasing it along y-axis.Ben Cloward swayed grass quads like that,but it is essentialy the same thing:


Out.position = In.position;

if(In.texCoord.y < 0.9) {
Out.position.x += sin(Out.position.x * frequency + (time/TimeScale)) * amplitude* 1-In.texCoord.y;
}




Look into UE3 documentation for the correct syntax,this one is copied from virtools.

sprunghunt
07-27-2008, 05:22 AM
you could use speedtree. It has automatic swaying.