Jump to content
  • Advertisement
Sign in to follow this  
S8N

Quake 3 BSP format: best way to do face picking?

This topic is 3940 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, I was wondering if any of you could help me with some theory? I am using the Quake 3 BSP format for map data in my program and am at a stage where I need to work out which face of the map a user is pointing at when they click their mouse and also the 3D co-ordinate for the exact location on the face. I would be grateful for any suggestions/links you have for the most efficient way to implement a feature like this. Thanks!

Share this post


Link to post
Share on other sites
Advertisement
the usual raytrace method would be ideal. It's what Quake uses for collision detection.

http://www.devmaster.net/articles/quake3collision/

Share this post


Link to post
Share on other sites
Thanks for the link!

However, I've been trying to implement that method today and it isn't working correctly for me, I don't think it is detecting any collisions with the brushes as the outputFraction variable is always 1.0 afterwards and the outputEnd position is just the point at the end of the ray.

As far as I can tell my code is pretty much the same as on that site, I've gone through it line by line to compare it a couple of times now.

Have you (or anyone else) come across this problem before?

Share this post


Link to post
Share on other sites
Never mind! I managed to fix it just now! Turns out I had to ADD the plane distances in the code instead of subtracting as I had previously negated the BSP plane distances in my map data. It now works exactly as wanted. Thanks again!

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!