private void Render() { _transform *= Mat4F.Rotation(1, new Vec3 <float>(0.0f, 0.0f, 1.0f)); _root.Transform = _transform; Gl.ClearColor(0.2f, 0.3f, 0.3f, 1.0f); Gl.Clear(Gl.ColorBufferBit); _root.Render(); }
public Vrc() { Va = Inject(new VertexArray()); Frames = Inject(new VrcFrames(new Vec2 <int>(600, 600))); _mvp = new List <Mat4F> { Mat4F.Identity() }; _matrix = Inject(new DataBuffer()); CommonBuffer = Inject(new DataBuffer()); Va.EnableAttrib(0); // Position attribute Va.AttribBinding(0, 0); Va.AttribFormat(0, 2, Gl.Float, false, 0); _matrix.Data(_mvp.Last().Data, Gl.StreamDraw); }
public void PushMatrix(Mat4F matrix) => _mvp.Add(_mvp.Last() * matrix);