Index | FAQ | Search | Memberlist | Usergroups | Profile | Log in to check your private messages | Log in | Register

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

| Inside3d Forums Forum Index -> Engine Programming

View previous topic :: View next topic
Author | Message
--- | ---
Baker Joined: 14 Mar 2006 Posts: 1538 |

Posted: Tue Dec 23, 2008 4:06 am Post subject: Calculating the Extreme X, Y, Z of a .bsp? |

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 |

metlslime Joined: 05 Feb 2008 Posts: 177 |

Posted: Tue Dec 23, 2008 9:09 am Post subject: |

I guess, while loading vertices, compare and modify as needed a mins[] and maxs[] for the map

Back to top |

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

Posted: Tue Dec 23, 2008 10:06 am Post subject: |

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'
_________________
Unit reporting!
http://www.bendarling.net/

Back to top |

Display posts from previous:

| 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