// Use this for initialization
    void Start()
    {
        devOrEmu = (DeviceOrEmulator) FindObjectOfType(typeof(DeviceOrEmulator));

        kinect = devOrEmu.getKinect();
        //tex = new Texture2D(640,480,TextureFormat.ARGB32,false);
        tex = new Texture2D(320,240,TextureFormat.ARGB32,false);
        renderer.material.mainTexture = tex;
    }
Exemplo n.º 2
0
 // Use this for initialization
 void Start()
 {
     GameObject obj = GameObject.Find ("KinectPrefab");
     devOrEmu = obj.GetComponent<DeviceOrEmulator> ();
     kinect = devOrEmu.getKinect();
     //tex = new Texture2D(640,480,TextureFormat.ARGB32,false);
     tex = new Texture2D(320,240,TextureFormat.ARGB32,false);
     GetComponent<Renderer>().material.mainTexture = tex;
 }
Exemplo n.º 3
0
    // Use this for initialization
    void Start()
    {
        GameObject obj = GameObject.Find ("KinectPrefab");
        DoE = obj.GetComponent<DeviceOrEmulator> ();
        working = DoE.useEmulator;

        obj = GameObject.Find("ColorImagePlane");
        dc = obj.GetComponent<DisplayColor> ();
        // kinect = DoE.getKinect();
        savepoint = 0;

        Constant.photos = new Color32[10][];
    }
Exemplo n.º 4
0
    void Start()
    {
        devOrEmu = GameObject.Find("KinectPrefab(Clone)").GetComponent <DeviceOrEmulator>();
        PointCloudSlowDistance = 6.0f;
        kinect = devOrEmu.getKinect();
        //	tex = new Texture2D(640,480,TextureFormat.ARGB32,false);
        tex = new Texture2D(80, 60, TextureFormat.ARGB32, false);
//		tex = new Texture2D(160, 120,TextureFormat.ARGB32, false);
//		tex = new Texture2D(80, 60,TextureFormat.ARGB32, false);
//		renderer.material.mainTexture = tex;
        thePixels         = new GameObject[length, width];
        originalPositions = new GameObject[length, width];
        numPixels         = length * width;
        //int middlePointx = 0;
        //int middlePointy = 0;
        for (int i = 0; i < length; i++)
        {
            for (int x = 0; x < width; x++)
            {
                thePixels[i, x]                          = (GameObject)GameObject.Instantiate(pointCloudPixel, new Vector3((float)-i / 4, (float)-x / 4, 0), Quaternion.identity);
                originalPositions[i, x]                  = (GameObject)GameObject.Instantiate(positionHolder, new Vector3((float)-i / 4, (float)-x / 4, 0), Quaternion.identity);
                thePixels[i, x].transform.parent         = PointCloudParent.transform;
                originalPositions[i, x].transform.parent = PointCloudParent.transform;
                thePixels[i, x].renderer.material.color  = Color.white;

                //		if(x == width/2 && i == length/2)
                //		{
                //			middlePointx = x;
                //			middlePointy = i;
                //		}
                //Add Particle System?
            }
        }
        PointCloudParent.transform.Rotate(new Vector3(0, 0, 90));
        //middlePoint = thePixels[middlePointx, middlePointy].transform.position;
    }
Exemplo n.º 5
0
    void Start()
    {
        devOrEmu = GameObject.Find ("KinectPrefab(Clone)").GetComponent<DeviceOrEmulator>();
        PointCloudSlowDistance = 6.0f;
        kinect = devOrEmu.getKinect();
        //	tex = new Texture2D(640,480,TextureFormat.ARGB32,false);
        tex = new Texture2D(80,60,TextureFormat.ARGB32,false);
        //		tex = new Texture2D(160, 120,TextureFormat.ARGB32, false);
        //		tex = new Texture2D(80, 60,TextureFormat.ARGB32, false);
        //		renderer.material.mainTexture = tex;
        thePixels = new GameObject[length, width];
        originalPositions = new GameObject[length, width];
        numPixels = length * width;
        //int middlePointx = 0;
        //int middlePointy = 0;
        for(int i = 0; i < length; i++)
        {
            for(int x = 0; x < width; x++)
            {
                thePixels[i,x] = (GameObject)GameObject.Instantiate (pointCloudPixel, new Vector3((float)-i/4, (float)-x/4, 0), Quaternion.identity);
                originalPositions[i,x] = (GameObject)GameObject.Instantiate (positionHolder, new Vector3((float)-i/4, (float)-x/4, 0), Quaternion.identity);
                thePixels[i,x].transform.parent = PointCloudParent.transform;
                originalPositions[i,x].transform.parent = PointCloudParent.transform;
                thePixels[i,x].renderer.material.color = Color.white;

        //		if(x == width/2 && i == length/2)
        //		{
        //			middlePointx = x;
        //			middlePointy = i;
        //		}
                //Add Particle System?
            }
        }
        PointCloudParent.transform.Rotate (new Vector3(0,0,90));
        //middlePoint = thePixels[middlePointx, middlePointy].transform.position;
    }