예제 #1
0
        private void button3DView_Click(object sender, EventArgs e)
        {
            GraphicsWindow.Width  = 500;
            GraphicsWindow.Height = 500;
            //GraphicsWindow.BackgroundColor = "Red";
            Primitive view3D  = LD3DView.AddView(500, 500, "False");
            Primitive points  = "-0.5: -0.5: 0.5 0.5: -0.5: 0.5 0.5: 0.5: 0.5 0.5: 0.5: 0.5 -0.5: 0.5: 0.5 -0.5: -0.5: 0.5";
            Primitive indices = "0 2 1 3 5 4";
            Primitive geom    = LD3DView.AddGeometry(view3D, points, indices, "", "White", "D");

            LD3DView.ReverseNormals(view3D, geom);
            LD3DView.ResetCamera(view3D, 0, 0, 2, 0, 0, -1, 0, 1, 0);
            //LD3DView.AddDirectionalLight(view3D,"White",0,0,-1);
            LD3DView.AddSpotLight(view3D, "Red", 0, 0, 10, 0, 0, -1, 20, 100);
            //LD3DView.Freeze(view3D,geom);
            //LD3DView.RotateGeometry(view3D, geom, 0, 0, 1, 45);
            LD3DView.AnimateRotation(view3D, geom, 0, 0, 1, 0, 360, 1, 1);
            LD3DView.LoadModel(view3D, "C:\\temp\\room.3ds");
        }
예제 #2
0
        private void buttonUnits_Click(object sender, EventArgs e)
        {
            Primitive aa = LDMath.Rotate(0, 0, 0, -100, 180);

            Primitive view = LD3DView.AddView(500, 500, "True");

            LD3DView.ResetCamera(view, 0, 0, -20, 0, 0, 1, 0, 1, 0);
            LD3DView.AddDirectionalLight(view, "Red", 1, 0, 1);
            LD3DView.AddDirectionalLight(view, "Green", 1, 0, -1);
            LD3DView.AddDirectionalLight(view, "Blue", -1, 0, 1);
            LD3DView.AddDirectionalLight(view, "Yellow", -1, 0, -1);
            Primitive cube = LD3DView.AddCube(view, 1, "Red", "D");

            LD3DView.SetBillBoard(view, cube);
            for (int i = 1; i < 100; i++)
            {
                LD3DView.MoveCamera(view, i, 1, 1, 1);
            }

            //Primitive button = Microsoft.SmallBasic.Library.Controls.AddButton("Test", 50, 50);
            //LDControls.SetButtonStyle(button, "Red", "Blue", "Green", "Black", "Black", "Black", 9, "True");

            //GraphicsWindow.Width = 200;
            //GraphicsWindow.Height = 200;
            //Primitive title = "";
            //for (int i = 1; i <= 20; i++)
            //{
            //    title[i] = "TEST" + i;
            //}
            //Primitive dv = LDControls.AddDataView(200, 200, title);
            //Primitive row = "";
            //for (int i = 1; i <= 20; i++)
            //{
            //    for (int j = 1; j <= 20; j++)
            //    {
            //        row[j] = Microsoft.SmallBasic.Library.Math.GetRandomNumber(1000000);
            //    }
            //    LDControls.DataViewSetRow(dv, i, row);
            //}

            //UnitSystem unitSystem = new UnitSystem();
            //double[] values = new double[22];
            //int i = 0;
            //values[i++] = unitSystem.Convert(1, "[D.ft/cP.psi]+[ft3/day]", "ft3/day");
            //values[i++] = unitSystem.Convert(1, "mu0.e0", "1/c2");
            //values[i++] = unitSystem.Convert(1, "RC", "J/K/mol");
            //values[i++] = unitSystem.Convert(1, "eQ", "Q");
            //values[i++] = unitSystem.Convert(6, "min/mile", "min/Km");
            //values[i++] = unitSystem.Convert(9.81, "m/s2", "ft/s2");
            //values[i++] = unitSystem.Convert(1, "Avagadro.M.l", "1");
            //values[i++] = unitSystem.Convert(1, "D.ft/cP.psi", "ft3/day");
            //values[i++] = unitSystem.Convert(1, "psi+(14.69)", "psig");
            //values[i++] = unitSystem.Convert(1, "Kilo.ft3/day", "ft3/day");
            //values[i++] = unitSystem.Convert(1, "m(-1)", "1/in");
            //values[i++] = unitSystem.Convert(1, "Kg/min2", "g/hr2");
            //values[i++] = unitSystem.Convert(1, "mm", "m");
            //values[i++] = unitSystem.Convert(1, "1/cN2", "1/N2");
            //values[i++] = unitSystem.Convert(1, "pi.KJ", "N.m");
            //values[i++] = unitSystem.Convert(100, "mC", "F");
            //values[i++] = unitSystem.Convert(1, "BTU2", "J2");
            //values[i++] = unitSystem.Convert(1, "ton", "tonne");
            //values[i++] = unitSystem.Convert(1, "W", "Volt.Amp");
            //values[i++] = unitSystem.Convert(1, "psi", "lbf/in2");
            //values[i++] = unitSystem.Convert(1, "Kpsig", "Kpsi");
            //values[i++] = unitSystem.Convert(1, "USD", "GBP");
        }