torsdag 12 februari 2015

Information Visualisation Project 2



This project was made as part of a course in Information Visualisation at KTH.

Finding interesting Data



I searched for interesting data in the open database of the World View Survey. They do a worldwide survey with the purpose of studying changing values and their impact on social and political life. The WVS is the largest non-commercial, cross-national, time series investigation of human beliefs and values ever executed, currently including interviews with almost 400,000 respondents. The survey is done almost 100 countries which contain almost 90 percent of the world’s population.

Their survey, which started in 1981 is conducted in rounds, or “waves” as the WVS calls it. Until now they have conducted 6 waves each spanning over 4-5 years. Since the survey questions to a large extent are unaltered between waves it is possible to research how social values have shifted over the last decades. I thought this aspect of time was the most fascinating scale of the WVS data. Through their Online Visualisation Tool it is possible to learn how answers to a certain question have been answered in each wave. I started exploring how different answers to different questions had changed over time. I was mostly interested in South American countries and political values since this is something that interests me and I have some knowledge about. Many nations in the area have a history of military regime and dictatorships across the 1900s. The ensuing democratic systems instituted in these nations since the 1980s have generally been week and struggling but continuous. In this context I found an intricate survey question in the data:


“I'm going to describe various types of political systems and ask what you think about each as a way of governing this country. For each one, would you say it is a very good, fairly good, fairly bad or very bad way of governing this country?

Having a strong leader who does not have to bother with parliament and elections”



This question is interesting to me, because it reflects on both the fact that these nations have a history of violent military regimes but also on frustration towards the current democratic system. I spent last summer in Argentina; a country in deep economical crisis so I thought it might be interesting to see how answers to this question had changed over time. Here are the data from VVS:







This data show that the answer Very Good and Fairly Good both increased about 10% since 1994. This I found quite remarkable. And I was interested  in visualising it.

Visualisation prototyping




This visualisation of the data can be created through WVS own online visualisation tool. It shows the increase in answers “Very Good” and “Fairly Good” but separately. I find that the increase in these answers makes more impact and tell more of a story if visualised together. 





I used the WVS online tool to make a pie chart of the answers to the question in each wave and placed them next to each other chronologically. This visualisation method has been called “small multiples”; the same graphical design structure repeated but with one variable changed. My variable is of course time. In comparison with the chart I think this visualisation does more to tell the story since you can see the shift at a glance.



Next I used D3 to improve my “small multiples”-visualisation idea. I will explain this through Visualisation Pipeline.

Visualisation Pipeline

Raw Data


Raw data was collected from the WVS database. The data was quite clean. However I choose to sum answers of “don’t know/no answer” because the difference between them was not of significance to the story I wanted to tell.

Data Tables

I created a data table for Argentinas answers to the question over the wave 3 to wave 6 (Argentina was not part of the two first waves). Each row in the table represents answer “Very Good”, Fairly Good, Bad, Very Bad and No Answer/Don’t know in that order.


wave3 wave4 wave5 wave6
5.9       7.9       5.3       14.5
20.8    28.1    26.8    30.1
29.6    25.6    26.4    22.8                                       
34.8    24.9    20.1    21.4
9.0       13.5    21.4    11.1

Visual Structures


I then mapped each results to a pie chart in D3. But instead of putting each pie chart next to each other to do a small multiples visualisation, I mapped each waves data as a state of and animated pie chart. This was an experiment to investigate if the small multiples visualisation could be improved by animation. I did this in D3.js and created a view.

Views

I created a view in D3 where the state of the pie chart could be altered by click of radiobutton representing the different waves. On choosing a wave, the pie chart will do an animated transform to that state. So if you go through the waves chronologically you can actually see the increase in positive answer over time. I then played around with a colour scale that made good representation of the answers. I also added a legend. 


Expanding my research questions


I was happy with my visualisation of Argentina's posture on strong leaders over time. However I was interesting to see how this corresponded with other South American nations. So I made equivalent visualisations for all South American nations available from the WVS data base and place them in the same view as the Argentina visualisation. Unfortunately not all the wave 3 through wave 6 was available for all countries, why I had some states completely grey (meaning "no data) I thought it would be cool if the user could play time forward for all nations simultaneously so I added a overall control that rules over all other controls. The user can still interact with individual pie charts. I also added a small box which appears when hovering over each nations pie chart. This works as details-on-demand about the political history of each nation.



Ending thoughts:


I was happy to try out D3.js for the first time! I learned a lot! It seems like a very powerful visualisation tool and I look forward to taking on more difficult tasks with its help. During this process, I wanted to make an animated visualisation. Unlike more static visualisation which can easily be sketched out on paper or prototyped in a graphic design software, I had to try to visualise it in my head and I was not really sure how it would turn out until much later when I had coded it. I wonder if there are any good methods for prototyping animation? In any case very interesting process!





onsdag 4 februari 2015

3D modelling project: part 6




Problems with materials

After initially just dragging in my model into Unity and saw that it more or less worked I had to work on some details. First, I had problems with the the materials(the blue/green and gold metallic colours) I had created in Blender. After a lot of googling I came to the conclusion that this probably not worked for one of two reasons or both:

1. I used the Cycles Engine in Blender to construct my materials. I do not know if this works outside of Blender

2. My materials used combinations of Glossy shaders. As I understand it, shaders works differently in distinct environments why you can not just translate it from Blender to Unity.

I considered using Crazybumps to create textures of the materials I had created in Blender and loading them in that way to Unity but this would include a lot of extra work. In the end I chose an easy way out. I loaded in screenshots of the rendered trashbin into Unity and then took samples of the colors to create new materials in Unity. I then worked with Unitys internal shaders to try to create the same metallic surface. The result was OK, however next time I will definitely try to plan my work flow differently!


