Gamestudio Links
Zorro Links
Newest Posts
ZorroGPT
by TipmyPip. 10/25/26 03:42
Chat Room for Zorro Programmers
by Haitao_Ren. 10/25/26 03:14
Trading Journey
by Haitao_Ren. 10/25/26 03:14
Algorithmic trading course with Zorro
by Haitao_Ren. 10/25/26 03:12
Zorro tutorial ideas?
by Haitao_Ren. 10/25/26 02:47
Zorro plugin for Hyperliquid.xyz
by mayarik. 10/24/26 09:14
Tradestation missing in table of contents
by AndrewAMD. 10/23/26 14:35
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
3 registered members (3run, TipmyPip, opm), 7,722 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
Haitao_Ren, JimSimons, julienp, julienper, KelleyAbbey
19247 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 | 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