Jump to content
  • Advertisement
Sign in to follow this  
lukesmith123

Calculating which vertices corrospond to which triangles in .bsp

This topic is 2533 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

Hi,

Im loading in vertices from a quake3 .bsp file. I calculate the number of triangles in the bsp by dividing the number of indices by 3.

I want to calculate the tangents and bitangents of the vertices but I cant figure out how to find which verts corrospond to each triangle.

Is there some algorthim for calculating this?

Share this post


Link to post
Share on other sites
Advertisement
Thanks yeah I looked at that alot to load the .bsp file but the file only contains a list of vertices and indices etc but doesnt store triangles so rendering it is fine but then when I come to wanting to get the tangents and bitangents of each vertice I get stuck because I dont know how I could figure out which other vertices I need to factor into the equation when only faced with vert / indices.

Its not really specific to .bsp but I just thought It was worth mentioning where my vertex information was coming from.

I thought there might be some way of figuring out which vertices apply to each triangle based on the indices?

Share this post


Link to post
Share on other sites
I am pretty sure this describes exactly for what you are looking.
Face data is used to create the triangles of that face and are in “triangle fan” format. If a face has 20 vertices, it has 18 triangles. All triangles start with the first vertex in the list of vertices in the face.

So if you have a face with 4 vertices indexed as follows:
0 1 2 3

Then you have triangles:
0 1 2
0 2 3



L. Spiro

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!