Esempio n. 1
0
 public void Render(int modelUniformIndex)
 {
     Matrix4.CreateTranslation(ref this.Position, out t);
     Matrix4.CreateRotationX(this.Position.Z, out rotX);
     Matrix4.CreateRotationZ(this.Position.X, out rotZ);
     Matrix4.Mult(ref t, ref rotX, out modelMatrix);
     Matrix4.Mult(ref rotZ, ref modelMatrix, out modelMatrix);
     this.model.Bind();
     GL.UniformMatrix4(modelUniformIndex, true, ref modelMatrix);
     model.Render();
 }
Esempio n. 2
0
        public void Render(int modelUniformIndex)
        {
            UpdatePosition();
            float radius = Sphere.Radius;

            Matrix4.CreateTranslation(ref Position, out positionMatrix);
            Matrix4.CreateScale(radius, out scaleMatrix);
            Matrix4.Mult(ref rot, ref scaleMatrix, out modelMatrix);
            Matrix4.Mult(ref modelMatrix, ref positionMatrix, out modelMatrix);
            this.model.Bind();
            GL.UniformMatrix4(modelUniformIndex, true, ref modelMatrix);
            model.Render();
        }