Exemplo n.º 1
0
        public SimpleLiteD3d(NyARToolkitCS topLevelForm, ResourceBuilder i_resource)
        {
            NyMath.initialize();
            this._capture = i_resource.createWmCapture();
            this._capture.setOnSample(this);

            this._d3dmgr = i_resource.createD3dManager(topLevelForm);
            this._back_ground = i_resource.createBackGround(this._d3dmgr);
            this._d3dcube = new ColorCube(this._d3dmgr.d3d_device,40);


            //AR用のパターンコードを読み出
            NyARCode code = i_resource.createNyARCode();
            //ARラスタを作る(DirectShowキャプチャ仕様)。
            this.m_raster = i_resource.createARRaster();

            //1パターンのみを追跡するクラスを作成
            this.m_ar = new NyARSingleDetectMarker(i_resource.ar_param, code, 80.0, this.m_raster.getBufferType());
            //計算モードの設定
            this.m_ar.setContinueMode(false);

            ////立方体(頂点数8)の準備


            return;
        }
Exemplo n.º 2
0
        public SimpleLiteD3d(NyARToolkitCS topLevelForm, ResourceBuilder i_resource)
        {
            NyMath.initialize();
            this._capture = i_resource.createWmCapture();
            this._capture.setOnSample(this);

            this._d3dmgr      = i_resource.createD3dManager(topLevelForm);
            this._back_ground = i_resource.createBackGround(this._d3dmgr);
            this._d3dcube     = new ColorCube(this._d3dmgr.d3d_device, 40);


            //AR用のパターンコードを読み出
            NyARCode code = i_resource.createNyARCode();

            //ARラスタを作る(DirectShowキャプチャ仕様)。
            this.m_raster = i_resource.createARRaster();

            //1パターンのみを追跡するクラスを作成
            this.m_ar = new NyARSingleDetectMarker(i_resource.ar_param, code, 80.0, this.m_raster.getBufferType());
            //計算モードの設定
            this.m_ar.setContinueMode(false);

            ////立方体(頂点数8)の準備


            return;
        }
Exemplo n.º 3
0
        public D3dManager createD3dManager(Form i_form)
        {
            D3dManager result;
            result=new D3dManager(i_form, this._ar_param, -1);
            Matrix tmp = new Matrix();
            NyARD3dUtil.toCameraFrustumRH(this._ar_param,10,10000,ref tmp);
            result.d3d_device.Transform.Projection = tmp;
            return result;

        }
Exemplo n.º 4
0
 public ID3dBackground createBackGround(D3dManager i_d3dmgr)
 {
     switch(this._background_type){
         case BGMODE_SURFACE:
             return new D3dSurfaceBackground(i_d3dmgr.d3d_device, i_d3dmgr.background_size.Width,i_d3dmgr.background_size.Height);
         case BGMODE_TEXTURE:
             return new D3dTextureBackground(i_d3dmgr.d3d_device, i_d3dmgr.background_size.Width, i_d3dmgr.background_size.Height,i_d3dmgr.scale);
         default:
             throw new Exception("unknown this._background_type");
     }
 }
Exemplo n.º 5
0
        public D3dManager createD3dManager(Form i_form)
        {
            D3dManager result;

            result = new D3dManager(i_form, this._ar_param, -1);
            Matrix tmp = new Matrix();

            NyARD3dUtil.toCameraFrustumRH(this._ar_param, 10, 10000, ref tmp);
            result.d3d_device.Transform.Projection = tmp;
            return(result);
        }
Exemplo n.º 6
0
        public ID3dBackground createBackGround(D3dManager i_d3dmgr)
        {
            switch (this._background_type)
            {
            case BGMODE_SURFACE:
                return(new D3dSurfaceBackground(i_d3dmgr.d3d_device, i_d3dmgr.background_size.Width, i_d3dmgr.background_size.Height));

            case BGMODE_TEXTURE:
                return(new D3dTextureBackground(i_d3dmgr.d3d_device, i_d3dmgr.background_size.Width, i_d3dmgr.background_size.Height, i_d3dmgr.scale));

            default:
                throw new Exception("unknown this._background_type");
            }
        }