|
|
Help!
by VoroneTZ. 10/14/25 05:04
|
|
|
|
|
|
|
3 registered members (TipmyPip, Quad, AndrewAMD),
7,177
guests, and 2
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
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,211 İstanbul, Turkey
Quad
Senior Expert
|
Senior Expert
Joined: Oct 2007
Posts: 5,211
İstanbul, Turkey
|
http://www.conitec.net/beta/ent_status.htmsays 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.htmsays 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: Superku]
#436892
02/05/14 07:31
02/05/14 07:31
|
Joined: Sep 2013
Posts: 8
VarYok
OP
Newbie
|
OP
Newbie
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
Wjbender
User
|
User
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
|
|
|
|