Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Code Snippets / BSP (Quake 3) Face & Vertex decoder

Author
Message
Ratty Rat
22
Years of Service
User Offline
Joined: 24th Sep 2002
Location:
Posted: 13th Jan 2005 01:10 Edited at: 13th Jan 2005 01:21
This (DBPro) source code will open a BSP file (currently Quake 3 only) then extract and store all the vertex and face data in it.

As an added feature it then creates an object from the data and allows you to move around it (use mouse buttons to move forward/back).

Note: Look for the line 'BSPFILE = "minimanq3.bsp"' and change the filename to the appropriate BSP file.
Note2: It does not do anything with face types 3 or 4, also I don`t think I`m creating face type 2 correctly.
Note3: A file '!BSPDUMP!.TXT' is created with some data about the faces etc.
Note4: It takes a few moments to decode the file.

I created this primarily to use BSP data with the Tokamak physics plugin.

Hope you find it useful.

RR

"Don`t try to engage my enthusiasm, I don`t have one"
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 13th Jan 2005 20:56
nice. kinda pointless, but nice. you do know that you can already load bsp maps into DB?

"eureka" - Archimedes
Chenak
22
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 13th Jan 2005 21:12
very very nice it is useful because dbp bsps are bugged and you can't actually do anything with them apart from basic automatic collision (which is bugged), this snippet loads bsps as objects so we can do a lot of fancy stuff like apply newton physics
Ratty Rat
22
Years of Service
User Offline
Joined: 24th Sep 2002
Location:
Posted: 14th Jan 2005 01:43
Thanks Chenak, that`s exactly what I wrote it for, I wanted to be able to use BSP maps in my own game which uses Tokamak to create realistic physics.

Attached is an Update, it fixes :
1) Type 2 Faces (BSpline Grid type) now work (but just the basic square shape)
2) Adjusted the orientation so it matches the DBPro BSP compiler
3) Adjusted the Scale to match DBPro BSP (Really odd, vertex data needed to be divided by 34.49, don`t know why )
4) Made the map wireframe

You can now use LOAD BSP on the same map and they should overlap (only tested on 1 Map so far).

"Don`t try to engage my enthusiasm, I don`t have one"
Essence
22
Years of Service
User Offline
Joined: 12th Oct 2002
Location: The Netherlands
Posted: 1st Mar 2005 17:53
You are brilliant


First DifNiX -> now EvaX.

Login to post a reply

Server time is: 2024-11-23 13:53:02
Your offset time is: 2024-11-23 13:53:02