Inside3D!
     

Calculating the Extreme X, Y, Z of a .bsp?

 
Post new topic   Reply to topic    Inside3d Forums Forum Index -> Engine Programming
View previous topic :: View next topic  
Author Message
Baker



Joined: 14 Mar 2006
Posts: 1538

PostPosted: Tue Dec 23, 2008 4:06 am    Post subject: Calculating the Extreme X, Y, Z of a .bsp? Reply with quote

Does anyone know how to within the engine calculate the extreme X, Y, Z coordinates (min, max X ... min, max Y, etc.)?

I've been looking through the .bsp stuff and would like to know for "minimap" purposes, but alas I don't understand enough to be able to identify how to capture these values.
Back to top
View user's profile Send private message
metlslime



Joined: 05 Feb 2008
Posts: 177

PostPosted: Tue Dec 23, 2008 9:09 am    Post subject: Reply with quote

I guess, while loading vertices, compare and modify as needed a mins[] and maxs[] for the map
Back to top
View user's profile Send private message
Electro



Joined: 29 Dec 2004
Posts: 241
Location: Brisbane, Australia

PostPosted: Tue Dec 23, 2008 10:06 am    Post subject: Reply with quote

Yeah like what metlslime said.

setup a mins to be 99999999 (or some ridiculous number to make sure everything is caught)
maxs to be -99999999

if (vert[0] < mins[0]) mins[0] = vert[0];

same for y and z etc... you get the idea
It's like starting off with an inverted box, then pushing it out every time you have a vertex that requires it to grow.

The result should be a bbox for 'worldspawn' Smile
_________________
Unit reporting!
http://www.bendarling.net/
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Inside3d Forums Forum Index -> Engine Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2004 phpBB Group