Creating a scene

Investigating my materials problems, I learned a lot about the Unity architecture. So I created a new scene. Added a floor with a pavement texture, some lightning, my trash bin model and a First-Person-Controller. From there I could press play and walk around and look at my model. Nice!

Editing model

However I noticed another problem! I could trough to the other side of the trash bin! But circling around to the other side of the model, it was solid. I had not created an interior of the model! I went back to blender, created some new faces and extruded to created and interior, a bottom and a roof of the trash bin. But I still had some problems! After a lot of googling I understood that faces actually has a back and a front side. And only the front side is covered by the material, from the back of the face you can see through it. So I had to display normals in Blender so I could see which faces where turned and then flip normals to turn them around. The picture below show the difference between the model before and after I made this changes, in the scene of Unity.





In the end this problems I had with loading in my model to Unity really forced me to read up on how the Unity architecture works and I now feel that I have a basic understanding of how to move between between Blender and Unity. On my next project, because of this, my workflow will probably be quite more straightforward. However I am definitely interested in exploring both Blender and Unity more!






söndag 1 februari 2015

3D modelling project: Part 5



Finally I wanted to try to input my model into Unity. I have never used Unity before and it seems like quite a complex program. Fortunately, first time I used it, it loaded up a default game world and it was easy for med to import my model as .fbx directly into it. Looks good!

However I had some problems loading in the materials I created in blender. (the materials shown here are similare materials that I added in Unity). Will have to investigate how to export from blender to unity in .fbx with the materials included.





fredag 30 januari 2015

3D modeling project: Part 4

Now I had my model ready and done!




Next up I wanted to add the green and gold textures of the trash bin. I found it quite hard to work with textures for this material since it does not really have much of a texture. It is smooth painted metal. This was easier to make with materials and lightning. I experimented with different materials and adding lightning and thought the result was quite good.

My modelling of the trash bin was finished!





måndag 12 januari 2015

3D modelling project: part 3

Now I was ready to start modelling!

First i loaded in a front photo of the trash bin in Blender as background, moved it slightly to the side and then started to try to make the starting cube object of blender look like the trash bin form.



Since the trash bin i very symmetrical. I had great help from the  Loop Cut tool in blender. The Cut Tool basically creates new subareas (edges and faces) on the object. But what is great about it, is that it makes these sub dividings symmetrically all around the object. So for example, when i sliced  up a hole for the opening on the trash bin, the same opening was there to but cut opened on the opposite side.


I cut open four holes in the top of the object for the holes and dragged the side of the opening slightly inwards. I also rounded the roof of the trash bin.

Then i worked with the two golden parts of the form. There are two parts of the trash bin where the shape is shaped in three lines of golden bands. I had to extend and intended the surface and the round all parts. 




I also added a rectangle on each side of the trash bin. I don't know that function it has, but it is there on the real trash bin so I wanted to add it.


So, this was the final model of the trash bin!





fredag 9 januari 2015

3D modeling project: part 2


My teacher had told me that he and his team were interested in 3D models of objects and building on the KTH Campus. Since my project would be kind of small and simple I chose to model a trashbin. These are the photos that i took! (It was very snowy, so pictures could definitely have been better! Especially if I wanted to make textures tiles from the photos. However, later I came to the conclusion that materials might actually look better for the kind of very smooth painted surface of the trashbin.)













onsdag 7 januari 2015

3D Modeling Project: Part 1

3D Modeling Project: Part 1

For  the course DH2320 Introduction to Visualisation and Computer Graphics I am doing a 3D modeling project.

The instructions where according to email exchange with my teacher (see below)

I am nearly finished with the labs. However I will probably not be in Stockholm for the exam in January.  It has >been stated that it is possible to do a project instead of the labs. But would it be possible to instead replace the >exam with a project?

Sure, this is no problem. You can do a small project instead of just the project, or if you are doing a project already, increase its scope somewhat to cover the exam.

About project ideas, I am very interested to learn some Unity!

Excellent! Some basic modelling of objects in Blender that could be brought into Unity would be fine. Here is an example project from DH2320 for a different student who is also doing a project solely instead of the exam: http://kthbenches2014.wordpress.com/
And here's a blog from a previous course that could give you an example of the process: http://dh2323bus.wordpress.com/

In terms of what to model, it would be useful if you could model something that fits in with the KTH scene that we are constructing (see: https://kth.box.com/s/qt7s8wr74fu36t8we85n).
To be specific, some items that we have a need for (that nobody has agreed to work on yet) include a Stockholm style bins, lamps, traffic signs and street markings. Let me know if any of these strike you are interesting. 
Yes, that's it. You might also find the method described in this link to be useful (once you have a little more experience with modelling): http://www.youtube.com/watch?v=qJJRC2ebvSE
Modelling buildings is also possible, but that starts to get into a larger project than that covering just the exam.

You might take a few photographs of the objects, both to use as textures and to help with modelling. You would load those into e.g. Blender as a background and then start to create the 3D model from there. Later, you would export it into Unity as an FBX file (really just a few mouse clicks). How does something like that sound? 


Okay so lets go!


The method recommended by my teacher and the youtube video he referred to used Blender as a modeling environment. I have previously only used Maya, so I wanted to do a tutorial of some sort understand the interface and work process in Blender. I downloaded Blender and followed a tutorial to create a simple cup model.




I followed this tutorial to do the cup https://www.youtube.com/watch?v=y__uzGKmxt8
Im ok with the result. The handle was a little long/big maybe....but for a first try I am pretty happy!

As for Blender i thought it was a really great tool! I liked it a lot more than Maya(as of now) so happy i made the switch.

Now that I know the Blender interface, the next step is to watch the whole video of the method recommended by my teacher where you model from a 2D image as background.