Jump to content
  • Advertisement


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


my bsp question

This topic is 6286 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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..)


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 ...


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

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!