Posted By: TheZero
A6.6 vec_to_mesh und Terraindeformierung - 05/20/08 19:48
Hallo,
Ich hab eine simple Terraindeform Funktion geschrieben, welche leider nicht richtig funktioniert: Es wird immer nur 1 viertel des Terrains deformiert - wandle ich es in ein *.mdl um klappt alles wunderbar. Hat jemand eine Idee was ich falsch gemacht hab?
*.mdl deform with a highmap
same code, same funktion, but it doesn´t work with a *.hmp file !?!?
Ich hab eine simple Terraindeform Funktion geschrieben, welche leider nicht richtig funktioniert: Es wird immer nur 1 viertel des Terrains deformiert - wandle ich es in ein *.mdl um klappt alles wunderbar. Hat jemand eine Idee was ich falsch gemacht hab?
*.mdl deform with a highmap
same code, same funktion, but it doesn´t work with a *.hmp file !?!?
Code:
function deform_terrain() { var row_x; var row_y; var vertex_num; var pixel; var pixel_vec[3]; var format; var mesh_vec[3]; format = bmap_lock(hmp_map1,0); while(row_y < 64) { while(row_x < 64) { vertex_num += 1; pixel = pixel_for_bmap(hmp_map1,row_x,row_y); pixel_to_vec(pixel_vec,0,format,pixel); vec_for_mesh(mesh_vec,skrall_hmp,vertex_num); mesh_vec.z = int(pixel_vec.x/3); vec_to_mesh(mesh_vec, skrall_hmp, vertex_num); row_x += 1; } row_y +=1; row_x = 0; } bmap_unlock(hmp_map1); ent_fixnormals(skrall_hmp,0); c_updatehull(skrall_hmp, 1); }