tamour ahmad_05108114 - final project

Upload: tamour114

Post on 05-Apr-2018

221 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/2/2019 Tamour Ahmad_05108114 - Final Project

    1/77

    GIFT UNIVERSITY

    SCHOOL OF COMPUTER SCIENCE

    Graduation Project

    MODELING, TEXTURING, ANIMATING & 3D GAMES

    DEVELOPMENT IN BLENDER 3D

    By

    Tamour Ahmad (05108114)

    Submitted in Partial Fulfillment of the

    Requirement of the Degree of

    Bachelor of Science

    2009

  • 8/2/2019 Tamour Ahmad_05108114 - Final Project

    2/77

    i

    Acknowledgement

    Patience & perseverance is the part & parcel to make fulfill any desired motto

    successfully. Likewise we do have the pleasure to expose that I have already completed

    my project with grand success namely MODELING, TEXTURING, ANIMATING &

    3D GAMES DEVELOPMENT IN BLENDER 3D.

    I wish to thank my parents for their undivided support and interest, who hasinspired me and encouraged me to go my own way, without whom I would be unable to

    complete this project.

    I am grateful to Sir.Bhatti for his continuous support for the project, from initial

    advice and contacts in the early stages of conceptual inception, and through ongoing

    advice and encouragement to this day. I would like to call up all my faculty members

    whose essential guidance & whole hearted devotion really inspired us as well as helped

    too in the fulfillment of our desired task.

    At last I want to thank Hamid who appreciated me for my work and motivated me

    to continue it.

  • 8/2/2019 Tamour Ahmad_05108114 - Final Project

    3/77

    ii

    Abstract

    Blender is the open source software for 3D modeling, animation, rendering,postproduction, interactive creation and playback. It is available for all major operating

    systems under the GNU General Public License. Aimed at media professionals and

    artists, Blender can be used to create 3D visualization, stills as well as broadcast quality

    video, while the incorporation of a real-time 3D engine allows for the creation of 3D

    interactive content for standalone playback.

    The project is to get a touch to 3D world. How things are done in 3D. Make some

    models, practice some animation, do some programming to make plug-ins and finally

    make a small model library, that library should be used to make a new bigger model.

  • 8/2/2019 Tamour Ahmad_05108114 - Final Project

    4/77

    iii

    List of Figures

    Figure 1Blender 3D Windows installation (a) ................................................................. 3Figure 2 - Blender 3D Windows installation (b) ................................................................. 4Figure 3 - Blender book practice Window model ................................................................ 7Figure 4 - Dining set Idea .................................................................................................... 8Figure 5 - Dining set ............................................................................................................ 8Figure 6 - Texture plug-in compiling commands .............................................................. 16Figure 7 - Opening texture tab ........................................................................................... 17Figure 8 - Selecting plug-in type ....................................................................................... 17Figure 9 - Selecting plug-in ............................................................................................... 18Figure 10 - Cube object with texture ................................................................................. 18Figure 11 - Circles texture idea .......................................................................................... 19Figure 12 - Circles texture ................................................................................................. 19Figure 13 - Colored edges idea .......................................................................................... 20Figure 14 - Colored Edges ................................................................................................. 20Figure 15 - Gift Box texture............................................................................................... 21Figure 16 - Gift Box texture idea ....................................................................................... 21Figure 17 - Grid texture idea .............................................................................................. 22Figure 18 - Grid texture ..................................................................................................... 22Figure 19 - Hyperbola texture ............................................................................................ 23Figure 20 - Hyperbola texture idea .................................................................................... 23Figure 21 - Noise texture idea ............................................................................................ 24Figure 22 - Noise Texture .................................................................................................. 24Figure 23 - Blender sketch idea and implemented model .................................................. 25Figure 24 - Plate sketch idea and implemented model ...................................................... 25Figure 25 - Ceiling light sketch idea and implemented model .......................................... 26Figure 26 - Chair sketch idea and implemented model ..................................................... 26Figure 27 - Oven top sketch idea and implemented model ............................................... 27Figure 28 - Microwave oven sketch idea and implemented model ................................... 28Figure 29 - Refrigerator sketch idea and implemented model ........................................... 29Figure 30 - Glass sketch idea and implemented model ..................................................... 29Figure 31 - Stylish glass sketch idea and implemented model .......................................... 30Figure 32 - Sink sketch idea and implemented model ....................................................... 30Figure 33 - Oven sketch idea and implemented model ...................................................... 31Figure 34 - Pan Sketch idea and implemented model ........................................................ 31Figure 35 - Tray sketch idea and implemented model ....................................................... 32Figure 36 - Spatula sketch idea and implemented model .................................................. 32Figure 37 - Tea pot and cups sketch idea and implemented models ................................. 33Figure 38 - Diner set implemented model using existing ideas ......................................... 33Figure 39 - Vase sketch idea and implemented model ...................................................... 34Figure 40 - Fireplace sketch idea and implemented model ............................................... 34Figure 41 - Side table idea and implemented model.......................................................... 35

    http://c/Users/Tamour/Documents/P1%20Report.docx%23_Toc226697704http://c/Users/Tamour/Documents/P1%20Report.docx%23_Toc226697704http://c/Users/Tamour/Documents/P1%20Report.docx%23_Toc226697705http://c/Users/Tamour/Documents/P1%20Report.docx%23_Toc226697705http://c/Users/Tamour/Documents/P1%20Report.docx%23_Toc226697706http://c/Users/Tamour/Documents/P1%20Report.docx%23_Toc226697706http://c/Users/Tamour/Documents/P1%20Report.docx%23_Toc226697707http://c/Users/Tamour/Documents/P1%20Report.docx%23_Toc226697707http://c/Users/Tamour/Documents/P1%20Report.docx%23_Toc226697708http://c/Users/Tamour/Documents/P1%20Report.docx%23_Toc226697708http://c/Users/Tamour/Documents/P1%20Report.docx%23_Toc226697709http://c/Users/Tamour/Documents/P1%20Report.docx%23_Toc226697709http://c/Users/Tamour/Documents/P1%20Report.docx%23_Toc226697710http://c/Users/Tamour/Documents/P1%20Report.docx%23_Toc226697710http://c/Users/Tamour/Documents/P1%20Report.docx%23_Toc226697711http://c/Users/Tamour/Documents/P1%20Report.docx%23_Toc226697711http://c/Users/Tamour/Documents/P1%20Report.docx%23_Toc226697712http://c/Users/Tamour/Documents/P1%20Report.docx%23_Toc226697712http://c/Users/Tamour/Documents/P1%20Report.docx%23_Toc226697713http://c/Users/Tamour/Documents/P1%20Report.docx%23_Toc226697713http://c/Users/Tamour/Documents/P1%20Report.docx%23_Toc226697714http://c/Users/Tamour/Documents/P1%20Report.docx%23_Toc226697714http://c/Users/Tamour/Documents/P1%20Report.docx%23_Toc226697715http://c/Users/Tamour/Documents/P1%20Report.docx%23_Toc226697715http://c/Users/Tamour/Documents/P1%20Report.docx%23_Toc226697715http://c/Users/Tamour/Documents/P1%20Report.docx%23_Toc226697714http://c/Users/Tamour/Documents/P1%20Report.docx%23_Toc226697713http://c/Users/Tamour/Documents/P1%20Report.docx%23_Toc226697712http://c/Users/Tamour/Documents/P1%20Report.docx%23_Toc226697711http://c/Users/Tamour/Documents/P1%20Report.docx%23_Toc226697710http://c/Users/Tamour/Documents/P1%20Report.docx%23_Toc226697709http://c/Users/Tamour/Documents/P1%20Report.docx%23_Toc226697708http://c/Users/Tamour/Documents/P1%20Report.docx%23_Toc226697707http://c/Users/Tamour/Documents/P1%20Report.docx%23_Toc226697706http://c/Users/Tamour/Documents/P1%20Report.docx%23_Toc226697705http://c/Users/Tamour/Documents/P1%20Report.docx%23_Toc226697704
  • 8/2/2019 Tamour Ahmad_05108114 - Final Project

    5/77

    iv

    Figure 42 - Cabinet idea and implemented model ............................................................. 36Figure 43 - Table idea and implemented model ................................................................ 37Figure 44Object mode.................................................................................................... 43Figure 45 - Edit mode ........................................................................................................ 43Figure 46 - Resizing cube (A) ............................................................................................ 44

    Figure 47 - Resizing cube (B) ............................................................................................ 44Figure 48 - Table Leg (A) .................................................................................................. 45Figure 49Table Leg (B) ................................................................................................. 46Figure 50 - Table Leg (C) .................................................................................................. 46Figure 51 - Table Leg (D) .................................................................................................. 47Figure 52 - Sub diving Table ............................................................................................. 47Figure 53 - Selecting Vertices ............................................................................................ 48Figure 54 - Table completed .............................................................................................. 48Figure 55 - Table Sheet (A) ............................................................................................... 49Figure 56 - Table Sheet (B) ............................................................................................... 50Figure 57 - Table Sheet (C) ............................................................................................... 50Figure 58 - Table Sheet (D) ............................................................................................... 51Figure 59 - Table Sheet (E) ................................................................................................ 51Figure 60 - Table Sheet (F) ................................................................................................ 52Figure 61 - Table Sheet (G) ............................................................................................... 52Figure 62 - Table with Sheet .............................................................................................. 53Figure 63 - Chair (A) ......................................................................................................... 53Figure 64 - Chair (B).......................................................................................................... 54Figure 65 - Chair (C).......................................................................................................... 54Figure 66 - Chair (D) ......................................................................................................... 55Figure 67 - Chair (E) .......................................................................................................... 55Figure 68 - Chair (F) .......................................................................................................... 56Figure 69 - Chair Leg (A) .................................................................................................. 56Figure 70 - Selecting vertices to place legs ....................................................................... 57Figure 71 - Leg places at the selected vertex ..................................................................... 57Figure 72Complete Chair ............................................................................................... 58Figure 73 - Chair seat (A) .................................................................................................. 58Figure 74 - Chair Seat (B) .................................................................................................. 59Figure 75 - Chair Seat (C) .................................................................................................. 59Figure 76 - Combined Table Chairs................................................................................... 60Figure 77 - Plate (A) .......................................................................................................... 60Figure 78 - Plate (B) .......................................................................................................... 61Figure 79 - Plate (C) .......................................................................................................... 61Figure 80 - Plate (D) .......................................................................................................... 62Figure 81 - Spoon (A) ........................................................................................................ 62Figure 82 - Spoon (B) ........................................................................................................ 63Figure 83 - Spoon (C) ........................................................................................................ 63Figure 84 - Fork (A) ........................................................................................................... 64Figure 85 - Fork (B) ........................................................................................................... 64

  • 8/2/2019 Tamour Ahmad_05108114 - Final Project

    6/77

    v

    Figure 86 - Fork (C) ........................................................................................................... 65Figure 87 - Fork (D) ........................................................................................................... 65Figure 88 - Fork (E) ........................................................................................................... 66Figure 89 - Fork (F) ........................................................................................................... 66Figure 90 - Fork (G) ........................................................................................................... 67

    Figure 91 - Combing all items ........................................................................................... 67Figure 92Adding Material Object .................................................................................. 68Figure 93Adding a texture object .................................................................................. 69Figure 94 - Specifying texture type and loading image ..................................................... 69Figure 95 - The final image ............................................................................................... 70

  • 8/2/2019 Tamour Ahmad_05108114 - Final Project

    7/77

    vi

    Table of Contents

    Acknowledgement ................................................................................................................ i

    Abstract ................................................................................................................................ iiChapter1: Introduction ........................................................................................................ 11.1. Modeling and Rendering: ...................................................................................... 11.2. Game Engine: ........................................................................................................ 1

    Chapter2: Blender 3D Installation ...................................................................................... 32.1. Windows [1] ........................................................................................................... 32.2. Linux ..................................................................................................................... 5

    Chapter3: Book Reading and Sample Material .................................................................. 63.1. Blender 3D: Architecture, Buildings, and Scenery (Book) ................................... 63.1.1. Book practice material ....................................................................................... 73.2. Blender Game Kit (Book) ..................................................................................... 9

    Chapter4: Blender Texture Plug-ins ................................................................................. 114.1. Introduction ......................................................................................................... 114.2. Syntax [2].............................................................................................................. 124.4. Using Plug-ins ..................................................................................................... 174.5. My Plug-ins ......................................................................................................... 194.5.1. Circles .......................................................................................................... 194.5.2. Colored Edges .............................................................................................. 204.5.3. Gift Box ....................................................................................................... 214.5.4. Grid .............................................................................................................. 224.5.5. Hyperbola ..................................................................................................... 234.5.6. Noise ............................................................................................................ 24

    Chapter5: Model Library .................................................................................................. 25Chapter6: Models .............................................................................................................. 38Chapter7: Conclusion........................................................................................................ 39Chapter8: References ........................................................................................................ 40Appendix A ........................................................................................................................ 41Appendix B ........................................................................................................................ 43

  • 8/2/2019 Tamour Ahmad_05108114 - Final Project

    8/77

    1

    Chapter 1

    1. IntroductionBlender is the open source software for 3D modeling, animation, rendering,

    texturing and game development. It is obtainable for all major operating systems

    under the GNU General Public License. It is a user friendly program and can be used

    by a novice user to a highly professional user depending on the need and purpose.

    Since it is licensed under the GNU General Public License (the GPL), anyone

    have the right to use Blender for any purpose, and anyone have access to the source

    codes and can modify the program and also can copy and distribute the program.

    1.1. Modeling and Rendering:Blender provides facilities for 3D modeling, animation, rendering,

    texturing and game development. You can make models in blender using different

    meshes provided. You can use cubes, planes, spheres and many others to make

    your desired model. Models can be textured though mapping images on them or

    even using plug-ins which you can download and make by yourself as well.

    Models can be placed in light and can be made transparent or translucent in order

    to make the desired object. Besides still images, Blender provides facility to create

    movie sequences through rendered pictures of successive frames. If the output of

    animations after rendering are saved as *.avi *.jpeg in Blender, the *.avi file can

    be viewed in real player of windows operating system. Many examples of the

    movies are provided and can be downloaded free of cost from websites provided.

    1.2. Game Engine:A game engine is software that simulates a part of reality. Through a game

    engine, you can interact with a 3-D world in real-time, controlling objects which

    can interact with other objects in that world. If you have ever played a video game

  • 8/2/2019 Tamour Ahmad_05108114 - Final Project

    9/77

    2

    on a computer, a console or in a game arcade, you have used a game engine of

    some kind. The game engine is the heart of a game and consists of several parts.

    One part displays the 3-D world and its objects on your screen, drawing and

    redrawing your scenes as things change. Another part deals with decision making

    (known as game logic), for example, deciding when events like doors opening

    should occur. Another part simulates physics, such as gravity, inertia, momentum

    and so on. Yet another part detects when objects collide with each other, while

    another actually moves objects. The game engine tries to simulate all these things

    as quickly as possible to provide a smooth fluid simulation.

  • 8/2/2019 Tamour Ahmad_05108114 - Final Project

    10/77

    3

    Chapter 2

    2. Blender 3D Installation2.1. Windows [1]

    Download the file blender-2.xx-windows.exe , from the download section

    of the Blender Website. Start the installation by double-clicking the file. This

    presents you with some questions, for which the defaults should be OK. After

    setup is complete, you can start Blender right away, or use the entry in the Start

    menu.

    Figure 1 Blender 3D Windows installation (a)

    The second dialog presents you with the license. You are expected to

    accept it if you want the installation to go any further. After accepting the license,

    select the components you wish to install (there is just one, Blender) and the

    additional actions:

    Add a shortcut to the Start menu Add Blender's icon to desktop Associate .blend files with Blender

    http://wiki.blender.org/index.php/Image:Manual-Install-01.jpg
  • 8/2/2019 Tamour Ahmad_05108114 - Final Project

    11/77

    4

    By default they are all checked. If you don't want some action to be taken,

    simply uncheck it. When done, click on Next. The next dialog is where to put the

    executable files, usually in the C:\Program Files folder.

    Figure 2 - Blender 3D Windows installation (b)

    The next dialog is tricky, and it is where to put user files. These folders

    save user data, namely temp data like test renders and physics data. Each user of

    that PC can have their own, or they call all share one.

    Select a place to install the files to (the default should be OK), and click

    Next to install Blender. Press Close when installation is over.

    Afterwards you will be asked whether you want to start Blender

    immediately. Blender is now installed and can be started by means of the Start

    menu (an entry named "Blender Foundation" will have been created by the setup

    routine) or by double-clicking a Blender file (*.blend).

    After the files are unpacked, Blender will check for required system

    components, like DLLs, which you must get from Microsoft or your hardware

    vendor. Most common is a VCRT dll that is/was not bundled with old versions of

    Windows. After confirmation, you will be able to run Blender!

    http://wiki.blender.org/index.php/Image:Manual-Install-02.jpg
  • 8/2/2019 Tamour Ahmad_05108114 - Final Project

    12/77

    5

    If, like many people, you are a) obsessed with Blender, and b) have a USB

    drive, you'll be glad to know that Blender runs beautifully off a USB key. Just

    download the .zip version and extract it. You may want to avoid having it store

    the animation output or other temporary files on the drive, as it may shorten the

    life, but otherwise, Blender runs fine.

    If in case blender asks for python. Download the python from the official

    site and install python.

    2.2. LinuxIn Linux you just have to download blender. Extract it from the archive

    and then you can run it by executing the blender file. One important note in using

    blender in Linux is that you should have glibc installed on your Linux. If you

    dont have it, you will have to install it on your system in order to run blender.

  • 8/2/2019 Tamour Ahmad_05108114 - Final Project

    13/77

    6

    Chapter 3

    3. Book Reading and Sample Material3.1. Blender 3D: Architecture, Buildings, and Scenery (Book)

    This book describes Blender good enough for a beginner to get start from.

    He described features in the Blender and different ways of using them. He started

    the book with a brief introduction to Blender. Chapter one is an overview of the

    application, where to get from and how to install it. Chapter also gives description

    of the system requirements and online models repository. Chapter two is a guided

    tour of the Blender interface, including all of its modes like modeling, editing,

    rendering, and etc. Chapter three gives detailed information to some extend about

    the tools used to make a model. Some examples are given as well. Chapter four,

    five and six cover modeling in a bit detail; many examples are given, including

    furniture, building, glass and etc. This includes building with proper proportion

    and scale, making more precise adjustments, and attention to architectural

    particulars like symmetry and modeling rounded objects. It also includes a look at

    planning a project before you begin modeling objects, so that you can take better

    advantage of layers, level of detail, and external object libraries. Chapter seven

    covers the material area; materials can be applied to the object to colorize it, to

    give it a real look. Different techniques are given to add material to an object.

    Chapter eight covers a more advanced type of materialization called texturing,

    images are attached on the objects to make them more realistic and to add more

    look and feel. Chapter nine is kind of more advanced approach to texturing. Allan

    described how a picture can be mapped on an object to get different colors on

    different parts of the object. Chapters ten and eleven explore Blender's lighting

    system, including built-in lamps, shadows, the radiosity and ambient occlusion

    lighting models, and the extra options available through the external YafRay

    renderer. Chapter 13 explains two animation options for use after a model is

    complete. First, it describes how to create an animated walk-through or fly-

    through of a completed model suitable for use in a presentation. Second, it

    explains how to use Blender's game engine to create a 3-D model that users and

    clients can explore interactively. Finally, Chapter 14 gives basic advice on how to

  • 8/2/2019 Tamour Ahmad_05108114 - Final Project

    14/77

    7

    post-process rendered images in the GIMP, including color correction and

    touching up stray rendering artifacts. Many other tools can be used instead of

    GIMP. Adobe photo shop is available and many other like it.

    3.1.1. Book practice material

    Figure 3 - Blender book practice Window model

    A double hung sash window made from the practice material in book. It

    has metallic skeleton and a glass material in it. First of all the skeleton is given a

    mirror and glowing touch to make it metallic. And then the material in that

    skeleton is set to ray transparent to make is transparent.

  • 8/2/2019 Tamour Ahmad_05108114 - Final Project

    15/77

    8

    Figure 4 - Dining set Idea

    Figure 5 - Dining set

    A dining furniture model made after practicing blender 3D modeling. The

    sample model contains, table, chair, table sheet, plates, spoon and fork. Some

    objects like floor, chair, and table sheet are textured while others are left

    uncolored.

  • 8/2/2019 Tamour Ahmad_05108114 - Final Project

    16/77

    9

    3.2. Blender Game Kit (Book)The Official Blender Game Kit is a complete guide and reference to

    creating interactive 3-D animation and games with Blender. It begins with an

    extensive introduction to 3-D graphics, explaining basic concepts and the Blender

    interface. Step-by-step tutorials teach the art of creating and animating models

    then show how to turn them into simple games. Experienced 3-D artists will

    appreciate the complex game demos, character animation tutorials, introduction to

    Python, and advanced reference section. The included CDROM offers 10 playable

    and editable games that readers can use to build their own games and distribute

    them for free.

    Game engine is the heart of the game, a composite of different modules to

    handle all things at a time: graphics, input, output, physics, artificial intelligence,

    etc. Not only providing the functionalities mentioned but also providing the

    facility to interact at a lower level with memory and processor.

    Top companies build their own game engines to make a game or now a

    days companies are purchasing prebuilt game engines and then they modify it

    according to their game requirement. To build a game engine is a very costly thing

    to do investing thousands of dollars. But again modifying a game engine is not an

    easy task as well.

    Modifying existing game is fun but only if you know the routines and all

    the logic used in the game. Game mods on the other hand are a great starting

    point, but most commercial game engines restrict distribution therefore you

    cannot modify a game engine.

  • 8/2/2019 Tamour Ahmad_05108114 - Final Project

    17/77

    10

    Blender game kit takes the development of game one step ahead. Blender

    requires no broad programming knowledge, no custom coding, and a proven

    architecture for rendering quality graphics while offering management of nearly

    all input and output functions required for a quality gaming environment. With

    Blender a game can be as complex or simple as the developer chooses, therefore

    allowing everyone with minimal graphics experience to develop 3-D games.

    Blender facilitates all the features required for a game development.

    Indeed, the preferences are impressive enough to allow it to compete with many

    commercial game engines and development suites: graphical editors, collision

    detection, dynamics simulation, Python scripting, scene multi-layering, overlays,

    game logic, artificial intelligence, physics, input, output, and 3D rendering.

    Graphics rendering is facilitated with a scalable OpenGL design for cross-

    platform portability. Unlike other OpenGL rendering engines, Blender requires no

    advanced programming or knowledge of OpenGL conventions. The developer

    only needs to focus on design of game; rest of the work is handled by blender

    itself with minimal user interaction.

    OpenGL provides a wonderful interface to produce dramatic effects

    through both hardware and software accelerated rendering options. Various

    transparency and map models are available, including animated mapping,

    reflection mapping, environment mapping, halos, lens, flares, and even realistic

    fog. A radiosity solver is included to speed animation design, while edge

    rendering, oversampling, motion blurring, post-production filtering, fields, and

    non-square pixels are supported to deliver maximum graphics quality.

  • 8/2/2019 Tamour Ahmad_05108114 - Final Project

    18/77

    11

    Chapter 4

    4. Blender Texture Plug-ins4.1. Introduction

    Plug-ins are software modules that add to the functionality of an

    application. Many applications use plug-ins, including Eudora, Photoshop, and

    web browsers like Firefox and Internet Explorer. Blender plug-ins are made in C.

    What is the purpose of a plug-in in Blender 3D? Blender uses the plug-ins for

    texturing. The basics behind a texture plug-in are that you are given some inputs;

    position, and normal values as well as some otherinfo. Then you return intensity,

    colorand/or normal information depending on the type of texture plug-in.

    Plug-ins are supported (loaded/called) in Blender using the dlopen() family

    of calls. For those unfamiliar with the dlopen system it allows a program

    (Blender) to use a compiled object as if it were part of the program itself, similar

    to dynamically linked libraries, except the objects to load are determined at

    runtime. One disadvantage of blender plug-ins is that if the plug-in crashes so

    does blender.

    Plug-ins are all about mathematics. You have to use extensive

    mathematics to make plug-ins. When you are given coordinates of a point, you

    have to calculate the location of the point in the graph and then according to the

    texture you have to fill that given point with a color. Filling with a color mean you

    are providing red, green and blue color, additionally you are supplying alpha value

    of the color made out of the RGB.

  • 8/2/2019 Tamour Ahmad_05108114 - Final Project

    19/77

    12

    4.2. Syntax [2]i. #include

    Every Blender plug-in should include this header file, which contains all of

    the structures and defines needed to properly work with Blender.

    ii. char name[]="Tiles";A character string containing the plug-in name, this value will be displayed

    for the texture's title in the Texture Buttons window.

    iii.

    #define NR_TYPES 2 char stnames[NR_TYPES][16]= {"Square","Deformed"};

    Plug-ins are allowed to have separate subtypes for minor variations on

    algorithms - for example the default clouds texture in Blender has the

    "Default" and "Color" subtypes.

    NR_STYPES should be defined to the number of subtypes required by

    your plug-in, and a name for each subtype should be given. Every plug-in

    should have at least 1 subtype and a subtype name.

    iv. VarStruct varstr[]= {...};The varstr contains all of the information Blender needs to display buttons

    for a plug-in. Buttons for plug-ins can be numerical for input data, or text for

    comments and other information. Plug-ins are limited to a maximum of 32

    variables.

    Each VarStruct entry consists of a type, name, range information, and a

    tool tip.

    The type defines the data type for each button entry, and the way to

    display the button. For number buttons this value should be a combination

    (ORed) of INT or FLO for the number format, and NUM, NUMSLI, or TOG,

    for the button type. Text buttons should have a type of LABEL.

  • 8/2/2019 Tamour Ahmad_05108114 - Final Project

    20/77

    13

    The name is what will be displayed on (or beside) the button. This is

    limited to 15 characters.

    The range information consists of three floats that define the default,

    minimum, and maximum values for the button. For TOG buttons the

    minimum is set in the pressed state, and the maximum is set in the depressed

    state.

    The tip is a string that will be displayed when the mouse is over this button

    (if the user has tool tips on). This has a limit of 80 characters, and should be

    set to the NULL string ("") if unused.

    v. typedef struct Cast {...};The cast structure is used in calling the doitfunction, and serves as a way

    to simply access each plugin's data values.

    The cast should contain, in order, an integer or float for every button

    defined in the varstr, including text buttons. Typically these should have the

    same name as the button for simple reference.

    vi. float result[8];The result array is used to pass information to and receive information

    from the plug-in. The result values are mapped as follows:

    Result IndexSignificance Range

    result[0] Intensity value 0.0 to 1.0

    result[1] Red color value 0.0 to 1.0

    result[2] Green color value 0.0 to 1.0

    result[3] Blue color value 0.0 to 1.0

    result[4] Alpha color value 0.0 to 1.0

    result[5] X normal displacement value -1.0 to 1.0

    result[6] Y normal displacement value -1.0 to 1.0

    result[7] Z normal displacement value -1.0 to 1.0

  • 8/2/2019 Tamour Ahmad_05108114 - Final Project

    21/77

    14

    The plug-in should always return an intensity value. Returning RGB or a

    normal are optional, and should be indicated by the doit() return flag "1"

    (RGB) or "2" (Normal).

    Before the plug-in is called, Blender includes the current rendering-normal

    in result[5], result[6] and result[7].

    vii. float cfraThe cfra value is set by Blender to the current from before every render

    pass. This value is in the frame number +/- .5 depending on the field settings.

    viii. plugin_tex_doit prototypeThe plugin_tex_doit function should be prototyped for use by the getinfo

    function. You do not need to change this line.

    ix. plugin_tex_getversionThis function must be in each plug-in for it to be loaded correctly. You

    should not change this function.

    x. plugin_but_changedThis function is used to pass information about what buttons the user

    changes in the interface. Most plug-ins should not need to use this function,

    only when the interface allows the user to alter some variable that forces the

    plug-in to do recalculation (a random hash table for example).

    xi. plugin_initIf needed plug-ins may use this function to initialize internal data. NOTE:

    This init function can be called multiple times if the same plug-in texture is

    copied. Do not init global data specific to a single instance of a plug-in in this

    function.

  • 8/2/2019 Tamour Ahmad_05108114 - Final Project

    22/77

    15

    xii. plugin_getinfoThis function is used to communicate information to Blender. You should

    never need to change it.

    xiii. plugin_tex_doitThe doit function is responsible for returning information about the

    requested pixel to Blender.

    a. int stype

    This is the number of the selected subtype, see the NR_TYPESand char stypes entries above.

    b. Cast *castThe Cast structure which contains the plug-in data, see the Cast

    entry above.

    c. float *texvecThis is a pointer to 3 floats, which are the texture coordinates for

    which a texture value is to be returned.

    d. float *dxt float *dytIf these pointers are non-NULL they point to two vectors (two

    arrays of three floats) that define the size of the requested texture value in

    pixel space. They are only non-NULL when OSA is on, and are used tocalculate proper anti aliasing.

    The doitfunction should fill in the result array and return 0, 1, 2 or

    3 depending on what values have been filled in. The doit function should

    always fill in an intensity value. If the function fills in a color value it

    should return 1, if it fills in a normal value it should return 2, if it fills in

    everything it should return 3.

  • 8/2/2019 Tamour Ahmad_05108114 - Final Project

    23/77

    16

    4.3. CompilationIn order to compile a plug-in you must have lcc-win32. Lcc-win32 is a

    compiler system for windows and it is free of cost. Download and install lcc-

    win32. After installation move your C plug-in file to bin folder in the installed lcc-

    win32 folder or set your path to bin folder in command prompt. Copy the required

    header file in the directory where the source file is located. The whole process is

    summarized below.

    1. Install the free C compiler for windows called lcc-win322. Copy the C plug-in file to lcc-win32 bin folder

    or

    2. In command prompt set the path to the bin folder of lcc-win32.3. Copy following header files to the directory where source files are located

    documentation.h externdef.h floatpatch.h iff.h plugin.DEF plugin.h seq.def tex.def util.h

    And finally when you have done all things, now it is the time to compile

    the plug-ins. Plug-ins are compiled in two steps. Firstly, we compile the plug-in

    and then we link the compiled file. The two steps are shown in the screenshot

    below.

    Figure 6 - Texture plug-in compiling commands

  • 8/2/2019 Tamour Ahmad_05108114 - Final Project

    24/77

    17

    4.4. Using Plug-insAfter you have compiled the plug-ins; you can use them in the blender.

    You can apply them on any type of object. Now let us see how the plug-ins are

    loaded in blender and how they are used. Let us take an example of a plug-in

    which makes a grid like structure on an object. First of all open Blender 3D, make

    an object or use the default cube in the blender.

    Press F6 to open texture option. Or press the buttons as shown in the

    screenshot below.

    Figure 7 - Opening texture tab

    Now in the texture type, select plug-in. It will open a new option tab

    having a button to allow loading for the plug-in.

    Figure 8 - Selecting plug-in type

    1 2

  • 8/2/2019 Tamour Ahmad_05108114 - Final Project

    25/77

    18

    Figure 9 - Selecting plug-in

    Now browse to the folder containing the plug-in dll and select the plug-in.

    As you will click the button you will see that the texture will appear in the

    preview box. Render the image and you will see the texture on the object you have

    applied.

    Figure 10 - Cube object with texture

    If the plug-in has some options with it, you will see those options or

    buttons in the plug-in option tab. A plug-in may contain buttons to set color, size,

    ratios, intensity, and etc. you can adjust the plug-in through those sliders or

    buttons.

    1

    23

  • 8/2/2019 Tamour Ahmad_05108114 - Final Project

    26/77

    19

    4.5. My Plug-insI have made several plug-ins which are listed below. The plug-ins are fully

    customizable and adjustable.

    4.5.1. CirclesIn this plug-in user can increase or

    decrease the number of circles. The

    minimum number of circles is 0 which will

    leave the surface clean and maximum

    numbers of circles is 25. You can also

    adjust the width of the circles ranging 0

    through 1. In addition, you can also change

    the colors of circles on each side. All the

    nested circles will be of same color.

    The plug-in works on circle

    equation; the algorithm takes thevertices from blender as an input and

    then calculates the pixels location by

    putting the value of the vertex in the

    equation. The result of the equation

    decides the color of the pixel. The plug-

    in is implemented by nested loops to

    lookup the vertices of each circle and

    then fills the vertex with specified color.

    The nested loops are again then

    facilitated with recursive function.

    Figure 11 - Circles texture idea

    Figure 12 - Circles texture

  • 8/2/2019 Tamour Ahmad_05108114 - Final Project

    27/77

    20

    4.5.2. Colored EdgesThis plug-in permits the

    user to change the color of each

    individual corner. The same plug-

    in can be applied to any object

    making a different look.

    The plug-in colors the

    body by finding center points and

    then coloring the object from it

    centre to its own corner.

    Figure 13 - Colored edges idea

    Figure 14 - Colored Edges

  • 8/2/2019 Tamour Ahmad_05108114 - Final Project

    28/77

    21

    4.5.3. Gift BoxThis plug-in color the

    edges of the object and from top

    and bottom it makes a design. The

    color of the edges is adjustable.

    Except the colors, this plug does

    not allow the user to change

    anything. It gives a very beautiful

    look to an object. The plug-in

    calculates the given data and then

    colors the adjacent edges.

    Figure 16 - Gift Box texture idea

    Figure 15 - Gift Box texture

  • 8/2/2019 Tamour Ahmad_05108114 - Final Project

    29/77

    22

    4.5.4. GridThe plug-in lets the user to

    change the colors of lines. It also allows

    the user to choose the density of lines.

    The density ranges from 1 to 98.

    Choosing would leave only single lines

    in each coordinate of the axis. The higher

    you choose the density the more crowded

    the lines will be.

    The plug-in works on the simple

    straight line equation; the algorithm takes

    the vertices from blender as an input and

    then calculates the pixels location by

    putting the value of the vertex in the

    equation. The result of the equation

    directs the color of the pixel.

    Figure 17 - Grid texture idea

    Figure 18 - Grid texture

  • 8/2/2019 Tamour Ahmad_05108114 - Final Project

    30/77

    23

    4.5.5. HyperbolaThe plug lets the user to change

    the colors of the hyperbolas. It also

    allows the user to change the number of

    hyperbolas. The count ranges from 0 to

    25. Selecting 0 will leave the surface

    blank. The plug-in allows the user to

    change the thickness of the hyperbola.

    Hyperbola is dependent on two factors,

    the distance between two parts and the

    openness of both parts. They are also

    given; you can change their value to

    widen the hyperbola or to increase the

    distance between them.

    The plug-in works on

    hyperbola equation; the algorithmtakes the vertices from blender as an

    input and then calculates the pixels

    location by putting the value of the

    vertex in the equation. The result of

    the equation directs the color of the

    pixel. The plug-in is implemented by nested loops to lookup the vertices of each

    circle and then fills the vertex with specified color. The nested loops are again

    then facilitated with recursive function.

    Figure 20 - Hyperbola texture idea

    Figure 19 - Hyperbola texture

  • 8/2/2019 Tamour Ahmad_05108114 - Final Project

    31/77

    24

    4.5.6. NoiseThe plug-in has only two

    options; whether to make the

    texture black and white or o use

    RGB colors. The plug-in works

    by random numbers, when a

    vertex is given to the plug-in it

    fills the vertex with randomly

    chosen color. In BW case it

    chooses randomly between black

    and white while in RGB case is

    chooses from Red, Green and

    Blue. Figure 21 - Noise texture idea

    Figure 22 - Noise Texture

  • 8/2/2019 Tamour Ahmad_05108114 - Final Project

    32/77

    25

    Chapter 5

    5. Model LibraryI have made the model library for kitchen. The library contains items in the

    kitchen. It contains about 21 models. The screenshots of the models are shown below

    with their sketched ideas on the left or top.

    5.1. Blender

    Figure 23 - Blender sketch idea and implemented model

    User can change the colors of the blender; it has ray mirror property which

    makes it reflect the light.

    5.2. Plate

    Figure 24 - Plate sketch idea and implemented model

    User can change the colors of the blender; it has ray mirror property which

    makes it reflect the light.

  • 8/2/2019 Tamour Ahmad_05108114 - Final Project

    33/77

    26

    5.3. Ceiling Lamp

    Figure 25 - Ceiling light sketch idea and implemented model

    User can change the colors of the blender; it has ray transparency which

    will let it glow if a lamp or light source is placed inside.

    5.4. Chair

    Figure 26 - Chair sketch idea and implemented model

    User can change the colors of the chair; the legs of the chair act as mirror

    hence reflecting light to make them chrome painted.

  • 8/2/2019 Tamour Ahmad_05108114 - Final Project

    34/77

    27

    5.5. Oven top

    Figure 27 - Oven top sketch idea and implemented model

    This is stove top, it can be placed at kitchen tables or ovens. Colors could

    be customized but they are best matched.

  • 8/2/2019 Tamour Ahmad_05108114 - Final Project

    35/77

    28

    5.6. Microwave oven

    Figure 28 - Microwave oven sketch idea and implemented model

    User can change the colors of the microwave oven; it has transparency

    property in the glass which allows seeing inside.

  • 8/2/2019 Tamour Ahmad_05108114 - Final Project

    36/77

    29

    5.7. Refrigerator

    Figure 29 - Refrigerator sketch idea and implemented model

    User can change the colors of the fridge; it has ray mirror property whichmakes it reflect the light to make it metallic.

    5.8. Glass

    Figure 30 - Glass sketch idea and implemented model

    User can change the shades of the glass; it has ray transparency property

    which makes it refract the light to show it as a glass object.

  • 8/2/2019 Tamour Ahmad_05108114 - Final Project

    37/77

    30

    5.9. Stylish glass

    Figure 31 - Stylish glass sketch idea and implemented model

    User can change the shades of the glass; it has ray transparency property

    which makes it refract the light to show it as a glass object.

    5.10. Sink

    Figure 32 - Sink sketch idea and implemented model

    User can change the shades of the sink; it has ray mirror property different

    in different parts to differentiate between sink and taps.

  • 8/2/2019 Tamour Ahmad_05108114 - Final Project

    38/77

    31

    5.11. Oven

    Figure 33 - Oven sketch idea and implemented model

    User can change the colors of the microwave oven; it has transparency

    property in the glass which allows seeing inside. And it has ray mirror property in

    remaining parts to be visible as metallic.

    5.12. Pan

    Figure 34 - Pan Sketch idea and implemented model

    User can change the colors of the pan; it has ray mirror property to glow in

    the light a bit.

  • 8/2/2019 Tamour Ahmad_05108114 - Final Project

    39/77

    32

    5.13. Tray

    Figure 35 - Tray sketch idea and implemented model

    User can change the color of the tray. Properties can be adjusted according

    to the requirement.

    5.14. Spatula

    Figure 36 - Spatula sketch idea and implemented model

    User can change the colors of the Spatula; it has mirror property in the

    front part which allows it to give a metallic vision.

  • 8/2/2019 Tamour Ahmad_05108114 - Final Project

    40/77

    33

    5.15. Tea pot and cups

    Figure 37 - Tea pot and cups sketch idea and implemented models

    A set of teapot and cups, fully customizable, colors can be changed and

    mirror or transparent property can be applied.

    5.16. Dinner set

    Figure 38 - Diner set implemented model using existing ideas

    A set of dining utensils, fully customizable, colors can be changed, shades

    can be changed and mirror or transparent property can be applied. It is made from

    existing ideas.

  • 8/2/2019 Tamour Ahmad_05108114 - Final Project

    41/77

    34

    5.17. Vase

    Figure 39 - Vase sketch idea and implemented model

    User can change the color of the vase. A texture is applied on the vase to

    give it a muddy look.

    5.18. Fireplace

    Figure 40 - Fireplace sketch idea and implemented model

    User can apply a wood texture onto the object or can use blender internal

    wood plug-in to give the fireplace a wooden look.

  • 8/2/2019 Tamour Ahmad_05108114 - Final Project

    42/77

    35

    5.19. Side table

    Figure 41 - Side table idea and implemented model

    User can change the color of the kitchen side table from different places.

    Top color can be different from bottom colors. User can also change color of the

    handles of drawers.

  • 8/2/2019 Tamour Ahmad_05108114 - Final Project

    43/77

    36

    5.20. Cabinet

    Figure 42 - Cabinet idea and implemented model

    User can change the colors of the cabinets. And can even place objects in

    the cabinet. The cabinet give a wooden look so wood texture or plug-ins can be

    applied.

  • 8/2/2019 Tamour Ahmad_05108114 - Final Project

    44/77

    37

    5.21. Table

    Figure 43 - Table idea and implemented model

    User can change the color of the legs of the table and can change the shade

    of the glass of the table. It is made from existing ideas.

  • 8/2/2019 Tamour Ahmad_05108114 - Final Project

    45/77

    38

    Chapter 6

    6. Models

    The model shown above has many objects in it which have been taken from the

    library shown in chapter 5. The model makes a kitchen. It uses lamp light in the ceiling

    light and area lightin the middle Ceiling light. Only some of the objects are downloaded

    from the internet. Different object properties are used to create realistic effect. As oven

    has shine in it so the window mirror has. The table is transparent and the light passes

    through it. The ceiling glows due to the light of the bulbs and reflects the light back.

    The models are duplicated; array modifiers are used for duplicating. The lights are

    using the same properties to ease the user; if we change any property of a single light; it

    will change all the lights automatically according to it. Same thing is done with the side

    tables. If color or texture of one table is changed all of the others will be changed

    accordingly. This makes work very easy instead of repetition of work.

  • 8/2/2019 Tamour Ahmad_05108114 - Final Project

    46/77

    39

    Chapter 7

    7. ConclusionAfter doing the entire project I have learned many things. First of all the project

    gave a very good idea of 3D world, secondly the project delivered a good knowledge of

    3D mathematics and thirdly it gave fine initiative to gaming. The project also helped us to

    learn how models are made in 3D applications like blender which we used, 3D max,

    Maya and etc. How coordinates are handled, how vertices are controlled. And then we

    learned about lights, how they are controlled, how radiosity and illumination is handled.

    In Blender 3D we learned how to make objects, how different objects are made

    out of cubes and cornered objects. A circle is made up of small polygons which have

    sharp corners but they are so small in size that they all together make a smooth sphere.

    While making plug-ins, intense mathematics was used. We learned mathematics

    in different angle. This time we used mathematics in real world otherwise mathematics

    was just a subject to study. We used different equations to draw different textures and

    implemented different algorithms to make different shapes on textures. It was really fun

    to handle coordinates in real but not just imaginary mathematics like we do in classes.

    Thirdly after studying the second book I was able to use Blenders 3D engine. It is

    a small but much powerful engine. I made some sample games which were provided with

    the book CD. Creating game was fun rather than playing just buying and playing it. Gameengine gave much knowledge how it works. Game engine handles everything like gravity,

    hit, touch, stroke and etc.

    In the end I would like to say thanks to Sir.Bhatti who assigned me a really great

    touch. As I am also interested in the 3D field. The whole project was fun rather than a

    burden. I did my project whole heartedly and have put all of my efforts in completing it.

  • 8/2/2019 Tamour Ahmad_05108114 - Final Project

    47/77

    40

    Chapter 8

    8. References[1] Manual/Introduction/Installing Blender - BlenderWiki

    March 8, 2009, from CS Research Lab: GIFT University Gujranwala.

    Website:http://wiki.blender.org/index.php/Doc:Manual/Introduction/Installing_Blender

    [2] Writing a Texture Plug-in

    March 8, 2009, from CS Research Lab: GIFT University Gujranwala.

    Website:http://download.blender.org/documentation/htmlI/ch27s02.html

    Other referred pages

    http://www.cs.virginia.edu/~lcc-win32/ http://en.wikipedia.org/wiki/Blender_(software) http://www.tutorialized.com/tutorials/Blender-3d/1 http://www.blender3darchitect.com/ http://www.blendernation.com/2006/02/18/the-blender-3d-model-

    repository/

    http://www.katorlegaz.com/3d_models/

    http://e2-productions.com/repository/index.php http://www.blender.org/education-help/tutorials/tutorial-folder/3d-

    walkthrough/

    http://www.upperfold.com/3D.shtml http://www.blender3d.it/ http://www.blenderguide.org/Blender-Resources/models-co/Blender-3D-

    Model-Repository-akator-l36.html

    http://www.blender.org/download/resources/ http://www-users.cs.umn.edu/~mein/blender/plugins/ http://download.blender.org/documentation/htmlI/ch27.html http://www-users.cs.umn.edu/~mein/blender/plugins/plugindoc.html http://www-users.cs.umn.edu/~mein/blender/plugins/dll.html http://www.techimo.com/articles/index.pl?photo=60

    http://wiki.blender.org/index.php/Doc:Manual/Introduction/Installing_Blenderhttp://wiki.blender.org/index.php/Doc:Manual/Introduction/Installing_Blenderhttp://wiki.blender.org/index.php/Doc:Manual/Introduction/Installing_Blenderhttp://download.blender.org/documentation/htmlI/ch27s02.htmlhttp://download.blender.org/documentation/htmlI/ch27s02.htmlhttp://download.blender.org/documentation/htmlI/ch27s02.htmlhttp://download.blender.org/documentation/htmlI/ch27s02.htmlhttp://wiki.blender.org/index.php/Doc:Manual/Introduction/Installing_Blender
  • 8/2/2019 Tamour Ahmad_05108114 - Final Project

    48/77

    41

    Appendix A

    Generic texture plug-in

    #include "plugin.h"

    /* Texture name */

    char name[24]= "";

    #define NR_TYPES 3

    char stnames[NR_TYPES][16]= {"Intens","Color", "Bump"};

    /* Structure for buttons,

    * butcode name default min max 0

    */

    VarStruct varstr[]= {

    {NUM|FLO, "Const 1", 1.7, -1.0, 1.0, ""},

    };

    typedef struct Cast {

    float a;

    } Cast;

    float result[8];

    float cfra;

    int plugin_tex_doit(int, Cast*, float*, float*, float*);

    /* Fixed Functions */

    int plugin_tex_getversion(void) {

    return B_PLUGIN_VERSION;

    }

    void plugin_but_changed(int but) { }

  • 8/2/2019 Tamour Ahmad_05108114 - Final Project

    49/77

    42

    void plugin_init(void) { }

    void plugin_getinfo(PluginInfo *info) {

    info->name= name;info->stypes= NR_TYPES;

    info->nvars= sizeof(varstr)/sizeof(VarStruct);

    info->snames= stnames[0];

    info->result= result;

    info->cfra= &cfra;

    info->varstr= varstr;

    info->init= plugin_init;

    info->tex_doit= (TexDoit) plugin_tex_doit;

    info->callback= plugin_but_changed;

    }

    int plugin_tex_doit(int stype, Cast *cast, float *texvec, float *dxt,

    float *dyt) {

    if (stype == 1) {

    return 1;

    } if (stype == 2) {

    return 2;

    }

    return 0;

    }

  • 8/2/2019 Tamour Ahmad_05108114 - Final Project

    50/77

    43

    Appendix B

    To start making the shown furniture model, first of all start the blender. A cube

    will be present in the centre of the screen. First of all, let us make the flat surface of the

    table. Press the [Tab] key to enter into Edit mode.

    Figure 44

    Object mode

    Figure 45 - Edit mode

  • 8/2/2019 Tamour Ahmad_05108114 - Final Project

    51/77

    44

    Once you have entered the edit mode, press [Ctrl] + [Tab] keys, a menu will be

    displayed with three options namely Vertices, Edges and Faces. Select the Faces option

    from the menu or alternatively press the [3] to select the third option. Once option is

    select, select the face at the positive z-axis by right clicking on the centre spot of the face.

    Once the face is selected, press the [G] key to grab the face and then [Z] key to resize in

    only z-axis direction. Resize it until its height reaches to 0.500.

    Figure 46 - Resizing cube (A)

    Now extend the other sides of the cube until it looks like the one in the following

    image with specified sizes.

    Figure 47 - Resizing cube (B)

  • 8/2/2019 Tamour Ahmad_05108114 - Final Project

    52/77

    45

    The upper part of the table has been created. Now we have to make the legs of the

    table. Press [Space] on the 3D screen. Add a cylinder of radius 0.25 and depth 4. Press

    [Tab] to enter edit mode. In the edit mode press [Ctrl] + [R] to loop subdivide. Give it the

    following cuts:

    1. First of all cut the cylinder at a distance of 0.010 from bottom.2. Give it another cut at a distance of 0.250 from the previous cut.3. Another cut at a distance of4. Another cut at a distance of 0.250 from previous cut.5. Now a cut at a distance of 0.010 from the top.

    The cylinder should look similar to the one shown in the figure below.

    Figure 48 - Table Leg (A)

    The purpose of these cuts will be explained later. Now as we have divided the

    cylinder into many parts. Now its time to give a real touch. Get back to Object mode bypressing [Tab] key. Press [F9] to open Editing panel. In the modifiers tab add modifier

    Sub surf. Now enter into edit mode and select the following vertices by selecting two or

    more vertices in a loop and then press [Ctrl] + [E]. A menu will appear, select Edge

    Loop Select from the menu. It will select all the vertices present in the loop as shown in

    the figure below.

  • 8/2/2019 Tamour Ahmad_05108114 - Final Project

    53/77

    46

    Figure 49 Table Leg (B)

    Enter into Scale manipulator mode by pressing [Ctrl] + [Alt] + [S]. The axis

    arrows will be converted into squares. Grab the y-axis outside for about 1.5 by holding

    [Ctrl] + [Shift]. Do the same for x-axis. Repeat these both processes for fourth loop from

    the bottom. Now do the same for both the loops at the bottom one by one. Finally do it

    once again for the second loop from the top. Following shape will be created.

    Figure 50 - Table Leg (C)

  • 8/2/2019 Tamour Ahmad_05108114 - Final Project

    54/77

    47

    Select the vertex at the center on the top. And press [Shift] + [S] and selectCursor

    Selection. Enter the object mode and click on the centre cursor from mesh tab.

    Figure 51 - Table Leg (D)

    Now select the upper part of the table and subdivide it like shown in the image

    below.

    Figure 52 - Sub diving Table

  • 8/2/2019 Tamour Ahmad_05108114 - Final Project

    55/77

    48

    Select one of the vertexes from the surface below and put the curser there by

    pressing [Shift] + [S].

    Figure 53 - Selecting Vertices

    Select the leg of the table and press [Shift] + [S] and this time select Selection >

    Cursor. The leg will move to the selection. Now select the flat part of the table and press

    [Shift] + [S] and select Cursor --> Selection. Once the selection cursor moves to the

    centre of the table select the leg and from the Mesh tap press the Center Cursor button.

    Now from the modifier tab; add Mirror Modifier to x-axis and y-axis. It would look like

    the image shown below.

    Figure 54 - Table completed

  • 8/2/2019 Tamour Ahmad_05108114 - Final Project

    56/77

    49

    Now the table has been created, to give a real touch, let us polish it by adding a

    sheet onto it. To make a sheet place the cursor the top of the table and add a mesh plane.

    Scale the plane with the lengths shown in the figure using [Ctrl] + [Alt] +[S] in the edit

    mode. Press [Ctrl] + [Tab], a menu will appear, edge all the edges one by one and extrude

    them by pressing [E]. Extrude for a length of 0.300. When extruding press the [X] or [Y]

    to extrude in specific direction. Then press and hold [Shift] to extrude. The model will

    look like the shown in the figure below.

    Figure 55 - Table Sheet (A)

    Once extruded; press [Ctrl] + [Tab] and then [2] to enter edges selection mode.

    Select each of the edges and drag them downward (z-axis) as shown in the figure. While

    dragging, press and hold [Ctrl] button and drag one step.

  • 8/2/2019 Tamour Ahmad_05108114 - Final Project

    57/77

    50

    Figure 56 - Table Sheet (B)

    To make the corners of the sheet, use the make face option in the blender. Press

    [Ctrl] + [Tab] keys and then [1] to enter into vertex selection mode. Select all the three

    edges and press [F] to make a new face. The example is shown in the following figure.

    Figure 57 - Table Sheet (C)

    Make faces of all four sides. Now subdivide the sheet into many parts as shown in

    figure using subdivide option. You can use sub dividing option by pressing [Ctrl] + [R] in

    edit mode.

  • 8/2/2019 Tamour Ahmad_05108114 - Final Project

    58/77

    51

    Figure 58 - Table Sheet (D)

    Now get into the edge selecting mode by pressing [Ctrl] + [Tab] and then [2] key.

    Select the base edge of the triangular face you created by pressing [F] key. And drag them

    downward in z-axis. Once done, enter into vertex mode and select vertices of side one by

    one. And drag them outside for a distance of about 0.300. Do this for all sides.

    Figure 59 - Table Sheet (E)

  • 8/2/2019 Tamour Ahmad_05108114 - Final Project

    59/77

    52

    Now add sub surf to the sheet to make it smoother. But before adding sub surf subdivide

    the sheet from the sides; otherwise the sheet will shrink. Well! Try it for yourself and then

    subdivide. Subdivide as shown below.

    Figure 60 - Table Sheet (F)

    Figure 61 - Table Sheet (G)

    Take a look the picture, you will notice that the flag wood on the legs of the table is under

    the sheet and therefore it is not visible. Thus removing it will not affect anything. Remove

    the sheet to decrease the load on rendering process.

    We have subdivided the side

    from here. These are two lines

    with a distance of 0.001

  • 8/2/2019 Tamour Ahmad_05108114 - Final Project

    60/77

    53

    Figure 62 - Table with Sheet

    The dining table has been created.

    The chairs:

    Press [2] to go to next frame. Add a cube by pressing space and then select cube

    from the mesh menu. Enter the edit menu and press the cube downward until it reaches to

    height 0.200.

    Figure 63 - Chair (A)

  • 8/2/2019 Tamour Ahmad_05108114 - Final Project

    61/77

    54

    Extrude the face from a side to about 0.200 lengths. Extrude the extruded part

    upward for a length of 3.00 by pressing and holding [Ctrl] key.

    Figure 64 - Chair (B)

    Now subdivide the back of the chair into five parts. And select the edges of the

    middle rectangle. Press them inward. After that select the edges from the top of them and

    press them inward using scale-manipulator.

    Figure 65 - Chair (C)

  • 8/2/2019 Tamour Ahmad_05108114 - Final Project

    62/77

    55

    Now we have to add sub surf to make it smoother. But again, before adding sub

    surf use subdivide to make kind of boundaries of the chair; otherwise what will happen,

    check it yourself.

    Figure 66 - Chair (D)

    The sub-division on each side is of about .100 widths. But the place where the

    back and base of the chair meet, there it is having a width of about 0.001.

    Figure 67 - Chair (E)

    The highlighted edge is not a single one, actually these are three edges. One from

    the base and the other from the back. Now add sub surf.

  • 8/2/2019 Tamour Ahmad_05108114 - Final Project

    63/77

    56

    Figure 68 - Chair (F)

    Make legs for the chair. Add a cube from mesh objects. Resize it to a height of

    2.000 unit, breadth of 0.100 unit and width of about 0.200 units. Subdivide it from the

    middle. Subdivide the upper part from the top and the bottom part from bottom to add sub

    surf modifier.

    Figure 69 - Chair Leg (A)

  • 8/2/2019 Tamour Ahmad_05108114 - Final Project

    64/77

    57

    Now the leg is ready. Next task is to attach it to the chair. To attach it to the chair,

    change its centre to the corner of the top face. To change the centre, select the top most

    face corner vertex of the leg and press [Shift] + [S] and then select the option Cursor -->

    Selection. Return to object mode and click centre cursor from the mesh tab. Now select

    the chair and change the mode to edit mode. Select the vertex as shown in figure. And

    place the cursor there.

    Figure 70 - Selecting vertices to place legs

    Select the leg and press [Shift] + [S] and then select Selection Cursor. Select the

    chair again and select the shown edge and place the cursor there.

    Figure 71 - Leg places at the selected vertex

  • 8/2/2019 Tamour Ahmad_05108114 - Final Project

    65/77

    58

    After the cursor has been placed; change the mode to object mode and select the

    leg and press the center cursor button and add Mirror modifier in Y-axis direction. Now

    make back legs. Select the legs and press [Shift] + [D] and then press [Y] to move the

    copied legs in Y-axis direction. Place them at their appropriate place as shown in figure.

    Figure 72 Complete Chair

    Lets add a seat to the chair. Add another cube in the scene. Resize it to height

    0.300 units. And place it over the chair as shown in the picture.

    Figure 73 - Chair seat (A)

  • 8/2/2019 Tamour Ahmad_05108114 - Final Project

    66/77

    59

    Make its borders because we have to add sub surf modifier.

    Figure 74 - Chair Seat (B)

    Select the topmost face and drag a little higher in z-axis direction and add sub surf

    modifier.

    Figure 75 - Chair Seat (C)

    Now press [`] key to merge both the frames. And adjust the chair according to the

    position of the table. Make the copies of the chair as shown in the picture.

  • 8/2/2019 Tamour Ahmad_05108114 - Final Project

    67/77

    60

    Figure 76 - Combined Table Chairs

    Lets place some plates, spoons and forks on the table. Press [3] to advance to

    third frame. Add a sphere from the mesh menu having radius 0.25 units and depth 0.020

    units. Change the mode to edit mode and selection mode to edge selection mode. Select

    two top border edges and then press [Ctrl] + [E]. A menu will appear, select Edge Loop

    Select from the menu, it will select all the edges in the line. Look at the figure below.

    Figure 77 - Plate (A)

  • 8/2/2019 Tamour Ahmad_05108114 - Final Project

    68/77

    61

    Press [Ctrl] + [Alt] + [S] to switch to Scale manipulator mode. First of all drag it

    into y-axis and then in x-axis direction equally. I dragged them until the scale reached to

    1.500 which is displayed on the left while dragging something.

    Figure 78 - Plate (B)

    Change the mode to translate mode by pressing [Ctrl] + [Alt] + [G] and drag it a

    little higher.

    Figure 79 - Plate (C)

    Next change the selection mode to face mode and select all the faces in the curve

    and extrude them in z-axis direction. It will make the plate a little thicker. After extruding

    add sub surf modifier.

  • 8/2/2019 Tamour Ahmad_05108114 - Final Project

    69/77

    62

    Figure 80 - Plate (D)

    Lets make a spoon now. Add a UVsphere from the mesh menu. Switch to edit

    mode and then face selection mode. Select the faces of the sphere from the top and

    remove them by pressing [X] key. Remove the faces to make it as the shape shown in the

    picture below.

    Figure 81 - Spoon (A)

    Press [A] to select the vertices of the remaining sphere. And switch to ScaleManipulator Mode in Edit mode. Drag the sphere in x-axis or y-axis direction until

  • 8/2/2019 Tamour Ahmad_05108114 - Final Project

    70/77

    63

    shape of the spoon is attained. After making the shape, make the spoon little thicker by

    extruding the faces upward as shown in picture.

    Figure 82 - Spoon (B)

    Select the faces of the spoon as shown in the above figure and extrude them. It

    will make it look like a spoon as shown in the picture below. After extruding, make it a

    little wider by selecting the faces at the back. And finally add sub surf modifier.

    Figure 83 - Spoon (C)

  • 8/2/2019 Tamour Ahmad_05108114 - Final Project

    71/77

    64

    Now lets make a fork. Add another cube in the frame. And resize it to the size

    shown below.

    Figure 84 - Fork (A)

    Extrude one of its sides and subdivide it from the middle. And extrude its sides for

    a length of 0.25. After extruding, extrude the faces of the new faces created individually

    to length of 0.020.

    Figure 85 - Fork (B)

  • 8/2/2019 Tamour Ahmad_05108114 - Final Project

    72/77

    65

    Separate them by selecting their faces as shown in the figure. And remember the

    fraction to which you separated them.

    Figure 86 - Fork (C)

    Now select their faces one by one and resize them as shown below through scale

    manipulation mode.

    Figure 87 - Fork (D)

  • 8/2/2019 Tamour Ahmad_05108114 - Final Project

    73/77

    66

    Now extrude these faces and then resize the faces at the end as shown below in the

    picture.

    Figure 88 - Fork (E)

    Now subdivide the regions from the middle as shown in the picture below.

    Figure 89 - Fork (F)

  • 8/2/2019 Tamour Ahmad_05108114 - Final Project

    74/77

    67

    Now select the faces indicated in the picture shown below and move those 0.150

    units higher along the Z-axis.

    Figure 90 - Fork (G)

    Now add sub surf modifier to it. Press [`] key to merge all the frames. Now place

    all the things at their correct places. As shown below.

    Figure 91 - Combing all items

  • 8/2/2019 Tamour Ahmad_05108114 - Final Project

    75/77

    68

    You will be noticing the floor and the walls in the picture shown above. That is

    something very difficult. These are just planes. Add three planes; resize them by any

    method i.e. Extruding or Scaling.

    Applying Textures

    To give your models a real touch, to make them look like they are real we either

    have to paint them or another very good, efficient way is to apply textures on them.

    Textures are basically pictures of real objects or even designed picture which we paste on

    the models. Suppose you have a football and a world map. If you paste the world map on

    a football, wont it look like a globe? Surely it will.

    With the same procedure, we will apply textures on the models. You can

    download texture from different sites but I recommend searching them from Google

    Images. Let us start applying texture on our models.

    Select any object from the scene, lets start from table sheet. Select it and enter the

    Shading mode by pressing [F5]. In the shading menu select the sub-menu Material

    buttons in case it is not selected by default. In the Links and Pipeline tab press the Add

    New button.

    Figure 92 Adding Material Object

    http://images.google.com/http://images.google.com/http://images.google.com/http://images.google.com/http://images.google.com/
  • 8/2/2019 Tamour Ahmad_05108114 - Final Project

    76/77

    69

    After you have pressed the button, a material object will be created for the table

    sheet. Now form the texture tab press the Add New button to add a texture object for

    the table sheet as shown in the picture below. Once you have pressed the button, press

    [F6] to enter the texture mode.

    Figure 93 Adding a texture object

    In the Texture tab select the texture type as Image. After selected the type as

    image press the Load button from the Image tab to select the image. Browse for the

    image to use as a texture and press the button select image.

    Figure 94 - Specifying texture type and loading image

  • 8/2/2019 Tamour Ahmad_05108114 - Final Project

    77/77

    Now do the same for all the objects in the whole model. Apply appropriate images

    as their textures.

    Figure 95 - The final image