note that the distance is negated relative to more standard plane notation. in mathematics, the plane is generally two-sided. in quake, the normal faces directly forwards into empty space (unless the surface has SURF_PLANEBACK set, in which case the normal faces backwards - all 4 values are logically negated (or in the case of nodes, the two children are pre-swapped, avoiding the need for the engine to do anything special). note that the plane normals in a quake bsp are arranged to be primarily positive, reducing the total number of planes needed, and facilitating axial lookups).for surfaces, the two tangents are normally available via the texture vector values, but note that these vectors are not kept strictly perpedicular to the normal, nor are they always normalized. because quake is weird and has annoying texture mapping, as well as texture scaling.

Thanks for info on the weirdnesses, especially since that information can only be known from experience and no one finds surprises any fun.

I spotted a couple of these in txqbsp.

Spike wrote:pointonplane = point - (distfromplane*plane->normal);

I'm trying to do the opposite of that and draw the planes.

If I "cheated" I could use VectorVectors (like AngleVectors, except uses vectors) on a plane normal to get the side and up and then do some extra work to get a couple of points and use the 3 points to plane formula.

But that seems like a ton of calculations for something simple.

It seems like something intuitive and simple should be able to take the plane normal and get the A*x + B*y + C*z - D = 0.

The night is young. How else can I annoy the world before sunsrise? Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..

if you make a guess at a tangent (rotate the axis or just hardcode something), you can crossproduct it with the normal and normalize for a real tangent. and then do it again for some bitangent too. of course, these vectors have no relation to any texturing, but hey...then you can generate a quad by moving '0 0 0' along the plane's normal onto the plane then extend sideways to find your four points.

alternatively you can figure out which axis is the most significant for the plane, pick a set of 4 points aligned on that axis, and then push them to match the plane.

if you're drawing a brush, once you have a quad you can then clip that quad by the other planes (retaining only the stuff on the inside of the brush). the resulting clipped polygon is your brush's face.

Baker wrote:Just want to say thanks to Spike for help with these kinds of things over the years.

Spike is the pillar of this forum Practically everything of the very few things I know about programming is thanks to him.

Plus I always admire your study on Quake engine, Baker. Did you start learning C programming with the classic "rearrange my cd albums in alphabetically order" learning program or did you start tinkering with Quake engine as your first experience? I'm curious about it

toneddu2000 wrote:Plus I always admire your study on Quake engine, Baker. Did you start learning C programming with the classic "rearrange my cd albums in alphabetically order" learning program or did you start tinkering with Quake engine as your first experience? I'm curious about it

I had an interest in C before interacting with mh or Spike or compiling an engine.

But I had assumed C was an unknowable language.

mh ended up prodding me quite a bit to engine code when I asked generic "engine what-ifs" at arm's length. And Spike always provided detailed answers I often would not immediately understand but may later re-read and understand.

Around 2011, an odd realization occurred to me. I knew C. Then I realized not only did I know C, but I knew C better than 80% of the people who claim to know C.

Then I was forced to realize the paradox that I had considered learning C impossible and that I was better than 80% of people that "know C".

Interesting? Well ... even now I feel if I think about that too hard I might accidentally unwind a causality paradox in the fabric of the universe that will destroy everything ... so I don't.

But yeah, fucked up for sure. How the fuck did that happen?

Decent minds don't want to know!

That being said, I would not know C if it were not for mh and Spike. And even more fucked up that I created "Quakespasm source base 0" before completely knowing how to code C (yeah, Quakespasm is not a fork of FitzQuake but of precisely of Baker FitzQuake 0.95 which I wrote in 6 hours to positively tweak Spirit by making a Linux version despite not having Linux, haha!). Let alone wrote modern ProQuake before knowing C with bits I picked up here and there and sheer determination.

(next topic before we cause universe to explode! It still makes no sense! We are making the Elder Gods very angry by discussing this inconsistency and right now I can tell I have mad them real, real mad If I say one more sentence, surely a lavaball will be hurled in my general direction by angry Chthon)

The night is young. How else can I annoy the world before sunsrise? Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..

Baker wrote:And Spike always provided detailed answers I often would not immediately understand but may later re-read and understand.

LOL! That happened to me the same way!(but with quakeC, instead!). Spike is like a philosopher: his words are never quite understandable the first time you hear them!

Baker wrote:That being said, I would not know C if it were not for mh and Spike. And even more fucked up that I created "Quakespasm source base 0" before completely knowing how to code C (yeah, Quakespasm is not a fork of FitzQuake but of precisely of Baker FitzQuake 0.95 which I wrote in 6 hours to positively tweak Spirit by making a Linux version despite not having Linux, haha!)

Wait a minute.. Are you the author of QuakeSpasm?!?

Baker wrote:(next topic before we cause universe to explode! It still makes no sense! We are making the Elder Gods very angry by discussing this inconsistency and right now I can tell I have mad them real, real mad If I say one more sentence, surely a lavaball will be hurled in my general direction by angry Chthon)