Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (TipmyPip, AndrewAMD), 1,151 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
How can i get Blocks vert count in level ? #436870
02/04/14 15:36
02/04/14 15:36
Joined: Sep 2013
Posts: 8
V
VarYok Offline OP
Newbie
VarYok  Offline OP
Newbie
V

Joined: Sep 2013
Posts: 8
My level have blocks data.But This Codes are return 0 :

long numberOfBlockVert = ent_buffers(level_ent,0,0,&vbuffer,&ibuffer,NULL);

long numberOfBlockVert = ent_status(level_ent,1);

How can i get Blocks vert count in level ?

Re: How can i get Blocks vert count in level ? [Re: VarYok] #436874
02/04/14 15:46
02/04/14 15:46
Joined: Aug 2002
Posts: 3,258
Mainz
oliver2s Offline
Expert
oliver2s  Offline
Expert

Joined: Aug 2002
Posts: 3,258
Mainz
And why do you post this in every sub-forum into multiple threads?

Re: How can i get Blocks vert count in level ? [Re: oliver2s] #436877
02/04/14 18:32
02/04/14 18:32
Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
Quad Offline
Senior Expert
Quad  Offline
Senior Expert

Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
http://www.conitec.net/beta/ent_status.htm
says
Quote:
For map entities, the number of skins, triangles, and vertices is undefined, thus only mode=16 delivers a result. The total number of vertices and triangles of a map entity can be calculated with the ent_buffers function.

so you have to use ent_buffers.

AND
http://www.conitec.net/beta/ent_buffers.htm
says
Quote:
The number of vertices is ent_status(ent,1) for a model, and the maximum index number in the triangle buffer for level blocks or multi-mesh entities.


So you have to to loop through ibuffer and find the biggest value, which is the maximum index number which means "vertex count - 1" - that's assuming vertex indices start from 0. So you find the biggest index and add 1 to that and you get the vertex count.

Now, as the manual explains, ibuffer is the array of 3 indices that makes up the the triangles of the entity, (it's an array of arrays), you know the triangle count from the value returned by ent_buffers. So you know the length of ibuffer array.

also in my tries ent_buffers does not return 0, it returns the triangle count of the level_ent.


3333333333
Re: How can i get Blocks vert count in level ? [Re: Quad] #436883
02/04/14 22:41
02/04/14 22:41
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)


"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: How can i get Blocks vert count in level ? [Re: Superku] #436892
02/05/14 07:31
02/05/14 07:31
Joined: Sep 2013
Posts: 8
V
VarYok Offline OP
Newbie
VarYok  Offline OP
Newbie
V

Joined: Sep 2013
Posts: 8
My level_ent type is : 1 - Polygon based BSP map (A4, A5, A6) and this ode return all the time vert count 0.

long numberOfBlockVert = ent_buffers(level_ent,0,0,&vbuffer,&ibuffer,NULL);

SED version: 8.10.1

Last edited by VarYok; 02/05/14 09:31.
Re: How can i get Blocks vert count in level ? [Re: VarYok] #437334
02/14/14 10:23
02/14/14 10:23
Joined: Mar 2012
Posts: 927
cyberspace
W
Wjbender Offline
User
Wjbender  Offline
User
W

Joined: Mar 2012
Posts: 927
cyberspace
basicly what quad said is valid , i had this problem too while trying to learn these functions , you could ask sivan to copy and paste the code from my navmesh plugin source and convert it to lite-c , within my source i managed to count vertices per any block and per any terrain chunk ..


Compulsive compiler

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

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