Exemplo n.º 1
0
        public override void draw(Matrix4[] matriz, ColorShaderProgram colorShaderProgram)
        {
            Matrix4[] model;
            model = new Matrix4[] {
                Matrix4.Identity
            };
            model[0] = m[0] * matriz[0];

            //base.draw(model, colorShaderProgram);

            bindData(colorShaderProgram);
            GL.UniformMatrix4(colorShaderProgram.modelView, false, ref model[0]);
            GL.DrawElements(BeginMode.Triangles, indicedata.Length, DrawElementsType.UnsignedInt, 0);
        }
Exemplo n.º 2
0
        public Escenario()
        {
            String vertexCode   = TextResourceReader.readTextFileFromResource("../../shaders/vs.glsl");
            String fragmentCode = TextResourceReader.readTextFileFromResource("../../shaders/fs.glsl");

            colorShaderProgram = new ColorShaderProgram(vertexCode, fragmentCode);

            trasladar(-0.2f, 0.0f, 0.4f);


            robot = new Robot(0.2f, 0.2f, 0.5f, 0.4f, 0.2f, 0.4f, 0.3f, 0.2f, 0.7f, 0.7f, 0.2f, 0.4f, 0.3f, 0.7f, 0.2f, 0.4f);
            robot.trasladar(0, -1.5f, 0);
            robot.escalar(1.5f, 1.5f, 1.5f);

            addObjecto(robot, "Robot");
        }
Exemplo n.º 3
0
        public virtual void draw(Matrix4[] matriz, ColorShaderProgram colorShaderProgram)
        {
            Matrix4[] model;
            model = new Matrix4[] {
                Matrix4.Identity
            };
            model[0] = m[0] * matriz[0];

            Objeto objeto;

            foreach (KeyValuePair <string, Objeto> value in l)
            {
                objeto = value.Value;
                objeto.draw(model, colorShaderProgram);
            }
        }
Exemplo n.º 4
0
        public Escenario()
        {
            lista = new List <Objeto>();


            String vertexCode   = TextResourceReader.readTextFileFromResource("shaders/vs.glsl");
            String fragmentCode = TextResourceReader.readTextFileFromResource("shaders/fs.glsl");

            colorShaderProgram = new ColorShaderProgram(vertexCode, fragmentCode);

            mviewdata = new Matrix4[] {
                Matrix4.Identity
            };


            mesa  = new Mesa(1f, 0.75f, 1f);
            silla = new Silla(0.5f, 1f, 0.5f);
            robot = new Robot(0.5f, 1f, 0.5f);
            lista.Add(mesa);
            lista.Add(silla);
            lista.Add(robot);
        }
Exemplo n.º 5
0
 public void bindData(ColorShaderProgram colorShaderProgram)
 {
     this.colorShaderProgram = colorShaderProgram;
 }
Exemplo n.º 6
0
 public override void draw(Matrix4[] matriz, ColorShaderProgram colorShaderProgram)
 {
     base.draw(matriz, colorShaderProgram);
 }
Exemplo n.º 7
0
 private void bindData(ColorShaderProgram colorShaderProgram)
 {
     positionIndexArray.setVertexAttribPointer(vertdata, colorShaderProgram.vPosition);
     colorIndexArray.setVertexAttribPointer(coldata, colorShaderProgram.vColor);
 }