Delgine 3D Tools & Content DeleD Community Edition
Forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

.map format

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    DeleD Community Edition Forum Index -> DeleD Plugins
View previous topic :: View next topic  
Author Message
Tearak
Member


Joined: 12 Jan 2005
Posts: 23

PostPosted: Fri Feb 18, 2005 6:59 am    Post subject: .map format Reply with quote

Rolling Eyes

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
View user's profile Send private message
Daaark
DeleD PRO user


Joined: 01 Sep 2004
Posts: 2696
Location: Ottawa, Canada

PostPosted: Fri Feb 18, 2005 7:24 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
Paul-Jan
Site Admin


Joined: 08 Aug 2004
Posts: 3066
Location: Lage Zwaluwe

PostPosted: Fri Feb 18, 2005 7:25 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Tearak
Member


Joined: 12 Jan 2005
Posts: 23

PostPosted: Fri Feb 18, 2005 9:27 am    Post subject: Reply with quote

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
View user's profile Send private message
dirkk
Member


Joined: 09 Aug 2004
Posts: 238
Location: Germany

PostPosted: Fri Feb 18, 2005 10:30 am    Post subject: Reply with quote

... I was too late.

[edit] Smile
Back to top
View user's profile Send private message Send e-mail
Paul-Jan
Site Admin


Joined: 08 Aug 2004
Posts: 3066
Location: Lage Zwaluwe

PostPosted: Fri Feb 18, 2005 11:02 am    Post subject: Reply with quote

*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 Wink
Back to top
View user's profile Send private message Visit poster's website
Daaark
DeleD PRO user


Joined: 01 Sep 2004
Posts: 2696
Location: Ottawa, Canada

PostPosted: Fri Feb 18, 2005 1:12 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
dirkk
Member


Joined: 09 Aug 2004
Posts: 238
Location: Germany

PostPosted: Fri Feb 18, 2005 3:07 pm    Post subject: Reply with quote

@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
View user's profile Send private message Send e-mail
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    DeleD Community Edition Forum Index -> DeleD Plugins 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