Go to QuArK Web Site
Curves (Patches)
Updated 05 Apr 2018
Upper levels:
QuArK Information Base
2. Map editing

 2.3. Curves (Patches)

 [ Prev - Up - Next ] 

Curves are one of the major new features of the Quake3 engine. Q3 curves are implemented mathematically as things called 'quadratic bezier patches' (one of many different kinds of 'parametric curve'), but happily you don't have to know anything about the math to use them in map-editing.


 Index


 Patch Basics

tiglari - 05 Apr 2018   [ Top ] 

A basic patch (there are also composite patches that we call 'quilts') can be thought of as a squarish sheet of material stretched out by a 3x3 grid of 9 'control points'. To make one, start a basic map and click on the patch icon in the user panel (labelled 'bezier'). You will then see a grid of colored control points drop into the overhead view of the map:

The (here horizontal) lines of control points of the same hue are the rows, the vertical ones are the columns. The points get darker as you move along the rows up from index zero. If you leave the cursor sitting over a control point for a while, a rather large flyover hint appears, beginning with the control point's row and column indexes, and giving rather extensive information about stuff you can do.

The black dot is a handle which can be used to move the whole patch, and also has a few RMB (Right Menu Button) commands.

Now the patch is 'anchored' at the corners, in the sense that if you drag a corner point, the patch is pulled out with it, but it is only 'attracted' by the non-corner points; if one of them is dragged, the patch pulls out towards it, but does not stay attached. This effect also appears with 3-dimensional movement, as you can see by opening a 3d view and playing around with it:

If you play around with the patch and then run the map in Quake3, you'll find that the patch displays a texture on only one side, and also only blocks movement on that side, an fact which could be used to make some rather annoying effects in maps.

There is quite a bit more to patches, as we will see more of below, but direct patch editing is slow and difficult, and not a good way to approach basic tasks such as making archways and rounded corners. For these purposes we instead use 'Shape Builders'.


 Quilts

tiglari - 05 Apr 2018   [ Top ] 

A basic patch has nine control points, arranged in 3 rows of 3 elements each. Given essential limitations on what these ('quadratic bezier') patches can do, to make a full range of shapes, you need multiple 3x3 patches. A semi-decent approximation to a circle for example needs at least four (although it's noticeably squarish, and to make it rounder you'd need more). Typically lots of these patches will share edges, so it's natural to think of 'quilts' of 3x3 patches, sharing edges.

The Q3A engine provides direct support for such quilts, as long as they are rectangular. If you think about the math you'll see that thanks to the edge sharing, a quilt of four patches in a square will have 5x5 = 25 different control points, and a strip of four patches that might be arranged in a row to be wrapped around to make a columns will be a 3x9 quilt. And that in these quilts, control points on odd-numbered rows/columns will lie on (basic) patch edges, and if the point is in an odd-numbered row and column it will be a patch corner.

In Q3Radiant documentation, quilts are called 'meshes', but there are lots of different kinds of meshes, and these quilts, or more precisely, quadratic quilts, have special properties, so we'll call them quilts to distinguish them from whatever amazing stuff might come next.

Currently you can make quilts by RMB on a patch control point, then 'Thicken -> Add Row/Column'. This has the effect of replacing one row or column of patches with two (and so adding two additional strips of control points). Another way to make quilts is to dissociate the images from one of the shapebuilders, such as column. Playing around with the quilts you can see the difference between the odd and even numbered rows and colums. The column for example has a square of control points with the odd-numbered ones in the middle of the sides and the evens at the corners; if this were reversed the shape would be a rectangular rather than a rounded column.

QuArK definitely needs more elaborate facilities for creating and shaping quilts, hopefully these will develop over time.


 Texture Management

tiglari - 05 Apr 2018   [ Top ] 

There are currently three basic ways of manipulating textures on patches, dragging, a dialog box, and projection. For dragging, drag on a point with the 'S' key depressed. Not much will seem to happen, but when you stop dragging, the texture will be 'pulled' in the direction you dragged.

If you drag again and look closely in the message window at the bottom left of the screen while dragging, you'll see numbers, these are the texture coordinates of the point. In patches & quilts, texture coordinates are 'OpenGL style'; one corner of the basic texture tile is (0,0), the opposite (1,1). Note that a patch where the far corner is (2,2), and the other coordinates correspondingly doubled, will have the texture scale reduced by half, since four tiles of texture will be squeezed into the patch instead of the one.

As with point dragging, you can hold down combinations of Shift and Alt to drag the texture CP's or rows, columns or the whole patch/quilt.

Then on the Control Point RMB menu there's an item Texture Coordinates; here you can enter them in numerically, with options to extend the resulting change to the row, column or whole patch/quilt. This is functionally the same as dragging.

Then finally, if a face is tagged, you can project the texture of the patch from or to the tagged face. This is a 'flat' projection, so it won't look too good on seriously curved patches (but would work fine for something like a buckled or warped plate on a floor or wall).



Copyright (c) 2022, GNU General Public License by The QuArK (Quake Army Knife) Community - https://quark.sourceforge.io/

 [ Prev - Top - Next ]