torsdag 28 maj 2015

Creating the final scene in Unity

Today we put together the whole scene in Unity. First we imported the wall with the windows which is shown bellow.
We did also create the floor by creating a tiled bases texture that can be repeated over and over again. In Unity we used the shader called "Bumped Diffuse" which allowed us to repeate the texture and use a Normal Map aswell.
Tiled Texture

Next we created the window frame that's in the window.

We angled the directional light so that it would shine through the windows, at first the wall did not cast any shadows which was due to it being a plane and not having a backside with normals pointing out. This was solved by covering the back of the wall with planes facing outwards, by doing so we ended up with the result below. The window itself was created by using a plane and applying a transparent shader.


Aftrer that we added the wall on the other side, two doors and two paris of different lamps. A simple frame was added to the door before it was imported. We also restricted the area with two transparent walls on each side. Two of the lamps have spotlights which shine on the tables.


Finally we created a small script for changing the color of the lights because we thought it would be fun. The lights was quite hard to see where the directional light was shining so a third light was added between those two, where it was much easier to see. We also made it possible to dim the lights.
The documentation on Unitys website was very usefull when writing the script, Script Light Behaviour

This is the final result of our project in this course.

K (hold) - make it darker
J (hold) - make it brighter
R - Red Light, T - Green Light, Y - Yellow Light, U - Blue Light, I - White Light

/Staffan & Jimmy

måndag 25 maj 2015

Importing modells to Unity

Today we imported the table and the couch to Unity, we did also add textures to the couch.

To import a model from Maya to Unity is very easy, you just drag and drop the .mb file from the folder where you saved it to the project window in Unity. Then the model can be used in a scene.


The textures we assigned to it in Maya did not come with the model automaticly, to add the texture we draged and dropped it from the save location to the project window. Then we added the texture to the material that was assigned to the table. The UV mapping is saved in the .mb file which made the texture map the right way.


Next we imported the couch and created two different materials, one for the seat and one for the frame. For the frame we simply assigned the material with a color. For the seat we took a picture of the real thing and used it as a texture.
To make the seat look a bit more realistic we used a normal map, we searched online and found a website where a normal map could be created from a picture Create a Normal Map. Below you can see the difference the normal map does.

Without Normal Map
With Normal Map









Then we wanted to be able to walk around in the scene and look at the modells from different angles, luckely there is a free package called "Characters", which contains a "FPSController" that allows you to walk around and look with the mouse.
To make the character have something to walk on we created a plane and then some walls to limit the area.


At first we were able to walk through the models that was imported, that was solved by adding "Mesh Colliders" to them, we also had to check the marker box "Generate Colliders" for the modells.


Next we wanted to be able to play the "game" here in the blog. We watched this video on how to achieve that but it didn't work at first. This blog was first created on Wordpress and it seemed like you had to pay to be able to embed a Unity game. Then we tried this blog-site and it worked.

Use w,a,s,d to walk, the mose to look around and space to jump. Click in the window to activate it. Click outside it to deactivate.



/Staffan & Jimmy

More modelling

Today we remodelled the couch with an other technique, previously we inserted edgeloops and used the extrude tool to build it. It took quite some time to do that and to get the right length of each extrusion. Instead we built each part seperatly and then simply snap and combine them together.



Then we decided to model the two types of lamps you can find in the corridor, we couldn't meassure them so we eyeballed it.


After that we modelled the type of door that you can find in the corridor. Since the handel is like a cylinder with a bend to it we did some research on how to do that. The easiest way was to use the "CV Curve Tool", the curve could be shaped in to a handle and then you could snap a cylinder to the start of the curve, and then extrude the cylinder along the line.

Extruding can now be done along the line

We then modelled the door and attached the handle to it.





 Finally we put all the models together in one scene to get a feeling for how the end result would look like, we also made a simple wall with a place for a window.

 


We are happy with how it looks, the next step will be to add textures to all the modells.

We don't think we will be creating UV maps for everything since it was quite time consuming. Instead we will assign different materials for different parts of a modell. For example, the couch has two main parts, the seat and the frame, the frame and the seat will then have two different materials with different textures. By doing this we don't need a UV map, only an image with the texture for each part.

UV mapping might be more usefull when you need more details, like if you where to texture a face or add someting specfic to the couch, like scratches or some minor graffiti etc.
 

/Staffan & Jimmy

UV mapping and texturing of the table

Today we decidet that we wanted to create a texture for our table, by first creating a UV map which we then could add the textures to.
We learned how to create a UV map by watching this video, it was a bit tricky but but after a while we had a UV map that we were happy with.


 For the textures we took pictures on the different parts of the table.

  
We then used Gimp to edit the pictures to fit on the UV map. The guide lines are not included in the texture itself, they are only used to see where to put the textures.

Finaly we saved the UV map and added it to the material assigned to the table in Maya. The final result of the table is shown below.


/Staffan & Jimmy

Modeling of the table and the couch

Our first step into this project was to get familiar with Maya, which we did by watching a bunch of Youtube videos. After that we started to model the table and the couch. To get the proportions right we measured the lengths of everyting and scaled each part accordingly. The following picture shows the first version of the models. For the most part we used the edgeloop and extrude tool in Maya. The hole in the table was created by using the "Difference" tool.

 
 /Staffan & Jimmy

Introduction and Project Idea

This is a blog about the final project in the course DH2323 - Computer Graphics and Interaction at KTH.
We are two students in this course and have chosen to do this project together. The theme for the project is KTH and we came to the conclusion that we wanted to recreate a part of a corridor in one of the buildings at KTH.The modelling will be done in Maya and then the modells will be imported to the game engine Unity.
We thought this would be interesting since we are beginners at both modelling and using Unity.

We choose to model a part of the coridor at floor 3 in the D building at KTH.


Things To Model
  • Table
  • Couch
  • Window
  • Door
  • Lamp
  • Floor
/Staffan & Jimmy