Esempio n. 1
0
        public void buildObject()
        {
            GL.ClearColor(0.2f, 0.3f, 0.3f, 1.0f);

            meja.setStartPoint(0.0f, 0.0f, -0.25f);
            meja.setLength(0.03f);
            meja.createTubeVertices(0.8f, 0.8f);
            meja.setupObject("C:/Users/Asus/source/repos/shader/shader.vert",
                             "C:/Users/Asus/source/repos/shader/shader_tumpuan.frag");
            meja.rotate(90.0f, 0.0f, 0.0f);

            balok1.setStartPoint(-0.5f, -0.27f, 0.0f);
            balok1.createBoxVertices(0.1f, 0.1f, 0.5f);
            balok1.setupObject("C:/Users/Asus/source/repos/shader/shader.vert",
                               "C:/Users/Asus/source/repos/shader/pot.frag");

            balok2.setStartPoint(0.5f, -0.27f, 0.0f);
            balok2.createBoxVertices(0.1f, 0.1f, 0.5f);
            balok2.setupObject("C:/Users/Asus/source/repos/shader/shader.vert",
                               "C:/Users/Asus/source/repos/shader/pot.frag");

            balok3.setStartPoint(0.0f, -0.27f, 0.5f);
            balok3.createBoxVertices(0.1f, 0.1f, 0.5f);
            balok3.setupObject("C:/Users/Asus/source/repos/shader/shader.vert",
                               "C:/Users/Asus/source/repos/shader/pot.frag");

            balok4.setStartPoint(0.0f, -0.27f, -0.5f);
            balok4.createBoxVertices(0.1f, 0.1f, 0.5f);
            balok4.setupObject("C:/Users/Asus/source/repos/shader/shader.vert",
                               "C:/Users/Asus/source/repos/shader/pot.frag");

            eliptic1.setStartPoint(-0.5f, 0.09f, 0.09f);
            eliptic1.createElipticParaboloidVertices(0.05f, 0.05f, 0.05f);
            eliptic1.setupObject("C:/Users/Asus/source/repos/shader/shader.vert",
                                 "C:/Users/Asus/source/repos/shader/shader_tumpukecil.frag");
            eliptic1.rotate(270.0f, 0.0f, 10.0f);

            eliptic2.setStartPoint(0.5f, -0.09f, 0.09f);
            eliptic2.createElipticParaboloidVertices(0.05f, 0.05f, 0.05f);
            eliptic2.setupObject("C:/Users/Asus/source/repos/shader/shader.vert",
                                 "C:/Users/Asus/source/repos/shader/shader_tumpukecil.frag");
            eliptic2.rotate(270.0f, 0.0f, 10.0f);

            eliptic3.setStartPoint(0.09f, 0.5f, 0.09f);
            eliptic3.createElipticParaboloidVertices(0.05f, 0.05f, 0.05f);
            eliptic3.setupObject("C:/Users/Asus/source/repos/shader/shader.vert",
                                 "C:/Users/Asus/source/repos/shader/shader_tumpukecil.frag");
            eliptic3.rotate(270.0f, 0.0f, 10.0f);

            eliptic4.setStartPoint(-0.09f, -0.5f, 0.09f);
            eliptic4.createElipticParaboloidVertices(0.05f, 0.05f, 0.05f);
            eliptic4.setupObject("C:/Users/Asus/source/repos/shader/shader.vert",
                                 "C:/Users/Asus/source/repos/shader/shader_tumpukecil.frag");
            eliptic4.rotate(270.0f, 0.0f, 10.0f);

            elip.setStartPoint(0.0f, 0.03f, 0.0f);
            elip.createEllipsVertices(0.7f, 0.1f, 0.1f);
            elip.setupObject("C:/Users/Asus/source/repos/shader/shader.vert",
                             "C:/Users/Asus/source/repos/shader/shader_tumpuan.frag");
        }
