Difference between revisions of "Models:Misfit Model tutorial light bulb"

From Custom Map Makers Wiki
Jump to: navigation, search
(Create the bulb cap)
 
(30 intermediate revisions by 3 users not shown)
Line 2: Line 2:
  
 
==Before we begin==
 
==Before we begin==
 +
Misfit is very easy to use, if you've used 3d applications previously you'll get used to misfit quickly. It's not packed with a lot of bells and whistles but for a quick model, it can save you a lot of time - especially when it comes to getting ready/textured models perfectly suited to q3 based maps.
 +
 
Misfit can save md3 models natively, this saves a great deal of time and effort if you wish to create your own models for inclusion in your maps - however, in order for this to work properly you should work in the final location/folder that your model will be loaded from.
 
Misfit can save md3 models natively, this saves a great deal of time and effort if you wish to create your own models for inclusion in your maps - however, in order for this to work properly you should work in the final location/folder that your model will be loaded from.
  
In my case I have a models folder in my mapping folder, in the models folder I have a mapobjects folder. All your work should be in a seperate sub-folder of this.
+
In my case I have a models folder in my mapping folder, in the models folder I have a mapobjects folder. All your work should be in a separate sub-folder of this.
  
 
For example : this tutorial model will be called the cmm lightbulb.
 
For example : this tutorial model will be called the cmm lightbulb.
Line 17: Line 19:
 
[[File:Plastic.jpg|200px]] [[File:Bulb.jpg|200px]]
 
[[File:Plastic.jpg|200px]] [[File:Bulb.jpg|200px]]
  
Save the images to your mapping/models/mapobhects/cmm_lightbulb folder as
+
Save the images to your mapping/models/mapobjects/cmm_lightbulb folder as
  
 
*bulb.jpg
 
*bulb.jpg
Line 39: Line 41:
 
|style="padding-right:5%;vertical-align:top"|
 
|style="padding-right:5%;vertical-align:top"|
  
Before we begin to create our model we will first set up the materials (textures, images) and the material groups. These are used by misfit to dress your image and later exported with the model information.
+
Before we begin to create our model we will first set up the materials (textures, images) and the material groups. These are used by misfit to dress your image and are later exported with the model information.
  
From the main menu select materials. Click new material and type plastic. Cick ok to save this material.
+
From the main menu, select materials. Click new material and type plastic. Click ok to save this material.
  
 
Click the Change texture button and locate the file mapping/models/mapobjects/cmm_lightbulb/plastic.jpg and assign it to this material.
 
Click the Change texture button and locate the file mapping/models/mapobjects/cmm_lightbulb/plastic.jpg and assign it to this material.
Line 63: Line 65:
 
We start by creating an ellipsoid, click the icon on the toolbar that looks like a small ball or select create ellipsoid from the main tools menu.
 
We start by creating an ellipsoid, click the icon on the toolbar that looks like a small ball or select create ellipsoid from the main tools menu.
  
Drag the ball to be roughly the size you like and then move this to the center of the display.
+
Drag the ball to be roughly the size you like and then move this to the centre of the display.
  
 
It may take you a few minutes to work out how to use the interface, it's pretty simple.
 
It may take you a few minutes to work out how to use the interface, it's pretty simple.
Line 95: Line 97:
 
The final step involves remove (deleting) the top 3 rows of vertices, we do not need these.
 
The final step involves remove (deleting) the top 3 rows of vertices, we do not need these.
  
With the vertex selection button selected draw a rectangle capturing the very top 3 rows of vertices and press delete.
+
With the vertex selection button selected, draw a rectangle capturing the very top 3 rows of vertices and press delete.
  
  
Line 135: Line 137:
 
