Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Laguna

Bezier (patch mesh) primer tutorial inside [large post with images]

Recommended Posts

Okay... I'm going to write up a quick tutorial on the uses of the beziers in the Doom 3 engine, and there are a few neat, new little features included in the new editor for these.

For this tutorial, I'm using a blank map for illustration purposes (I hate having superfluous crap in maps I'm working on).

For those of you who haven't used GTK/Q3 Radiant before, read carefully...

One thing worthy of noting is subdivision of patch meshes. You can make a patch mesh of approximately 1x1 units and subdivide it up to 32 times. Thusly, no external modeling programs will really be needed for architecture at this point.

Time to get your feet wet.

Open up the Doom 3 Radiant Application by typing "editor" into the console (ctrl+alt+`). Otherwise, you can use the shortcut '<drive letter>:\<Doom 3 directory>\Doom3.exe +editor r_fullscreen 0 +r_mode 5' minus the brackets.

Now that we have it started, set your grid setting to 8 units or less. To set grid snap to 8 units, press '4' on the keyboard.

Now, in your XY(Top) view, drag out a box that is 8x8 units. It should also only be 8 units tall:

http://img10.exs.cx/img10/2998/patch_tutorial_one.jpg

Okay. Now, we're going to drag the brush up on the Z-axis, to approximately 64 units. It is helpful to note, at this point, that turning on "sizing info" under preferences will show the size of your brush on the X,Y and Z axes:
http://img10.exs.cx/img10/8449/patch_tutorial_two.jpg

As you can see it's not a really exciting piece of geometry yet. Go to Patch and select "cylinder."

This will turn it into an octagonal cylinder which fits into one 8x8 segment of the grid, 64 units tall.

Now, THIS is where the fun begins... If you really stopped to admire the detail in Doom 3, you'd notice that those tiny handrailings (for EXAMPLE) seemed remarkably smooth around the edges and would cause one to think at first that they were made with some external modeling program. Well, thanks to the new functionalities in D3R, you can subdivide any bezier patch mesh up to 32 times for columns and rows to create a smoother surface.

Back to the basics here:

Highlight your newly created "cylinder" in D3Radiant. To do this, re-orient yourself in the camera view and shift+left click on it. It will outline. View the front viewport and hit 'v':

http://img19.exs.cx/img19/7330/patch_tutorial_three.jpg

There are two types of vertices to note here, the pink vertices (in the middle) are used to manipulate subdivisions in your patches and re-disperse them when translated. The green vertices move transform the mesh itself, and serve as a "boundary" for the subdivisions to stay within.

So, now, we're going to bend it into a pipe elbow. A few things to note here:

Always line up your subdivision vertices with the green ones. You'll see what I mean in a minute.

Switch to 4 unit grid snaps by pressing 3. Take the top 3 vertices in the front view (which includes one pink vertex) and since they line up laterally, line them up vertically, each one grid unit away (in this case, 4 game units a piece):

http://img63.exs.cx/img63/2923/patch_tutorial_four.jpg

Okay, we're at step one of four to making a nice looking bezier patch.

Now, you're going to drag those 3 vertices you manipulated OUT 64 units. For precision's sake, let's keep the grid snap on 4 units:

http://img63.exs.cx/img63/9955/patch_tutorial_five.jpg

As you can clearly see, this really doesn't make for an impressive curve whatsoever. So, we're going to manipulate our "bendies" (subdivision controls) to even it out a little. Note how the outermost pink vertex corresponds to form a 90 degree angle with the two outermost green vertices. You need to do this with all curves if you want a nice, credible curve in your maps. Still don't understand? Check the locations of the pink vertices relative to the green ones in this picture:

http://img62.exs.cx/img62/9927/patch_tutorial_six.jpg

Okay, you've just made a patch elbow. One other thing to note here: PLEASE try to keep height and width proportionate when bending patch meshes. This basically means that in the front or side view (which ever shows the side of the patch) you want the width and height to be equal. If you want to extend the length of another patch mesh, make another one and put it on the current one.

Okay, here's the LAST part to the tutorial: We're going to subdivide this patch mesh 11 times. While you have your "elbow" selected, hit 's' for your Surface Inspector. The Surface Inspector allows you to fit, move, and scale textures on brushes and patch meshes. Down at the bottom, below the texturing bar, you'll see "Subdivide Patch" with a small checkbox. Tick the box and there will be two sliders which are at default, 3. Move BOTH sliders right until there are 11 subdivisions both vertical and horizontal:

http://img62.exs.cx/img62/1166/patch_tutorial_seven.jpg

You're done! Now you have a bezier that has been subdivided 11 times on each aspect.

Please note that now, when you experiment with things like endcaps, bevels, and simple patch meshes, you can also subdivide them in a similar manner.

Share this post


Link to post

Very nice tutorial, BNA! I have a question for you, maybe you can answer it.

Do you know how to work with the physical objects yet? I have no idea where to start other than making movable_x objects and binding models to them.

Share this post


Link to post
Laguna said:

Very nice tutorial, BNA! I have a question for you, maybe you can answer it.

Do you know how to work with the physical objects yet? I have no idea where to start other than making movable_x objects and binding models to them.


Thanks!

I haven't messed with physics objects yet.
Will take a look into them next week and post back here.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×