Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (lijoyi2011), 1,042 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
terrain verts z-snap #375934
06/28/11 21:04
06/28/11 21:04
Joined: Feb 2010
Posts: 68
mireazma Offline OP
Junior Member
mireazma  Offline OP
Junior Member

Joined: Feb 2010
Posts: 68
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.


ERROR in communism.cpp, line 0:
#include<god.h>
was fatally missed.
Re: terrain verts z-snap [Re: mireazma] #375936
06/28/11 21:23
06/28/11 21:23
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
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)


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: terrain verts z-snap [Re: mireazma] #375938
06/28/11 21:27
06/28/11 21:27
Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Pappenheimer Offline
Senior Expert
Pappenheimer  Offline
Senior Expert

Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
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.

Re: terrain verts z-snap [Re: Pappenheimer] #376022
06/29/11 12:22
06/29/11 12:22
Joined: Feb 2010
Posts: 68
mireazma Offline OP
Junior Member
mireazma  Offline OP
Junior Member

Joined: Feb 2010
Posts: 68
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?

Last edited by mireazma; 06/29/11 12:38.

ERROR in communism.cpp, line 0:
#include<god.h>
was fatally missed.

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1