Posted By: mireazma
terrain verts z-snap - 06/28/11 21:04
Hello.
I have a hmp and I need to edit each vertex to snap it to certain z values, like f.i. 1, 1.5, 2, 2.5 so on, instead of current 1.243 or anything.
The idea is to have slopes of one of 6 possible angles.
Posted By: Superku
Re: terrain verts z-snap - 06/28/11 21:23
Use ent_status and ent_get/setvertex to manipulate terrain vertices.
Snapping can be done as follows (c is a CONTACT* pointer) (if I'm not mistaken):
c.z = integer(c.z*2)/2; // or simply cast as (int)
Posted By: Pappenheimer
Re: terrain verts z-snap - 06/28/11 21:27
This example in the manual should help you:
http://www.conitec.net/beta/ent_getvertex.htm - just in case you didn't take a look already.
Posted By: mireazma
Re: terrain verts z-snap - 06/29/11 12:22
Thank you both.
LE:
Sorry to bother you further but I've read the manual section 10 times and I can't grasp something:
- c.v is a pointer to a D3DVERTEX struct, corresponding to that specific CONTACT*;
- it means that I could also use c.v.y and get the same result as if using c.z (IIRC in Dx coords y is upwards)
Am I right?