void Awake()
    {
        //setup texture
        Texture2D tex = (Texture2D)Resources.Load("320x240ABGR", typeof(Texture2D));

        this._ss = new NyARUnitySensor(tex.width, tex.height);
        this._ss.update(tex);

        NyARMarkerSystemConfig config = new NyARMarkerSystemConfig(tex.width, tex.height);

        this._ms = new NyARUnityMarkerSystem(config);
        this._ms.setConfidenceThreshold(0.1);
        mid = this._ms.addARMarker("./Assets/Data/patt.hiro", 16, 25, 80);

        //setup background
        this._bg_panel = GameObject.Find("Plane");
        this._bg_panel.renderer.material.mainTexture = tex;
        this._ms.setARBackgroundTransform(this._bg_panel.transform);

        //setup camera projection
        this._ms.setARCameraProjection(this.camera);
    }
Пример #2
0
    void Awake()
    {
        //setup texture
        Texture2D tex = (Texture2D)Resources.Load("320x240ABGR", typeof(Texture2D));

        this._ss = new NyARUnitySensor(tex.width, tex.height);
        this._ss.update(tex);

        NyARMarkerSystemConfig config = new NyARMarkerSystemConfig(tex.width, tex.height);

        this._ms = new NyARUnityMarkerSystem(config);
        this._ms.setConfidenceThreshold(0.1);
        mid = this._ms.addARMarker(
            new MemoryStream(((TextAsset)Resources.Load("patt_hiro", typeof(TextAsset))).bytes),
            16, 25, 80);
        //setup background
        this._bg_panel = GameObject.Find("Plane");
        this._bg_panel.GetComponent <Renderer>().material.mainTexture = tex;
        this._ms.setARBackgroundTransform(this._bg_panel.transform);

        //setup camera projection
        this._ms.setARCameraProjection(this.GetComponent <Camera>());
    }