just use vec_normalize(c.x, 1); here instead of the whole normalization code
I transform it into a sphere like you told me to, using this:
Code:
function cube_to_sphere(ENTITY* model)
{
int i = ent_status(model,0);
for (; i>0; i--)
{
CONTACT* c = ent_getvertex(model,NULL,i);
vec_normalize(c.x, 112);
c.v = NULL; // set c.v to NULL to change c.x,y,z
ent_setvertex(model,c,i);
wait(5);
}
ent_fixnormals(model, 0); // THIS PART OF THE CODE WAS ADDED AFTER READING THE PREVIOUS REPLY
}
The ent_fixnormals() worked out! thank you again for all your help fellow programmers!