Esempio n. 1
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);
        }