05-25-2012, 05:23 AM
(05-24-2012, 09:26 PM)theShadow Wrote: what if we wanted to animate the plants? even just a slight waving animation for wind.
There are many ways you can go about this... I can think of 3 different (rational) ones.
1 - Give the plant texture a small tcmod turb in the shader key (so that the texture will waver around by a tiny amount). You must have enough transparent border around it in this case, else the texture will poke repeats around the edges as it circles. This should also not reduce performance, but is not very realistic. The mtree**.md3 models are an example of this IIRC.
2 - Give the plant texture a deformVertexes shader key (what water / slime uses for waves). This might be good for plants to simulate wind, by having the plant surface deform slowly. Note however that this reduces performance if done excessively... don't do it if there will be a lot of plants!
3 - Animate the plant model itself. If I remember right, md3 supports non-skeletal animations. You might be able to make your plant an animated md3, and make it loop as a misc_gamemodel. Morphed might know more in this domain.
4 - This is not a very rational way, but still posting just for the sake of it. You might want to make your plant surface out of BSP (or a misc_gamemodel attached with a misc_follow), and use an invisible and non-solid func_rotating or func_bobbing to have the code move the plant around. If you get a good entity setup, you might be able to obtain something pretty. But I really don't recommend trying this one at all.