Ok never-mind now its working I do not know why, It just started to work lol....
but now I have a different issue
var num_Vert = ent_vertices(ent);
var current_vert;
for(current_vert = 1; current_vert < num_Vert; current_vert++)
{
CONTACT* c = ent_getvertex(ent,NULL,current_vert);
COLOR* clr = terrain_getpixel(ent,c.x,c.y,NULL);
if(clr.blue == NULL)
{
error("Color not returned....");
}
else
{
c.z += 0.1+(clr.blue*altitude);
print_var(c.z);
//ent_setvertex(ent,c,current_vert);
}
}
c_updatehull(ent,1);
print_var is just a simple function that prints out the values of the number, I use this to see what results or if any are being returned...
Half way through the function it crashes with an 1513 error....
I get about 10-20 values returned then error....any suggestions to point me in the right way...
Im trying to write a simple terrain deformation from a height map...
Step A Creates the height map...
Step B assigns it to the terrain
those work fine
Step C Returns the color of a terrain texture at the given x y world position using terrain_getpixle and set the height of the vert accordingly...I just needed something simplistic for what I had in mind...
anyways its again step c i am running into the issue with the above code
UPDATE: The loop runs exactly 32 times before each crash....Still not sure why....The terrain is 256x256 (1089 verts) and the texture size I am using is also 256x256 though that should not matter....