|
1.1 In the
meantime, though, begin by creating the following folder structure
within baseq3:
models/mapobjects/ddtutorial
Now fire up 3D
Studio Max. On the right hand side (hereafter RHS) of your screen,
on the create tab, click [box] and draw out a box in the
perspective view. Then enter dimensions of 32 in the length,
width and height boxes under parameters. |
|
 |
| 1.2 Okay now we have our
box, but we need to tell 3D Studio Max how to wrap a skin round
it. To do this we first have to split it into it's component
sides. Select the box, click on the edit tab (RHS) and apply an
edit mesh to the box (by clicking on [More…] then “edit mesh”).
Now click on “Sub-Object” then "polygon" (the red square) on the
RHS.
N.B. Throughout this tutorial, make
sure you save your progress at regular intervals. To help you keep
track of which version is which, it might be a good idea to number the various
saved versions with the corresponding paragraph
numbers from the tutorial e.g. ddtutorial1_1.max,
ddtutorial1_2.max etc. |
|
 |
| 1.3 Select the side of
the cube which faces the front, click on [Detach] on the RHS
(under “Edit Geometry”), call it “front” in the detach pop-up
which appears and hit [Okay]. Repeat this process for each side of
the cube, calling them “left”, “right”, “top”, “bottom” & “back”. |
|
 |
1.4 Once you’ve detached
all the sides, you’ll be left with an empty “box1” object, click
on [Sub Object] mode to turn it off, then hit the delete key to
get rid of the empty object. If you’ve done everything right, when
you hit the "Select by name" button .
You should see something like this: |
|
 |
| 1.5 Select all and then
make a back up copy by holding the shift key and dragging the
faces to the side somewhere. N.B. This step is very important. You
should now have two cubes: |
|
 |
