четверг, 5 июля 2012 г.

Procedural terrain. Part 3. Realtime terrain editing.

So, now we have dwarf, which can be ordered to make some holes in the terrain (and to build huge castle, in perspective).

Added some other action pictures and scroll bar on the right side, to show camera level. Also, a menu, which shows dwarf's stats (generated randomly). Appears after clicking on dwarf.
Used pretty cool service for mesh animation, http://www.mixamo.com/. It is free for models with <10K polygons, offers realtime rigging, and have a large animation library (some of them are free). Now dwarf can dance samba.
It's time to continue terrain editing, but first, i want to make an orders for dwarfs.
Added tree prototype (dwarf is still dancing).

Next step is terrain selection. That was quite competitive, because i decided not to use physics for as fast as possible chunks creation (build-in raytracing is physics-based).
So, at first, i'm creating normalized vector from camera position along with mouse pointer. Then i'm changing its lenght until it intersects land (as land is storing incide matrix, i can check matrix elements to know, when my vector would intersect earth block). Final touch is calculating "ray and plane" intersection to find an accurate point for placing highlighter.
Just added several new lines of code, and now it is possible to create several selection zones.
Multilevel solution. Also, added transparency.
Finished Zone Menu.


Part 1, basic terrain render.
Part 2slicing camera, Fog Of War. 

1 комментарий: