Archived

This topic is now archived and is closed to further replies.

omegasyphon

my bsp question

Recommended Posts

what i would like to know is how do i set up my bsp. im using indexed vertex arrays. for each model i have an array of cordinates and then an array of points. how would i setup a bsp that knows which triangles to draw? would i sort the x or the y or the z value? i dont know

Share this post


Link to post
Share on other sites
With BSP you don''t sort your triangles over and over... you just walk the BSP tree... you just sort down you Player position and then walk the tree up from the node where the player is.. At least that''s the way I''d do it... I''m working on a Leveleditor so I don''t really have anything to do with that... (well.. a little Octree..)

cya,
Phil

Visit Rarebyte!
and no!, there are NO kangaroos in Austria (I got this questions a few times over in the states

Share this post


Link to post
Share on other sites
Hi OmegaSyphon,

That's a pretty good question. You need to known alot about the mesh you are using, to do collision detection, frustum-culling, ...

Now, back to the question. On the NVidia web site, they tell you that you must use Vertex Buffer with meshes with at least 1k polygons in it.

You're asking what's the best way to store everything, to make your bsp work. If i understand the question correctly. Since your world (map) will propably be constitued of more than a few thousands polygons, it's a good canditade to VertexBuffer. So use VertexBuffer for all the vertex constituing your map.

Since, the VertexBuffer only store the vertex, you need a way to build triangle around those vertex, put some textures, add lighting, do collision-detection (polygon-polygon). So, here's where i suggest you to write an explicit class like CTriangle. That will make your live so easy, and in the mean-while optimise your engine.

Why use a CTriangle class? here's why...

- First using a list of triangle you can easly build an IndexBuffer.

- Secondo, you can easly build an Octree/Bsp/Quatree, following, you can get a list of visible triangle from those Partitionning-Algorithms.

- Third, prior rendering, you can sort the visible-tiangle-list in a such way to minimize TextureChange/StateChange !

- Finaly, it's a lot more easier to code Collision-Detection algoriths with Triangle than an index.

Hope that can help you.
Fell free to ask more question ...

B2Funny

Edited by - b2funny on July 28, 2001 2:45:29 AM

Share this post


Link to post
Share on other sites
Personnaly, I use one static VB that store all vertex from the bsp.
After I count how many indice need each texture then I divide my IB, and I store the offset each texture have.
Then I fill the IB using PVS then draw.
So I call SetTexture only once for each texture.

Why English rules?? C pas très malin tout ça!

Share this post


Link to post
Share on other sites
i guess what confuses me is if my list that has about 9500 cordinates in it, is how do i know which cordinates to draw and what not in the vertex array? i suppose a tutorial on vertex buffers would be nice. the 9500 cordinates are the x y and z values of the map. btw is 1600 triangles to much or not enough for a terrain?

Edited by - omegasyphon on July 28, 2001 9:52:19 PM

Share this post


Link to post
Share on other sites