View previous topic :: View next topic |
Author |
Message |
Tearak Member
Joined: 12 Jan 2005 Posts: 23
|
Posted: Fri Feb 18, 2005 6:59 am Post subject: .map format |
|
|
Dirkk if you are out there.
I notice from a number of .map (probabaly Quake export) files I have viewed that, for example a simple cube (8 vertices, 12 triangulated faces) is represented by only 6 faces.
( -100 0 0 ) ( 0 100 0 ) ( -100 100 0 )
( -100 0 100 ) ( 0 100 100 ) ( 0 0 100 )
( -100 0 0 ) ( 0 0 100 ) ( 0 0 0 )
( 0 0 0 ) ( 0 100 100 ) ( 0 100 0 )
( 0 100 0 ) ( -100 100 100 ) ( -100 100 0 )
( -100 100 0 ) ( -100 0 100 ) ( -100 0 0 )
How is this translated into a cube? or Do you know of any reading I can follow up on?
I know this is asking quite a lot, but I would really appreciate any input.
Thank you
Tearak |
|
Back to top |
|
|
Daaark DeleD PRO user
Joined: 01 Sep 2004 Posts: 2696 Location: Ottawa, Canada
|
Posted: Fri Feb 18, 2005 7:24 am Post subject: |
|
|
A cube is made up of only 6 faces(quads). What's the problem?
.map files come from QERadient, and similar editors. They aren't store in a way that optimized for your game, they are stored to be easy to editiable, and then be easy to convert into bsp trees.
Those editors didn't work with polygons directly, they used brushes. Brushes were made to follow certain rules about how the engines wanted their geometry to be set to work best. The map files were never used directly in the games, they were exported into new files. All the brushes were broken down into proper triangles, and then stored in their own sectors or (whatever the game specific exporter wanted them to be sorted into.)
If you want to use the map files, you should write a parser to break them down into triangles, and store them in a new filetype that you can more easily load into your engine. |
|
Back to top |
|
|
Paul-Jan Site Admin
Joined: 08 Aug 2004 Posts: 3066 Location: Lage Zwaluwe
|
Posted: Fri Feb 18, 2005 7:25 am Post subject: |
|
|
In .map files faces are not explicitly defined. Instead, the brush is defined by the intersection of planes. 6 planes define a cube, and each plane can be described by 3 points.
I tried to google you a nice reference, but all I could find was
http://collective.valve-erc.com/index.php?go=map_format
Oh well, it does the job of explaining the file format I guess... |
|
Back to top |
|
|
Tearak Member
Joined: 12 Jan 2005 Posts: 23
|
Posted: Fri Feb 18, 2005 9:27 am Post subject: |
|
|
Vampyre_Dark wrote: |
A cube is made up of only 6 faces(quads). What's the problem? |
Thanks Vampyre_Dark but a cube is made up of 12 triangulated faces.
Paul-Jan has provided me with what I need.
Much appreciated both of you.
Tearak |
|
Back to top |
|
|
dirkk Member
Joined: 09 Aug 2004 Posts: 238 Location: Germany
|
Posted: Fri Feb 18, 2005 10:30 am Post subject: |
|
|
... I was too late.
[edit] |
|
Back to top |
|
|
Paul-Jan Site Admin
Joined: 08 Aug 2004 Posts: 3066 Location: Lage Zwaluwe
|
Posted: Fri Feb 18, 2005 11:02 am Post subject: |
|
|
*lol* Yeah I know the question was directed at you, but as you don't always have the time to do daily posts on this forum I thought I'd beat you to it |
|
Back to top |
|
|
Daaark DeleD PRO user
Joined: 01 Sep 2004 Posts: 2696 Location: Ottawa, Canada
|
Posted: Fri Feb 18, 2005 1:12 pm Post subject: |
|
|
Tearak wrote: |
Vampyre_Dark wrote: |
A cube is made up of only 6 faces(quads). What's the problem? |
Thanks Vampyre_Dark but a cube is made up of 12 triangulated faces. |
Heh, I realize this. I was trying to explain that the .map file were saved out from editors that didn't work directly with triangles! |
|
Back to top |
|
|
dirkk Member
Joined: 09 Aug 2004 Posts: 238 Location: Germany
|
Posted: Fri Feb 18, 2005 3:07 pm Post subject: |
|
|
@vampire: indeed. and the collision routines of the engines work with planes which are made of 1 vector a.k.a. three points.
@PJ: fair and square! |
|
Back to top |
|
|
|