Esempio n. 2
0
        public void buildObject()
        {
            pot.setStartPoint(0.0f, -0.4f, 0.0f);
            pot.createBoxVertices(0.2f, 0.2f, 0.35f);
            pot.setupObject("C:/Users/Asus/source/repos/shader/trans.vert",
                            "C:/Users/Asus/source/repos/shader/pot.frag");

            batang.setLength(0.35f);
            batang.createTubeVertices(0.015f, 0.015f);
            batang.setupObject("C:/Users/Asus/source/repos/shader/trans.vert",
                               "C:/Users/Asus/source/repos/shader/hijauDaun.frag");
            batang.rotate(90.0f, 0.0f, 0.0f);
            batang.translate(-0.015f, 0.0f, 0.0f);

            putik.setStartPoint(0.0f, 0.55f, 0.0f);
            putik.createEllipsVertices(0.2f, 0.05f);
            putik.setupObject("C:/Users/Asus/source/repos/shader/trans.vert",
                              "C:/Users/Asus/source/repos/shader/putik.frag");
            putik.rotate(40.0f, 0.0f, 0.0f);
            putik.translate(0.0f, 0.15f, -0.35f);

            daun1.setStartPoint(-0.1f, 0.0f, 0.0f);
            daun1.createEllipsVertices(0.12f, 0.01f, 0.04f);
            daun1.setupObject("C:/Users/Asus/source/repos/shader/trans.vert",
                              "C:/Users/Asus/source/repos/shader/hijauDaun.frag");
            daun1.rotate(-10.0f, 0.0f, -10.0f); daun1.translate(-0.025f, 0.19f, 0.0f);

            daun2.setStartPoint(0.1f, 0.0f, 0.0f);
            daun2.createEllipsVertices(0.12f, 0.01f, 0.04f);
            daun2.setupObject("C:/Users/Asus/source/repos/shader/trans.vert",
                              "C:/Users/Asus/source/repos/shader/hijauDaun.frag");
            daun2.rotate(-10.0f, 0.0f, 10.0f); daun2.translate(0.01f, 0.05f, 0.0f);

            for (int i = 0; i < 6; i++)
            {
                petal[i] = new Ellipsoid();
                petal[i].createEllipsVertices(0.13f, 0.02f);
                petal[i].setupObject("C:/Users/Asus/source/repos/shader/trans.vert",
                                     "C:/Users/Asus/source/repos/shader/petal.frag");
                petal[i].rotate(90.0f, 0.0f, 0.0f);
                petal[i].translate(0.0f, 0.25f, 0.0f);
                petal[i].rotate(-50.0f, 0.0f, (float)i * 60.0f);
                petal[i].translate(0.0f, 0.55f, 0.0f);
            }

            for (int i = 0; i < 3; i++)
            {
                suket[i] = new Branch();
                suket[i].addPoint(0.0f, 0.0f, 0.0f); suket[i].addPoint(0.15f, 0.2f, 0.0f); suket[i].addPoint(0.4f, 0.27f, 0.0f);
                suket[i].createbezierVertices();
                suket[i].setupObject("C:/Users/Asus/source/repos/shader/trans.vert",
                                     "C:/Users/Asus/source/repos/shader/hijauDaun.frag");
            }
            suket[0].rotate(0.0f, 0.0f, 20.0f); suket[0].translate(0.0f, -0.3f, 0.0f);
            suket[1].rotate(0.0f, 130.0f, 45.0f); suket[1].translate(-0.05f, -0.5f, 0.0f);
            suket[2].rotate(0.0f, -60.0f, 30.0f); suket[2].translate(0.0f, -0.4f, 0.0f);
        }
Esempio n. 3
0
 public void rotate(float _x, float _y, float _z)
 {
     tulang.rotate(_x, _y, _z);
     daging.rotate(_x, _y, _z);
     tulangrawan1.rotate(_x, _y, _z);
     tulangrawan2.rotate(_x, _y, _z);
     tahu.rotate(_x, _y, _z);
     putih.rotate(_x, _y, _z);
     kuning.rotate(_x, _y, _z);
     asap.rotate(_x, _y, _z);
     asap1.rotate(_x, _y, _z);
     asap2.rotate(_x, _y, _z);
 }
