This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #pragma strict | |
| public var rows = 30; | |
| public var cols = 30; | |
| private var myVertices = Array(); | |
| private var myUVs = Array(); | |
| private var myTriangles = Array(); | |
| function Start () |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #pragma strict | |
| // Script to visualize earthquake data in GeoJSON format from USGS | |
| // (http://earthquake.usgs.gov/earthquakes/feed/v1.0/geojson.php) | |
| // Requires the SimpleJSON plugin from http://wiki.unity3d.com/index.php/SimpleJSON | |
| // The script should be attached to a model of the Earth such as a sphere | |
| // with a 20 unit diameter. A prefab to use for marking the quakes should | |
| // be assigned to the variable "prefab" in the Unity editor. | |
| import SimpleJSON; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #pragma strict | |
| import SimpleJSON; | |
| public var min = 0; | |
| public var max = 2; | |
| function Start () | |
| { | |
| var datastring = System.IO.File.ReadAllText("q.json"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #pragma strict | |
| import SimpleJSON; | |
| public var min = 0; | |
| public var max = 2; | |
| public var url = "http://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/4.5_month.geojson"; | |
| private var dataurl : WWW; | |
| private var done = 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #pragma strict | |
| // Script to take AirNow AQI data and turn it into a line graph | |
| // Data is assumed to be a time sequence for a single station, from the "Observations by Monitoring Site" query tool | |
| // The data file should be in JSON format, and placed in a folder called "data" within the Assets folder | |
| // This must be attached to a GameObject that has a Mesh Renderer and an empty Mesh Filter | |
| // Using a Mesh Renderer, rather than a Line Renderer, allows us to set per-vertex colors. | |
| import SimpleJSON; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #pragma strict | |
| // Script to visualize AQI data in JSON format from airnowapi.org | |
| // Requires the SimpleJSON plugin from http://wiki.unity3d.com/index.php/SimpleJSON | |
| // The script should be attached to a model of the Earth such as a sphere | |
| // scaled by a factor of 20 and positioned at (0,0,0). A prefab to use for marking | |
| // the readings should be assigned to the variable "prefab" in the Unity editor. | |
| import SimpleJSON; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #pragma strict | |
| private var texture: Texture2D; | |
| function Start() { | |
| var color; | |
| var s = new System.IO.File.ReadAllLines('Assets/data/glp00g60.asc'); | |
| var ncols = 360; | |
| var nrows = 143; | |
| texture = new Texture2D(ncols,180); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #pragma strict | |
| // Script that creates a Unity mesh with 2 triangles, with per-vertex colors | |
| // Note that this requires the vertexColor shader (https://gist.github.com/davepape/6b74369986ff6324c47a) | |
| // to also be in your project's assets | |
| function Start () { | |
| gameObject.AddComponent(MeshFilter); | |
| gameObject.AddComponent(MeshRenderer); | |
| GetComponent(Renderer).material = new Material(Shader.Find("Custom/Vertex Colored")); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #pragma strict | |
| // Script to create a Unity mesh containing a sphere | |
| // The sphere is warped with a sine wave pattern over time | |
| var verts1 : Vector3[]; | |
| function Start () { | |
| gameObject.AddComponent(MeshFilter); | |
| gameObject.AddComponent(MeshRenderer); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #pragma strict | |
| // Script to visualize earthquake data in GeoJSON format from USGS | |
| // (http://earthquake.usgs.gov/earthquakes/feed/v1.0/geojson.php) | |
| // Requires the JSONObject plugin from http://wiki.unity3d.com/index.php/JSONObject | |
| // The script should be attached to a model of the Earth such as a sphere | |
| // with a 20 unit diameter. A prefab to use for marking the quakes should | |
| // be assigned to the variable "prefab" in the Unity editor. | |
| import JSONObject; |