{| width="100%" style="padding-left:5%;"
 
{| width="100%" style="padding-left:5%;"
 
|style="padding-right:5%;vertical-align:top"|
 
|style="padding-right:5%;vertical-align:top"|
 +
 +
To create a wire, use the same principle as for building the cap.
 +
 +
Create a long, thin cylinder
 +
 +
Rotate this and align it with the bulb cap.
 +
 +
Drag the vertices or mesh around until you're happy with the result.
 +
 +
In the same manner as you created the cap and the wire (with a cylinder) create a mounting plate
 +
 +
Again bevel the shape slightly by scaling the vertices at the bottom of the mounting plate.
 +
 +
|
 +
 +
[[File:Lightb 20.png|500px]]
 +
 +
[[File:Lightb 24.png|500px]]
 +
 +
|}
 +
 +
==Applying textures/materials==
 +
{| width="100%" style="padding-left:5%;"
 +
|style="padding-right:5%;vertical-align:top"|
 +
 +
Earlier we created 2 materials
 +
 +
*plastic
 +
*bulb
 +
 +
We also created 2 material groups
 +
 +
*plastic using the plastic material
 +
*bulb using the bulb material
 +
 +
Select the entire ceiling mounting plate (use the select connected mesh button and click the mesh).
 +
 +
Click the materials option on the main menu and select edit groups
 +
 +
Select the plastic group and click the assign to group button, this will immediately texture the ceiling mounting plate with the plastic group texture.
 +
 +
In the same way texture the wire and the bulb cap with the plastic group.
 +
 +
Use the bulb group texture for the bulb mesh.
 +
 +
The overall effect at this stage might be a little messy, none of the textures have been wrapped correctly to the mesh.
 +
 +
In order to match the shape of the mesh to the texture applied we'll use the projection tool. This is activated by the right most button, looks like a tube.
 +
 +
Click the create projection button and select a type of Sphere from the type dropdown.
 +
 +
With your mouse in the very centre of the bulb drag out a sphere of roughly the same size as the bulb - this will wrap the bulb texture around the bulb object.
 +
 +
Create new projections (of type cylinder) for the bulb cap, the wire and the ceiling mounting plate.
 +
 +
Your finished model should resemble this ...
 +
 +
[[File:Lightb 36.png|500px]]
 +
 +
 +
|
 +
 +
[[File:Lightb 26.png|500px]]
 +
 +
[[File:Lightb 31.png|500px]]
 +
 +
[[File:Lightb 32.png|500px]]
 +
 +
|}
 +
 +
==Save and export your model==
 +
{| width="100%" style="padding-left:5%;"
 +
|style="padding-right:5%;vertical-align:top"|
 +
 +
Before saving or exporting the model we first must set up the exporter so that it is aware of the model path and where it's images are.
 +
 +
To do this we must create a new meta data key pair which describes each of the material groups we've used in our model.
 +
 +
In this example we used 2 material groups
 +
 +
*plastic
 +
*bulb
 +
 +
From the model menu select Model Meta Data.
 +
 +
Create a new item and enter the following
 +
 +
name  : MD3_PATH_plastic
 +
value : models/mapobjects/cmm_lightbulb/
 +
 +
Type these values EXACTLY as the example above.
 +
 +
Create another item and use the following values
 +
 +
name  : MD3_PATH_bulb
 +
value : models/mapobjects/cmm_lightbulb/
 +
 +
Save the model in the path
 +
 +
mapping/models/mapobjects/cmm_lightbulb
 +
 +
with the filename lightbulb,mm3d (note - this is the native extension for misfit models).
 +
 +
Now, from the file menu - select export
 +
 +
Save the export in the same folder with the filename lightbulb.md3
  
 
|
 
|
 +
 +
[[File:Lightb 42.png|500px]]
  
 
|}
 
|}
  
==Create the ceiling mounting plate==
+
==QC file==
 
{| width="100%" style="padding-left:5%;"
 
{| width="100%" style="padding-left:5%;"
 
|style="padding-right:5%;vertical-align:top"|
 
|style="padding-right:5%;vertical-align:top"|
 +
 +
Congratulations, you just made a md3 model that is ALMOST ready to be used in your game - in fact at this stage you could add a misc_model to your map and select this as the model and in game it would almost certainly work - however the editor needs a little more information.
 +
 +
We need to create a QC file to help the editor locate it's images/shaders.
 +
 +
Create a new textfile in the same folder as your model (mapping/models/mapobjects/cmm_lightbulb) named lightbulb.qc (the same name as the model)
 +
 +
Add the following to the file.
 +
 +
$model "models/mapobjects/cmm_lightbulb/lightbulb.md3"
 +
$frames 1 30
 +
$flags 0
 +
$numskins 0
 +
$mesh "models/mapobjects/cmm_lightbulb/plastic"
 +
$skin "models/mapobjects/cmm_lightbulb/plastic.jpg"
 +
$flags 0
 +
$mesh "models/mapobjects/cmm_lightbulb/bulb"
 +
$skin "models/mapobjects/cmm_lightbulb/bulb.jpg"
 +
$flags 0
 +
 +
Save this file, load up radiant.
 +
 +
Right click in the 2d view, select misc->misc_model from the entities list. For the model itself, select the lightbulb.md3 file from the mappingmodels/mapobjects/cmm_lightbulb folder.
 +
 +
'''A lightbulb!!'''
 +
 +
In game the model should appear like this.
 +
 +
Not a very convincing light bulb yes but, we can add light to this model and bring it to life.
 +
 +
For more information on adding light to your models see the topic [[Mapping:HowTo:Adding_light_to_models|Adding light to models]]
  
 
|
 
|
 +
 +
[[File:Lightb 45.png|500px]]
 +
 +
[[File:Shot0017.jpg|500px]]
  
 
|}
 
|}
 +
 +
