[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4787: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4789: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4790: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4791: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
InsideQC Forums • View topic - Brushes ---> Faces / Verts / Polys / Edges

Brushes ---> Faces / Verts / Polys / Edges

Discuss the construction of maps and the tools to create maps for 3D games.

Moderator: InsideQC Admins

Brushes ---> Faces / Verts / Polys / Edges

Postby Baker » Thu Jan 26, 2012 3:05 am

The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
User avatar
Baker
 
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Re: Brushes ---> Faces / Verts / Polys / Edges

Postby WeeGee9000 » Thu Jan 26, 2012 1:52 pm

intresting
ill keep that in mind
WeeGee9000
 
Posts: 24
Joined: Thu Dec 29, 2011 11:43 am

Re: Brushes ---> Faces / Verts / Polys / Edges

Postby Spike » Thu Jan 26, 2012 6:16 pm

aye, its a plane/pain...
anyway, figure out the plane equation, figure out the s and t vectors (doesn't actually need to be the ones specified, just use some random directions so long as they're perpendicular to the normal), generate an absolutely massive quad using those s and t vectors, then clip that quad against the other planes in the brush. This should get you usable geometry for each face.

remember: dot(point, planenormal) - planedist = 0;
by calculating the value at two verts, you know the plane cuts the edge if one is negative and one is positive. you can then calculate the the fraction along the line based upon their relative magnitudes, and interpolate them to find the point where it intersects. you just have to trim away the extra verts beyond the boundary.

You might want to keep that poly/planes clipping code - it could be useful for clipped decals too (where you take the entire world and clip away anything too far from the center)!
.
Spike
 
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Re: Brushes ---> Faces / Verts / Polys / Edges

Postby mh » Thu Jan 26, 2012 6:57 pm

3 points is all that's required to define a plane and with 3 points any shape is guaranteed to be planar (one reason why gfx cards use triangles). I've always thought it would be pretty cool to store the original map brushes in the BSP file and use them for drawing with (after the appropriate processing) - I believe HL2 does this. Lightmaps would be a bitch though, but if you could resolve that it should be considerably more efficient that the evil QBSP does to them. It's sometimes better to just pass the extra gemoetry to the GPU and let it clip/cull it than it is to waste time building complex structures on the CPU at runtime (some brush models are good candidates for this trick - don't bother with the backface test, just put the entire model in a static VBO and draw it with one call, see if it works in your favour).
User avatar
mh
 
Posts: 2292
Joined: Sat Jan 12, 2008 1:38 am

Re: Brushes ---> Faces / Verts / Polys / Edges

Postby Spike » Thu Jan 26, 2012 8:15 pm

my problem is that if I ever made a brush renderer, I'd want to do some red faction type carving far far too much. :)
brushes are certainly useful for more accurate collisions at alternative box sizes ala q2/q3, though you'd still want something optimised to ignore irrelevent ones (octtree with nodes added when the previous tier gets too full, perhaps)
.
Spike
 
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Re: Brushes ---> Faces / Verts / Polys / Edges

Postby Baker » Fri Jan 27, 2012 9:55 am

The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
User avatar
Baker
 
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Re: Brushes ---> Faces / Verts / Polys / Edges

Postby Baker » Fri Jan 27, 2012 10:02 am

Btw ... I have some funny ideas on some easy "free" lighting that mostly involves a using a single 256 x 256 RGBA texture (to query just like R_LightPoint) plus a height map texture. Would look better than full bright. It wouldn't look realistic but it'd add some sense of variation to the surfaces for "free".
The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
User avatar
Baker
 
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am


Return to Mapping

Who is online

Users browsing this forum: No registered users and 1 guest