|
1.6 Hide
the copy you made (by clicking on the utilities tab
then
[Hide Selected]. Now we move back to our original cube. We’re
going to rearrange the pieces so they’re in a 2d plane so we can
apply a 2d texture to them.
Select the left
side, hit the “Select & rotate” button
and
rotate it 90 degrees so it faces the same way as the front.
(You can see how many degrees you’ve rotated the object at the
bottom of the screen as you drag it round). Then hit “Select &
move”
and move it so that it's lined up next to the front face. Repeat
this process for each piece until you’ve got something like this:
|
|
 |
| 1.7 Select the front face
then click [Attach List] (on the RHS). Choose the first item in
the pop-up which appears and click [Attach]. Repeat for each item
in order until they’re all attached and looking like this: |
|
 |
| 1.8 With the now attached
pieces still selected, change to a front view and apply a UVW map
modifier. Under parameters, select planar and under alignment
select “Y” then [Fit]. You should now see an orange box
surrounding the pieces. |
|
 |
| 1.9 Q3 likes textures to be
square whereas we have a rectangular shape so let’s change that.
Copy whichever number is higher out of length or width to the
other one like this: |
|
 |
|
1.10 Now
in our case this will mean we have some wasted space on the
texture above and below the faces, but we’re not too worried about
that. Obviously if you’re making a more complicated model you can
arrange the pieces so they fit a square better.
Apply an “Unwrap
UVW” modifier (by clicking on [More] on the RHS, then “Unwrap UVW”).
To check this has worked, click on [Edit] (also on the RHS) and
you should see this: |
|
 |
1.11 Finally we have our 2d
layout of the pieces, but we need to save it so we can paint our
texture on it. Close the “Edit UVW” pop-up window, then click on
the Utiltities tab
and
[More…]. Choose “Texporter” from the list then under parameters
enter 512 for width and height. (This will let us paint a high res
version of the texture which we can later scale down). Now click
on [Pick Object]... |
|
 |
|
|
1.12 ...and select the flattened faces in perspective view.
A pop-up like this should appear: |
|
 |
| 1.13 Hit the save icon (the
floppy disc) and save it wherever you like as box1.tga. Now you
can open that file in Photoshop or whatever graphics program you
use and paint your box texture. When you’ve finished, resize it to
256 by 256 and save it as box1.jpg in baseq3/models/mapobjects/ddtutorial.
(In the save options dialogue make sure you use the "Baseline
Standard" jpg format or Quake 3 will be unable to use your
picture). If you can’t be
bothered to make your own texture, you can use the masterpiece
I’ve created instead by right clicking on the image to the right
and choosing "Save Picture As". |
|
 |
| 1.14 Okay, back to 3DSM,
with the flattened box selected, hit the “m” key to bring up the
materials editor and click the blank square to the right of
diffuse: |
|
 |
1.15 Choose “bitmap” from
the pop-up, then navigate to your baseq3/models/mapobjects/ddtutorials
folder and select “box1.jpg”. The texture should appear wrapped
round the first sphere. Hit “Assign Material to Selection”
and
“Show Map in Viewport”
then
close the materials editor. Now you should see the texture on your
flattened box. (If you don't, hit F3 and the textures should
appear). |
|
 |
| 1.16 Hit the Display tab
and [Unhide All]. The backup copy of the box should reappear.
Select the front face of the backup, then hit the edit tab and
[Attach List]. In the list you’ll see “front” which is the
flattened version we made, and “back01”, “bottom01”, “left01”,
“right01”, and “top01” which are the backup copies. (“Front01”
doesn’t appear because we have that selected and you can’t attach
an object to itself). |
|
 |
|
1.17 Now
repeat the process we went through earlier in 1.7 for the
backups by attaching front01 to
each of the other backup sides in turn (in the same order you
followed before, working down the list). N.B. Make sure you don’t
attach the flattened version called “front” to the backups. When
you’re done you should be left with only two objects, the
flattened version called “front” and the assembled backup version
called “front01”.
Now select the
flattened version, click the create tab and under geometry choose
“Compound Objects” from the drop-down: |
|
 |
| 1.18 Hit [Morph], then
[Pick Target] and click on the backup box. Ta daaa! Our flattened
version has now changed back into a cube. |
|
 |
|
1.19 Now
we can get rid of the backup cube, so select and delete it.
Then
select the remaining cube and from the menus choose “File” and
“Export Selected”. Call it “box1” and save it in the folder baseq3/models/mapobjects/ddtutorial
as type “Quake III (*.MD3)” in the dropdown. (If this doesn’t
appear as an option, you haven’t installed the Pop n Fresh
exporter properly).
A further pop-up
will appear asking which frames you want to export, enter “0” and
hit [Export Now] |
|
 |
|
1.20
Congratulations, you’ve just made an md3 and can now add it to
your level. To test it, open GTK radiant, make a simple box room,
right click, choose “misc”, “misc model” from the pop-up, then
navigate to your md3 and select it. (It should be in the
folder baseq3/models/mapobjects/ddtutorial). The box should now be in
your level. (You can change it’s facing by hitting the “n” key and
clicking on an angle.)
And here are the
boxes in-game: |
|
 |
|
Part 2 - Creating a model which uses a shader
2.0 Now we’re going to
make something slightly more useful – a simple model of a bush. (This part of
the tutorial assumes you've already completed part 1, so
I'll go into less detail here as the process is very similar). To begin, download and
save this file as “bush1.tga” in the “baseq3/models/mapobjects/ddtutorial”
folder you created earlier. The tga has an alpha channel which we want Q3 to use
to determine which bits of the image should be transparent and which should be
opaque. To do this, we'll need a shader so in your baseq3/scripts folder, create
a shader called “ddtutorial.shader” and paste in the following text:
models/mapobjects/ddtutorial/bush1
{
cull none
nopicmip
{
map models/mapobjects/ddtutorial/bush1.tga
alphaFunc GE128
depthWrite
rgbGen vertex
}
}
N.B. If you're using a version
of q3map older than version 2.3.37 you will have to reverse the direction of all
the slashes in the shader i.e.
models\mapobjects\ddtutorial\bush1
{
cull none
nopicmip
{
map models\mapobjects\ddtutorial\bush1.tga
alphaFunc GE128
depthWrite
rgbGen vertex
}
}
|
|
| 2.1 Okay, now we’re all set
up – you’ve got the bush texture in baseq3/mapobjects/ddtutorial
and you’ve got a shader called ddtutorial.shader in
baseq3/scripts. (By the way, it doesn’t really matter what you
call the shader file, we’re just using ddtutorial for
consistency). Fire up 3DSM and create a 64x64 rectangle in the
front view (by clicking on the “create” tab, then “shapes”, then
[Rectangle] ). Convert it to an editable mesh and move it so that
the bottom of the rectangle is resting on “0” on the z-axis. |
|
 |
| 2.2 Hit [UVW Map] and an
orange box should appear round the rectangle you made. (If it
doesn’t, change the alignment and click [Fit] ).
Apply an “Unwrap UVW” modifier, then with the rectangle still selected hit the “m”
key to bring up the materials modifier. Click the blank square to
the right of “diffuse”, choose bitmap and then choose bush1.tga in your baseq3/models/mapobjects/ddtutorial folder. (The
bush texture should appear on the sphere).
Now click “Assign
Material to Selection”
and
“Show Map in Viewport”
and
close the materials editor. The texture should now be visible on
the rectangle. (If it isn’t hit [F3] and it should appear). |
|
 |
2.3 Change to top view and
click “Select and Rotate” .
Then hold down the shift key to make a copy and rotate it 60
degrees round the z-axis. Make another copy and rotate it a
further 60 degrees until you have a shape like this: |
|
 |
|
2.4 Select all three
pieces then go to the file menu and choose “Export Selected”. Export them to the
folder
baseq3/models/mapobjects/ddtutorial as bush1.md3. (As before enter frame “0” in
the Pop N Fresh pop-up)
You should now have a simple
md3 of a bush. Fire up GTK Radiant, make a
box-room and add a few bush models, varying the size using the _modelscale key. Vary the angle of each model to
give them some variety and hey presto – you have some vegetation:
|
|
 |
| 2.5 So there you have it, you
should now be able to get your own models skinned and into Q3.
Obviously I've just covered the basic process here, but if you want
more details about a particular aspect, there are plenty of tutorials
on the Net which focus more on stages like UVW mapping or skinning.
Anyway, I hope this guide has been of some
use to you, if you have any questions, comments or corrections drop me
a mail to
mikejsteven@hotmail.com. To have a look at my own first stab at
making a model, a Steyr Aug, click here.
To check out the rest of my website, click here. |
|