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
using UnityEngine; | |
using System.Collections; | |
using ZXing.Common; | |
public class QRCode : MonoBehaviour { | |
private ZXing.QrCode.QRCodeWriter QRWriter; | |
void Start () { | |
string url = "http://www.yazarmediagroup.com/ouya/index.html?" + Network.player.ipAddress.ToString(); |
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
//based on: http://www.softimageblog.com/archives/115 | |
void SpheresOnSphere( int n ) { | |
float increment = Mathf.PI * ( 3 - Mathf.Sqrt(5) ); | |
float offset = 2 / (float)n; | |
for(int i = 0; i < n; i++) { | |
float y = i * offset - 1 + (offset / 2); | |
float r = Mathf.Sqrt(1 - y*y); | |
float currentAngle = i * increment; |
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
local function depthSort( displayGroup ) | |
local objects = {} | |
for i=1,displayGroup.numChildren do objects[#objects+1] = {displayGroup[i].y, displayGroup[i]} end | |
table.sort( objects, function(a,b) return a[1]<b[1] end ) | |
for i=1,#objects do displayGroup:insert( objects[i][2] ) end | |
end |
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
function distance( x1, y1, x2, y2 ) | |
return math.sqrt( (x2-x1)^2 + (y2-y1)^2 ) | |
end |