Strange Deformation With Brushes

nindim

24-03-2007 00:57:12

I don't know if anyone else has notices this, I'm sure they ahve.

If for example I define a brush like so:


mBrushArray = new float[9];

for(int x=0;x<9;x++)
{
mBrushArray[x] = 50;
}
mFixedBrushScale = myScale;
mBrushScale = mFixedBrushScale;
brushArrayWidth = 3;
brushArrayHeight = 3;


Thats should give me a 3x3 brush with 50 in each element. The deformation should effect an area like this:


_ _
|_|_|
|_|_|

1 2 3
4 5 6
7 8 9


However, in the actual game the brush gives this effect:


_ _
/_|_|_|
|_|_|_|
|_|_| /

1 2 3 4
5 6 7 8
9 10 11 12
13 14 15 16

Vertices 1 and 16 are unused.


I have no idea first of all how an array of 9 floats is affecting 14 vertices and why it seem to skip the first and last, very strange.

Has anyone come upon this issue before?

nindim

26-03-2007 20:05:05

So, its safe to say Im the only one with this problem? If tahts right could anyone point out if Im doing somehting fundamentally wrong with how i setup the brushes?

vanzu

27-03-2007 02:26:13

Nothing wrong with how you set your brushes. I think this has to do with the fact that the terrain is build from triangle strips. Try to write a simple program to render a small heightmap directly with OpenGl or DX and it will become perfectly clear to you... Sorry could have been more specific ages ago but I kinda forgot the details of the thing.

nindim

28-03-2007 14:07:51

Ah, I understand now, it is affecting only nine vertices, but the other triangles are being strectched as they share vertices.