The model created for this tutorial is available for download [
 +
http://www.custommapmakers.org/storage/resources/cmm_lightbulb.zip here]
 +
 +
[[Category:Models]]

Latest revision as of 16:06, 13 September 2011

This tutorial assumes you've downloaded and installed Misfit Model 3d and it works.

Before we begin

Misfit is very easy to use, if you've used 3d applications previously you'll get used to misfit quickly. It's not packed with a lot of bells and whistles but for a quick model, it can save you a lot of time - especially when it comes to getting ready/textured models perfectly suited to q3 based maps.

Misfit can save md3 models natively, this saves a great deal of time and effort if you wish to create your own models for inclusion in your maps - however, in order for this to work properly you should work in the final location/folder that your model will be loaded from.

In my case I have a models folder in my mapping folder, in the models folder I have a mapobjects folder. All your work should be in a separate sub-folder of this.

For example : this tutorial model will be called the cmm lightbulb.

Create a folder mapping/models/mapobjects/cmm_lightbulb

All our work will be in this folder - graphics and model.

Textures

If you'd like to follow along with this tutorial, first download the following textures.

Plastic.jpg Bulb.jpg

Save the images to your mapping/models/mapobjects/cmm_lightbulb folder as

  • bulb.jpg
  • plastic.jpg

Open Misfit Model 3d

Open misfit model 3d - the basic layout should be familiar to anyone who's previously dabbled with 3d modelling applications.

The default display shows views of front, left, top and perspective which is a rendered preview of your model.

Lightb 1.png


Setting up your materials and groups

Before we begin to create our model we will first set up the materials (textures, images) and the material groups. These are used by misfit to dress your image and are later exported with the model information.

From the main menu, select materials. Click new material and type plastic. Click ok to save this material.

Click the Change texture button and locate the file mapping/models/mapobjects/cmm_lightbulb/plastic.jpg and assign it to this material.

Repeat the process for the bulb.jpg image (add a new material called bulb, assign the bulb image to that material).

Having created your basic materials we now need to create matching groups - groups are used to group materials and permit our model to use the same material over several objects. In this example many parts will be made from the plastic material.

From the materials menu select groups, create a new group called plastic, link the material plastic to this group.

Create another group called bulb and link this to the bulb material.

Lightb 3.png

Build the bulb

We start by creating an ellipsoid, click the icon on the toolbar that looks like a small ball or select create ellipsoid from the main tools menu.

Drag the ball to be roughly the size you like and then move this to the centre of the display.

It may take you a few minutes to work out how to use the interface, it's pretty simple.

The first 4 buttons on the toolbar represent the following actions

  • Select vertices
  • Select faces
  • Select connected mesh
  • Select group

We will select some of the vertices and drag them upwards to create a better bulb shape.

Click Select vertices, select the top 4 rows of vertices by dragging the selection rectangle around the area you wish to select.

The buttons on the main toolbar in positions 8 (4 arrows) and onwards have the following functions

  • Move
  • Rotate
  • Scale
  • Shear

Select the move button.

Press Shift (this locks the rotation, scale or movement to grid actions) and drag the selected vertices upwards to create a lozenge shape. An elongated ellipse.

Now click the Scale button with the same vertices selected and reduce the size, this will create an egg shape which is similar to a light bulb.

Feel free to continue to scale and move your vertices until you're happy with the shape.

The final step involves remove (deleting) the top 3 rows of vertices, we do not need these.

With the vertex selection button selected, draw a rectangle capturing the very top 3 rows of vertices and press delete.


Lightb 6.png

Lightb 7.png

Lightb 9.png

Create the bulb cap

Create a cylinder and select the rotate tool.

Press shift while you rotate (shift imposes a grid on movement and will rotate in 45 degree steps).

Move and scale the cap so it sits closely on the top of the bulb, this may take a few minutes - it's worth spending a little time at this stage exploring the controls.

Eventually your cap will fit the top of the bulb.

We now need to scale the top row of vertices to give the cap a more realistic shape.

With the vertex selection button selected drag and capture the top row of vertices and use the scale button to create a more interesting cap shape.


Lightb 12.png

Lightb 17.png

Create the wire

To create a wire, use the same principle as for building the cap.

Create a long, thin cylinder

Rotate this and align it with the bulb cap.

Drag the vertices or mesh around until you're happy with the result.

In the same manner as you created the cap and the wire (with a cylinder) create a mounting plate

Again bevel the shape slightly by scaling the vertices at the bottom of the mounting plate.

Lightb 20.png

Lightb 24.png

Applying textures/materials

Earlier we created 2 materials

  • plastic
  • bulb

We also created 2 material groups

  • plastic using the plastic material
  • bulb using the bulb material

Select the entire ceiling mounting plate (use the select connected mesh button and click the mesh).

Click the materials option on the main menu and select edit groups

Select the plastic group and click the assign to group button, this will immediately texture the ceiling mounting plate with the plastic group texture.

In the same way texture the wire and the bulb cap with the plastic group.

Use the bulb group texture for the bulb mesh.

The overall effect at this stage might be a little messy, none of the textures have been wrapped correctly to the mesh.

In order to match the shape of the mesh to the texture applied we'll use the projection tool. This is activated by the right most button, looks like a tube.

Click the create projection button and select a type of Sphere from the type dropdown.

With your mouse in the very centre of the bulb drag out a sphere of roughly the same size as the bulb - this will wrap the bulb texture around the bulb object.

Create new projections (of type cylinder) for the bulb cap, the wire and the ceiling mounting plate.

Your finished model should resemble this ...

Lightb 36.png


Lightb 26.png

Lightb 31.png

Lightb 32.png

Save and export your model

Before saving or exporting the model we first must set up the exporter so that it is aware of the model path and where it's images are.

To do this we must create a new meta data key pair which describes each of the material groups we've used in our model.

In this example we used 2 material groups

  • plastic
  • bulb

From the model menu select Model Meta Data.

Create a new item and enter the following

name  : MD3_PATH_plastic
value : models/mapobjects/cmm_lightbulb/

Type these values EXACTLY as the example above.

Create another item and use the following values

name  : MD3_PATH_bulb
value : models/mapobjects/cmm_lightbulb/

Save the model in the path

mapping/models/mapobjects/cmm_lightbulb

with the filename lightbulb,mm3d (note - this is the native extension for misfit models).

Now, from the file menu - select export

Save the export in the same folder with the filename lightbulb.md3

Lightb 42.png

QC file

Congratulations, you just made a md3 model that is ALMOST ready to be used in your game - in fact at this stage you could add a misc_model to your map and select this as the model and in game it would almost certainly work - however the editor needs a little more information.

We need to create a QC file to help the editor locate it's images/shaders.

Create a new textfile in the same folder as your model (mapping/models/mapobjects/cmm_lightbulb) named lightbulb.qc (the same name as the model)

Add the following to the file.

$model "models/mapobjects/cmm_lightbulb/lightbulb.md3"
$frames 1 30
$flags 0
$numskins 0
$mesh "models/mapobjects/cmm_lightbulb/plastic"
$skin "models/mapobjects/cmm_lightbulb/plastic.jpg"
$flags 0
$mesh "models/mapobjects/cmm_lightbulb/bulb"
$skin "models/mapobjects/cmm_lightbulb/bulb.jpg"
$flags 0

Save this file, load up radiant.

Right click in the 2d view, select misc->misc_model from the entities list. For the model itself, select the lightbulb.md3 file from the mappingmodels/mapobjects/cmm_lightbulb folder.

A lightbulb!!

In game the model should appear like this.

Not a very convincing light bulb yes but, we can add light to this model and bring it to life.

For more information on adding light to your models see the topic Adding light to models

Lightb 45.png

Shot0017.jpg

The model created for this tutorial is available for download [ http://www.custommapmakers.org/storage/resources/cmm_lightbulb.zip here]