Ejemplo n.º 1
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);
        }
Ejemplo n.º 2
0
 public void translate(float _x, float _y, float _z)
 {
     meja.translate(_x, _y, _z);
     balok1.translate(_x, _y, _z);
     balok2.translate(_x, _y, _z);
     balok3.translate(_x, _y, _z);
     balok4.translate(_x, _y, _z);
     eliptic1.translate(_x, _y, _z);
     eliptic2.translate(_x, _y, _z);
     eliptic3.translate(_x, _y, _z);
     eliptic4.translate(_x, _y, _z);
     elip.translate(_x, _y, _z);
 }
Ejemplo n.º 3
0
 public void translate(float _x, float _y, float _z)
 {
     tulang.translate(_x, _y, _z);
     daging.translate(_x, _y, _z);
     tulangrawan1.translate(_x, _y, _z);
     tulangrawan2.translate(_x, _y, _z);
     tahu.translate(_x, _y, _z);
     putih.translate(_x, _y, _z);
     kuning.translate(_x, _y, _z);
     asap.translate(_x, _y, _z);
     asap1.translate(_x, _y, _z);
     asap2.translate(_x, _y, _z);
 }
Ejemplo 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);
        }