Esempio n. 1
0
 // private string DllName;
 public TRenderer()
 {
     // DllName = "TPhysic";
     objlist = new ArrayList();
     volumes = new VolumeManager();
     //doplist = new ArrayList();
     //
     light_visible = true;
     collisions_det = true;
     // posizione di default della camera
     viewsphere = new Trackball(10.0f);
     viewsphere.CartesianCoords = new float[3] { 0.0f, 0.0f, 10.0f };
     //
     lightsphere = new Trackball(4.0f, 3.0f, 0.0f);
     //
     fovy = 30.0f;
     //fov_sin = 0.258819f;
     wall_w = 9.0f;
     wall_h = 7.0f;
     bgcolor = new float[4] { 0.85f, 0.85f, 0.9f, 1.0f };
 }
Esempio n. 2
0
        public void SetTexture(int object_id, Bitmap bmp)
        {
            if(object_id < 0 || object_id >= objlist.Count) {
                object_id = 0;
            }
            if(object_id == 0) {
                // Image Based Lighting
                LightRecon lr = new LightRecon(bmp, wall_w, wall_h);
                lr.Recon();
                lr.Test();
                lightsphere = new Trackball(lr.Lposition[0], lr.Lposition[1], lr.Lposition[2]);

                light.Move(lightsphere.CartesianCoords);
                light.RefreshAmbient(lr.GetAmbientHue());

                Display();
            }
            ((Renderable)objlist[object_id]).SetTexture(bmp);
        }