Thursday, October 15, 2015

Convex Hull algorithm in Unity

Convex hull algorithm in Unity - 1. 2D problem


  • Convex hull algorithm
  • To visualize offset area of freely moving vehicle over time, I developed 2D convex hull algorithm in Unity3D environment.
Moving Vehicle, expressed as connected cubes

  • There's nice library for convex hull algorithm, but is not possible to use it in Unity3D, since the library was implemented based on .NET 4.
  • So, I implemented Graham's scan by myself, by firstly implement the algorithm in MATLAB and converting it into C#.

  • Result in MATLAB
    • Circles : trajectory of vertices of vehicle offset 
    • Lines : calculated convex hull

  • Result in Unity3D
    • Store vertices data 30 times per second
    • Maintain up to 2 seconds data from current frame
    • From those vertices, calculate convex hull in every frame and generate 3D shape by extruding result.
    • For better visualization, add outlines for edges

  • Next?
    • 2D offset --> 3D offset




Saturday, October 4, 2014

Data visualization - Bibliography? (※5MB GIF included!!)

Data visualization of papers & keywords 

  • Developed as a part of convergence research contest.
  • Our team members decided to propose the concept for analyzing, visualizing and exhibit the research relationships in our institute.
  • We started from extracting the keywords in papers published in recent 5 years from our institute.
  • Because of the lack of time, I "conceptually" developed an application to show how the relationships can be visualized.

Data visualization, 2D or 3D? 

  • The D3.js is now getting popular for most type of data visualization in 2D.
  • 2D data visualization has advantages on concise expression and easy perception to users.
  • On the other hand, the 3D visualization is needed when we want to provide "spatial" sort of experience to user.
  • Usually the type of data we focused tends to be visualized in 2D, but we(actually I,) tried to visualize it in 3D for future.
  • For instance, LBS or AR use.
  • Of course the effective visualization approach should be discussed more in later.

Development of a demo application

  • Like always, Unity3D is very useful when you need to develop an application in very short time. 
  • The concept of my visualization is a planetarium, which each keyword is floating on the dome shaped sky. 
  • Application includes relationship visualization functions and search functions. 
  • Also the titles, authors and research fields can be seen if user selected certain keyword to get into the "Focus Mode". 
  • Textures are simply made from MS PowerPoint. 
  • Source database exists in Dropbox and read through WWW class at first time, but I changed it into TextAsset resource since the data is not going to be dynamically changing. 
  • Again, the multi-channel visualization can be easily done though the multi-channel module I have.

The scene captured in 3rd person view


Selecting the keyword in 1st person view
Relationship is indicated with line 

Searching the keyword
Searching result is indicated with simple animation with different texture



 Focus Mode.
Specific information related with "Lithium-Ion Battery" can be seen in here

Multi-channel visualization

Discussion? 

  • As I mentioned, the effectivess of visualization should be improved in so many ways.
  • Location based service application using GPS data can be easily developed, but the performance should be improved when using it with smart device.
  • There's not much "analysis" of the data in demo application. Data analysis method in bibliography fields should be applied.