Posted By: Sub_Game
Can I animate a terrain? - 02/14/10 09:47
Is it possible to animate a terrain hmp or manipulate it's verticies with lite-C?
I'm trying to simulate waves on the ocean. I can to this with a normal model but my short range fog hides the faces of the model but not when I use terrain.
Posted By: Damocles_
Re: Can I animate a terrain? - 02/14/10 10:53
Its possible the manipulate the vertecies of a terrain directly,
its a slow approch tough, and better for just changing terrain
once (bomb crater or so)
You could also use multiple terrains that get turned on
one after another in a cycle. (more memory)
Not shure if there is an included terrain-animation setting now.
Better look for a better fog or whatever it is and use an animated model.
Posted By: bart_the_13th
Re: Can I animate a terrain? - 02/14/10 11:37
Sure, you can, using ent_setvertex, see details here:
http://www.conitec.net/beta/ent_getvertex.htmIt says that the first call will be slow, but fast at subsequent call(but that depends on how many vertex you want to deform I guess)
Or maybe using vertex shader will be faster...
Posted By: Sub_Game
Re: Can I animate a terrain? - 02/15/10 05:16
ent_setvertex works like magic and is very fast. I've managed to make some great looking waves through direct manipulation. Thanks guys!
Posted By: Sub_Game
Re: Can I animate a terrain? - 02/15/10 06:07
While I have your attention, does anyone know the fastest way to get a terrain height anywhere along it's surface?
terrain_height (ENTITY_T* terrain, VECTOR* position); only returns the nearest vertice and c_trace is a bit tricky to work with since I have multiple terrains in the game.
entity.floor_dist seems ideal but only shoots downwards and doesn't return the terrain pointer.
I need a very accurate method for the transition from underwater to above water on a moving terrain (water) with a second terrain representing the bottom/ground and an inverted object as the underwater surface.
Posted By: Sub_Game
Re: Can I animate a terrain? - 02/15/10 08:22
I've tried c-trace on my animated terrain and it doesn't work! Even if I freeze my manipulated vertices the c_trace is not accurate at all. Very annoying!
Posted By: mk_1
Re: Can I animate a terrain? - 03/18/10 13:30
You can displace the vertices using a vertex shader.