Search Unity

Interactive 3D architectural visualisation with SQL connection

Discussion in 'Getting Started' started by tkralik, Feb 8, 2016.

  1. tkralik

    tkralik

    Joined:
    Feb 8, 2016
    Posts:
    2
    Hello,

    I'm looking for a way how to make dynamical visualisation of buildings, objects and outer areas. What I have in my mind is a project, where I have not only static buildings but a dynamic enviroment which changes its atributes (shapes, colours, ...) according to real life data from sensory system. We already have 2D visualisation based on Open Layers 3 but we would love to take it further and make something in 3D.

    Do you know if there is a possibility of connecting Unity to SQL database so that the objects within the engine can automaticaly change according to the changes in the database? Also is it possible to make it other way round so that I can change some things (eg. temperature in the room) and it would be posted to the database?

    I know people are using SQL database in Unity for leaderboards, so I wonder if I could use it for visualisation. Your advice will help me a lot as I don't have that much experience with Unity. Thank you for you help,

    Tom
     
  2. theolagendijk

    theolagendijk

    Joined:
    Nov 12, 2014
    Posts:
    117
    Hi Tom,

    There's no automatic relation between the data in your game scene and your SQL database unless you create it. You can write you own application logic to keep the data in sync.

    I have no experience with directly connecting to an SQL database from Unity.
    But I have done this with a server script in between.
    In my case I used Unity's WWW class ( http://docs.unity3d.com/ScriptReference/WWW.html ) to get a JSON data representation ( of data from a SQL database ) via a serverside script that converted SQL data to a JSON file.
    If you go this route you should also look at the very helpful JsonUtility class ( http://docs.unity3d.com/ScriptReference/JsonUtility.html ).

    Good luck!
     
  3. tkralik

    tkralik

    Joined:
    Feb 8, 2016
    Posts:
    2
    Hello theolagendijk,

    thank you for information. It is very helpful. I will take a deeper look into what you have sent. Have a great day,

    Tom
     
    theolagendijk likes this.