Gift from me to you!

If you're looking for mapping help or you reckon you're a mapping guru, post your questions / solutions here

Moderator: Moderators

User avatar
HDL_CinC_Dragon
Brigadier General
Posts: 574
Joined: Mon Dec 22, 2003 8:32 pm

Post by HDL_CinC_Dragon »

Ive had a long past few days especailly with out sleep in the past 3... and to illustrate that i must revert to an image that we all have seen at least 100 times:

Image

im going to bed for a while... gnight folks, i might wake up tomarrow around 6pm EST lol
Image
Green Beret
Major General
Posts: 746
Joined: Mon Apr 19, 2004 12:21 pm
Contact:

Post by Green Beret »

Wow 4 post in a row, Do u ever edit a post....j/k :P
Image
User avatar
HDL_CinC_Dragon
Brigadier General
Posts: 574
Joined: Mon Dec 22, 2003 8:32 pm

Post by HDL_CinC_Dragon »

yaaaa I do but i didnt feel like it at the time :D
Image
User avatar
HDL_CinC_Dragon
Brigadier General
Posts: 574
Joined: Mon Dec 22, 2003 8:32 pm

Post by HDL_CinC_Dragon »

ok, im looking at prefab files i have made in MOHrad and im trying to figure out what all the numbers correspond with, heres what a prefab file for a single 64 x 64x 64 brushlooks like:
{
"classname" "worldspawn"
// brush 0
{
( 88 16 0 ) ( 48 16 0 ) ( 48 -16 0 ) common/origin 0 0 0.00 1 1 16777216 2176 0 surfaceColor -1.000000 -1.000000 -1.000000
( 48 -16 64 ) ( 48 16 64 ) ( 88 16 64 ) common/woodclip 0 0 0.00 1 1 536870912 16544 0 surfaceColor -1.000000 -1.000000 -1.000000
( 32 0 216 ) ( 72 0 216 ) ( 72 0 16 ) common/ladder 0 16 0.00 1 1 0 136 0 surfaceColor -1.000000 -1.000000 -1.000000
( 64 0 216 ) ( 64 32 216 ) ( 64 32 16 ) common/metalclip 0 16 0.00 1 1 536870912 32928 0 surfaceColor -1.000000 -1.000000 -1.000000
( 40 64 216 ) ( 0 64 216 ) ( 0 64 16 ) common/playerclip 0 16 0.00 1 1 65536 2193 0 surfaceColor -1.000000 -1.000000 -1.000000
( 0 64 64 ) ( 0 0 0 ) ( 0 64 0 ) common/caulk 0 16 0.00 1 1 0 160 0 surfaceColor -1.000000 -1.000000 -1.000000
}
}

it couldnt just be like each vertice has the 3 coords or something it had to be some confusing slop of numbers and brackets so i dont know how long it will take me to figure out all the numbers relevance, ive only figured out 11 so far but it gets harder as it goes... so thats just an update for you guys... Ill keep working on this for a long while sooooo yea...


UPDATE=======
= figured out - 14
Numbers not figured out = 40
NUMBERS THAT MAKE NO SENSE!!!! - 22


{
"classname" "worldspawn"
// brush 0
{
( 88 16 0 ) ( 48 16 0 ) ( 48 -16 0 ) common/origin 0 0 0.00 1 1 16777216 2176 0 surfaceColor -1.000000 -1.000000 -1.000000 //BOTTOM
( 40 -16 64 ) ( 40 16 64 ) ( 80 16 64 ) common/woodclip 0 0 0.00 1 1 536870912 16544 0 surfaceColor -1.000000 -1.000000 -1.000000 //TOP
( 32 0 216 ) ( 72 0 216 ) ( 72 0 16 ) common/ladder 0 16 0.00 1 1 0 136 0 surfaceColor -1.000000 -1.000000 -1.000000 //SOUTH
( 64 0 216 ) ( 64 32 216 ) ( 64 32 16 ) common/metalclip 0 16 0.00 1 1 536870912 32928 0 surfaceColor -1.000000 -1.000000 -1.000000 //EAST
( 40 64 216 ) ( 0 64 216 ) ( 0 64 16 ) common/playerclip 0 16 0.00 1 1 65536 2193 0 surfaceColor -1.000000 -1.000000 -1.000000 //NORTH
( 0 64 64 ) ( 0 0 0 ) ( 0 64 0 ) common/caulk 0 16 0.00 1 1 0 160 0 surfaceColor -1.000000 -1.000000 -1.000000 //WEST
}
}

ive got a 64 x 64 x 64 brush compltely zeroed on the axis's so that some of the sides of the brush have a coord of 0, its not in some random location. SO WHERE THE HELL DOES 216 AND CRAP NUMBERS LIKE THAT COME FROM!?!?!
Image
User avatar
HDL_CinC_Dragon
Brigadier General
Posts: 574
Joined: Mon Dec 22, 2003 8:32 pm

Post by HDL_CinC_Dragon »

from now on, all updates will be posted only on the front page so yea...
Image
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

face

Post by tltrude »

A face is made of two triangles, so some of the numbers are probably angles.
Tom Trude,

Image
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post by lizardkid »

you cant save them as obvious numbers because the file ends up being HUGE, first rule in programming is save space. these are probably matrices or something.

jv can tell us!

...when he finds this thread.
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
User avatar
HDL_CinC_Dragon
Brigadier General
Posts: 574
Joined: Mon Dec 22, 2003 8:32 pm

Re: face

Post by HDL_CinC_Dragon »

