Game Development Community

Deformation Question

by Justin Fainges · in Torque Game Engine · 12/20/2005 (4:59 am) · 2 replies

I've implemented the solution as presented in the terrain deform resource at http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=7343 and it works fine, but the sides it generates are slanted, i.e, not perpendicular. Or to put it another way, the terrain grid at the old height (top) is larger than at the new one (bottom). I require perpendicular walls for my game and I've gone through terrainDeform.cc and found the code that does the height transform, but I can't change the size of the bottom grid so that it's the same size as that of the top grid. I assume it's done in the nested IF in setGridHeight, but my matrix transformation skills are a bit rusty. If anyone could point me in the right direction it would be appreciated.

#1
12/20/2005 (5:22 am)
The sides will always be slanted to a certain degree.

The terrain is basically just a grid. If you move the points up and down in the Y axis, you get sloped terrain.. You cannot move the points in the X or Z axis though to give yourself sharp cliffs. The only time you get anywhere close to a perpendicular cliff is if you have extremely deep holes or extremely high cliffs. Even then you're not seeing a true 90 degree wall, but a very high wall covering the same distance in the X and Z axes...

I can't think of a way around this without serious work on the terrain engine.
#2
12/20/2005 (10:02 pm)
Thanks for the quick response Jason. I was going to build my own walls into these trenches anyway, so I'll just expand the size of the terrain deform and take care of the walls with objects.