How to control every point of cube(box) in 3x3 or 4x4

hi guys

I try transform 3D cube(box) every point in 3x3 or 4x4 matrix
idea is like this image

I need control every point position and know every line length
here is one way I think, is use lineTo from every point to another point
you guys maybe have better way to solve this question.

if you need more detail, please let me know
thank you!!!

found solution
use “ofVboMesh”
to “addVertex”
and “addIndex”
then “setVertex”
thank you all.