tltrude wrote:A face is made of two triangles, so some of the numbers are probably angles.
but if it were angles and such for two triangles, wouldnt therte only be 2 bracket sets instead of 3?
lizardkid wrote:these are probably matrices or something.
but how would a matrix apply to the brush faces though? and arnt matrices all in one bracket instead of broken up?

[quote="lizardkid], first rule in programming is save space[/quote]
I know :D
lizardkid wrote:jv can tell us!
Yes he can :)
Image
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post by lizardkid »

on second inspection it looks like the vertice formation for a brush, each coord refers to a vert in ( X Y Z ), and since a regular brush has only 6 verts and there's six sets of numbers composing brush 0 i'd say thats it, each set of () () () has XYZ coords for a vertice.

and theres the surface texture data to be put on the brushface connected to that vert after that and the color, etc.

as for the 216 stuff remember that any of that (especially on the Z axis) could be relational to other vertices or that that vert could be offset enoguh to have achieved 216... because you only centered one vert on 0 0 0.

now i see why heightmaps were made.
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
User avatar
HDL_CinC_Dragon
Brigadier General
Posts: 574
Joined: Mon Dec 22, 2003 8:32 pm

Post by HDL_CinC_Dragon »

it sitll dosnt make sense though, i tried to rationalize the number of verts with coords of XYZ but that doesnt add up with the three brackets, and the 216 and stuff like that doesnt make sense becuase my brush doesnt exceed 64 as a coordinate or a size value... it just comes out of no where apparently
Image
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Yay :) Quake3 brush format = way fun as the numbers don't seem to make any sense at first glance. These numbers do not represent vertices, or angles. Instead, they define 3 'virtual' points per face. These 3 points uniquely define a plane in 3d space. The plane extends to infinity, so the extents of each face are not contained in the definition of each face.

When mohradiant or q3map reads the brush data, it simply calculates the intersections between two planes. The result is an infinitely long line. The only case when 2 infinite planes don't intersect is when they are parallel.

Having determined these infinitely long lines (there will be 12 for a regular (box) brush), the intersections of these lines are determined. Two lines intersect if they are not parallel and lie in a single plane. The intersections of these lines give the brush vertices, and the finite line between them becomes and edge. Voil?, a brush :)

Note that the virtual points that define each plane are rather arbitrary: if you translate them within the plane they define, they still define the same plane. Huh :?. Well, say we're talking about the top plane, and it were defined as:

( 48 -16 64 ) ( 48 16 64 ) ( 88 16 64 ) common/woodclip 0 0 0.00 1 1 536870912 16544 0 surfaceColor -1.000000 -1.000000 -1.000000

You can easily see it is a horizontal plane, as all z-coordinates are equal. This means that you can add any 2 numbers to the x and y coordinates and still get the same plane (and thus the same brush). Note that you have to add the same two numbers to each vectors, otherwise the shape of the virtual triangle changes. Example:

( 0 0 64 ) ( 0 32 64 ) ( 40 32 64 ) common/woodclip 0 0 0.00 1 1 536870912 16544 0 surfaceColor -1.000000 -1.000000 -1.000000

And you still have the same brush :)

Things to watch out for:
  • If the three virtual points lie on one line, a plane cannot be defined. This is called a degenerate plane.
  • If you swap the order of the points, you also swap the direction of the plane. This means the face which was initially facing out, is now facing in. q3map will report this as a bad normal.
So what is the right order to use? This is determined by the right-hand rule, which is somewhat cumbersome to explain in text. Fortunately, wikipedia has a nice article on it :)

http://en.wikipedia.org/wiki/Right_hand_rule

The 'x' and 'y' axes are determined by taking the difference between point [2 and 1] and [3 and 1] respectively. So that:
x = point2 - point1
y = point3 - point1

If you are familiar with vector mathematics:
normal = -x x y

Where 'x' denotes the vector cross product.

The '-' appears because, for some reason, radiant uses a left hand rule rather than a right hand rule. This is identical to swapping x and y axes, so that:

normal = -x x y = y x x

Applying this to the top face above:
x = ( 0 32 64 ) - ( 0 0 64 ) = (0 32 0)
y = ( 40 32 64 ) - ( 0 0 64 ) = (40 32 0)

normal = y x x = (40 32 0) x (0 32 0) = (0 0 1280) [calculator]

What we have now is a vector pointing straight up, which means the face under consideration (the top plane), is actually a top plane :)

Hope this helps a bit, if not I'll try again :)

Good luck. 8-)
Image
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post by lizardkid »

I'm in awe. thats GENIUS, saves brush data by 3x at least, as well as filesize. John Carmack is a god.

You just inspired my mathematics education jv.
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
PKM
General
Posts: 1888
Joined: Tue Aug 09, 2005 4:43 pm
Location: Philadelpia but stuck in San Antonio TX (hell)

Post by PKM »

holy crap, my brain just took a dump out of sheer awe and terror. understanding quantum theory is easier but damn if jv didn't make you think there was the possibility that you could understand it while reading it.
i'm not f****** angry, i'm from philadelphia .
Image
Ophisâ„¢
Colonel
Posts: 461
Joined: Sun Mar 12, 2006 2:30 pm
Location: England, Manchester
Contact:

Post by Ophisâ„¢ »

I read the first line and my head started to hurt, im gonna go lie down.
Image[ Formerly Known As Snakeâ„¢ ]
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post by lizardkid »

jv has spoken, and he used list.

tremble before him.
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
Post Reply