Esempio n. 4
0
        public void buildObject()
        {
            //sendok
            batangsendok.setLength(0.155f);
            batangsendok.createTubeVertices(0.015f, 0.015f);
            batangsendok.setupObject("C:/Users/Asus/source/repos/shader/shader.vert",
                                     "C:/Users/Asus/source/repos/shader/white.frag");
            batangsendok.rotate(90.0f, 0.0f, 0.0f);
            batangsendok.translate(-0.015f, -0.13f, 0.0f);


            sendok.createEllipsVertices(0.12f, 0.02f, 0.05f);
            sendok.setupObject("C:/Users/Asus/source/repos/shader/shader.vert",
                               "C:/Users/Asus/source/repos/shader/white.frag");
            sendok.rotate(0.0f, 0.0f, -90.0f); sendok.translate(0.0f, 0.2f, 0.0f);

            batangsendok.addChild(sendok);

            //garpu
            for (int i = 0; i < 4; i++)
            {
                batanggarpu[i] = new Tube();
                if (i == 0)
                {
                    batanggarpu[i].setLength(0.185f);
                    batanggarpu[i].createTubeVertices(0.02f, 0.015f);
                    batanggarpu[i].setupObject("C:/Users/Asus/source/repos/shader/shader.vert",
                                               "C:/Users/Asus/source/repos/shader/white.frag");
                    batanggarpu[i].rotate(90.0f, 0.0f, 0.0f);
                    batanggarpu[i].translate(0.0f, -0.2f, 0.0f);
                }
                else if (i == 1)
                {
                    batanggarpu[i].setLength(0.065f);
                    batanggarpu[i].createTubeVertices(0.015f, 0.015f);
                    batanggarpu[i].setupObject("C:/Users/Asus/source/repos/shader/shader.vert",
                                               "C:/Users/Asus/source/repos/shader/white.frag");
                    batanggarpu[i].rotate(90.0f, 0.0f, 0.0f);
                    batanggarpu[i].translate(-0.1f, 0.3f, 0.0f);
                }
                else if (i == 2)
                {
                    batanggarpu[i].setLength(0.065f);
                    batanggarpu[i].createTubeVertices(0.015f, 0.015f);
                    batanggarpu[i].setupObject("C:/Users/Asus/source/repos/shader/shader.vert",
                                               "C:/Users/Asus/source/repos/shader/white.frag");
                    batanggarpu[i].rotate(90.0f, 0.0f, 0.0f);
                    batanggarpu[i].translate(0.0f, 0.3f, 0.0f);
                }
                else if (i == 3)
                {
                    batanggarpu[i].setLength(0.065f);
                    batanggarpu[i].createTubeVertices(0.015f, 0.015f);
                    batanggarpu[i].setupObject("C:/Users/Asus/source/repos/shader/shader.vert",
                                               "C:/Users/Asus/source/repos/shader/white.frag");
                    batanggarpu[i].rotate(90.0f, 0.0f, 0.0f);
                    batanggarpu[i].translate(0.1f, 0.3f, 0.0f);
                }
            }
            //kotakgarpu.setStartPoint(0.0f, 0.175f, 0.0f);
            kotakgarpu.createConeVertices(0.0760f, 0.015f, 0.06f);
            kotakgarpu.setupObject("C:/Users/Asus/source/repos/shader/shader.vert",
                                   "C:/Users/Asus/source/repos/shader/white.frag");
            kotakgarpu.rotate(-90.0f, 0.0f, 0.0f);
            kotakgarpu.translate(0.0f, 0.05f, 0.0f);
            for (int i = 0; i < 4; i++)
            {
                kotakgarpu.addChild(batanggarpu[i]);
            }

            //piring
            tengahpiring.createConeVertices(0.225f, 0.225f, 0.04f);
            tengahpiring.setupObject("C:/Users/Asus/source/repos/shader/shader.vert",
                                     "C:/Users/Asus/source/repos/shader/putik.frag");
            tengahpiring.rotate(0.0f, 0.0f, 0.0f);
            tengahpiring.translate(0.0f, 0.0f, 0.005f);

            bawahpiring.createConeVertices(0.3f, 0.3f, 0.06f);
            bawahpiring.setupObject("C:/Users/Asus/source/repos/shader/shader.vert",
                                    "C:/Users/Asus/source/repos/shader/black.frag");
            bawahpiring.addChild(tengahpiring);

            //gelas
            gelasatas.createConeVertices(0.125f, 0.125f, 0.15f);
            gelasatas.setupObject("C:/Users/Asus/source/repos/shader/shader.vert",
                                  "C:/Users/Asus/source/repos/shader/white.frag");
            gelasatas.rotate(270.0f, 0.0f, 0.0f);
            gelasatas.translate(0.0f, 0.0f, 0.0f);

            batanggelas.setLength(0.085f);
            batanggelas.createTubeVertices(0.015f, 0.015f);
            batanggelas.setupObject("C:/Users/Asus/source/repos/shader/shader.vert",
                                    "C:/Users/Asus/source/repos/shader/white.frag");
            batanggelas.rotate(90.0f, 0.0f, 0.0f);
            batanggelas.translate(0.0f, -0.11f, 0.0f);

            bawahgelas.createEllipsVertices(0.1f, 0.01f);
            bawahgelas.setupObject("C:/Users/Asus/source/repos/shader/shader.vert",
                                   "C:/Users/Asus/source/repos/shader/white.frag");
            bawahgelas.rotate(0.5f, 0.0f, 0.0f);
            bawahgelas.translate(0.0f, -0.25f, 0.0f);

            gelasatas.addChild(batanggelas);
            gelasatas.addChild(bawahgelas);

            //sedotan
            sedotan.addPoint(0.0f, 0.0f, 0.0f);
            sedotan.addPoint(0.225f, 0.9f, 0.0f);
            sedotan.addPoint(0.4f, 0.55f, 0.0f);
            sedotan.createbezierVertices(0.01f, 0.01f, 0.006f);
            sedotan.setupObject("C:/Users/Asus/source/repos/shader/shader.vert",
                                "C:/Users/Asus/source/repos/shader/white.frag");

            bawahpiring.rotate(-90.0f, 0.0f, 0.0f);
            gelasatas.translate(0.72f, 0.27f, 0.3f);
            kotakgarpu.rotate(90.0f, 0.0f, 0.0f); kotakgarpu.scale(0.75f); kotakgarpu.translate(-0.72f, 0.05f, 0.0f);
            batangsendok.rotate(90.0f, 90.0f, 0.0f); batangsendok.translate(-0.96f, 0.05f, 0.0f);
            sedotan.translate(0.72f, 0.27f, 0.3f);
        }
