hi.

how do i generate havok heightfield using vertices x y z.?

i am using directx, and have generated the heightmap using raw file. and i have the vertex buffer.

the vertex buffer has this xyz values.

how to convert those xyz value to suit the variable needed for HeightFieldShape(ci, heightData);

in the sample i found these code

for (int x = 0; x < xRes; x++)

{

for (int z = 0; z < zRes; z++)

{

hkReal dx,dz,height = 0;

int octave = 1;

// Add togther a few sine and cose waves

for (int i=0; i< 3; i++)

{

dx = hkReal(x * octave) / xRes;

dz = hkReal(z * octave) / zRes;

height += (5 - (i * 2)) * hkMath::cos(dx * HK_REAL_PI) * hkMath::sin(dz * HK_REAL_PI);

octave *= 4;

}

// Convert to 16 bit

m_heightData[x*zRes + z] = static_cast ( hkUint16(-1) * (height + 10.0f) / 20.0f );

}

}

so how do i do it with the already generated xyz from raw file??

thank you