Dear David, you can simply try to compute each term of the matrix by the definition of the members of the stiffness matrix; in brief, for each row consider one change in the corresponding degree of freedom and no change in the other degrees of freedom.The forces/moments needed to cause these changes will be members of the stiffness matrix at that row. (Meanwhile the matrix is symmetric.) You can also compute the flexibility matrix and then inverse it. This a simple discussion addressed in almost all textbooks. By finding a textbook on matrix analysis of structures (old or new) you can find all the details plus examples. Have a nice time and future. Aram.
A similar case is considered by K.-J. Bathe in his book "Finite element procedures in engineering analysis", p. 151, Example 4.12. You only have to rotate his picture (see attached sketch). I suppose that difference of integrals over painted regions will introduce a small error in stiffness matrix.