Esempio n. 5
0
        public void buildObject()
        {
            tulang.setStartPoint(-0.5f, 0.2f, 0.0f);
            tulang.setLength(0.27f);
            tulang.createTubeVertices(0.07f, 0.07f);
            tulang.setupObject("C:/Users/Asus/source/repos/shader/trans.vert",
                               "C:/Users/Asus/source/repos/shader/white.frag");

            daging.setStartPoint(-0.5f, 0.2f, 0.4f);
            daging.createEllipsVertices(0.3f, 0.3f, -0.12f);
            daging.setupObject("C:/Users/Asus/source/repos/shader/trans.vert",
                               "C:/Users/Asus/source/repos/shader/daging.frag");

            tulangrawan1.setStartPoint(-0.55f, 0.2f, -0.4f);
            tulangrawan1.createEllipsVertices(0.09f, 0.09f, 0f);
            tulangrawan1.setupObject("C:/Users/Asus/source/repos/shader/trans.vert",
                                     "C:/Users/Asus/source/repos/shader/white.frag");

            tulangrawan2.setStartPoint(-0.45f, 0.2f, -0.4f);
            tulangrawan2.createEllipsVertices(0.09f, 0.09f, 0f);
            tulangrawan2.setupObject("C:/Users/Asus/source/repos/shader/trans.vert",
                                     "C:/Users/Asus/source/repos/shader/white.frag");

            tahu.setStartPoint(0.2f, 0.0f, 0.7f);
            tahu.createBoxVertices(0.2f, 0.3f, 0.1f);
            tahu.setupObject("C:/Users/Asus/source/repos/shader/trans.vert",
                             "C:/Users/Asus/source/repos/shader/kuning.frag");

            kuning.setStartPoint(0.3f, 0f, 0f);
            kuning.createEllipsVertices(0.2f, 0.1f, 0.02f);
            kuning.setupObject("C:/Users/Asus/source/repos/shader/trans.vert",
                               "C:/Users/Asus/source/repos/shader/kuning.frag");

            putih.setStartPoint(0.3f, 0f, 0f);
            putih.setLength(0.02f);
            putih.createTubeVertices(0.5f, 0.5f);
            putih.setupObject("C:/Users/Asus/source/repos/shader/trans.vert",
                              "C:/Users/Asus/source/repos/shader/white.frag");
            putih.rotate(90f, 0f, 0f);

            asap.addPoint(-0.1f, 0f, 0f);
            asap.addPoint(0.3f, 0.2f, 0f);
            asap.addPoint(-0.5f, 0.4f, 0f);
            asap.addPoint(0.2f, 0.5f, 0f);
            asap.createbezierVertices();
            asap.setupObject("C:/Users/Asus/source/repos/shader/trans.vert",
                             "C:/Users/Asus/source/repos/shader/grey.frag");
            asap.translate(0.1f, 0.3f, 0.3f);

            asap1.addPoint(-0.1f, 0f, 0f);
            asap1.addPoint(0.3f, 0.2f, 0f);
            asap1.addPoint(-0.5f, 0.4f, 0f);
            asap1.addPoint(0.2f, 0.53f, 0f);
            asap1.createbezierVertices();
            asap1.setupObject("C:/Users/Asus/source/repos/shader/trans.vert",
                              "C:/Users/Asus/source/repos/shader/grey.frag");
            asap1.translate(0f, 0.3f, 0.3f);

            asap2.addPoint(-0.1f, 0f, 0f);
            asap2.addPoint(0.3f, 0.2f, 0f);
            asap2.addPoint(-0.5f, 0.4f, 0f);
            asap2.addPoint(0.2f, 0.56f, 0f);
            asap2.createbezierVertices();
            asap2.setupObject("C:/Users/Asus/source/repos/shader/trans.vert",
                              "C:/Users/Asus/source/repos/shader/grey.frag");
            asap2.translate(-0.1f, 0.3f, 0.3f);
        }