Generating a dynamic 3D matrix
I need to generate dynamically a 3D matrix like this:
float vCube[8][3] = {
{1.0f, -1.0f, -1.0f}, {1.0f, -1.0f, 1.0f},
{-1.0f, -1.0f, 1.0f}, {-1.0f, -1.0f, -1.0f},
{1.0f, -1.0f, -1.0f}, {1.0f, 1.0f, 1.0f},
{-1.0f, 1.0f, 1.0f}, {-1.0f, 1.0f, -1.0f}
};
I mean, to take a value and put it inside the matrix on running time. I
tried to make a pointer to float, then adding 3D elements by new, but the
results were not what I want.
Note that I don't want to use STL like vector and so on, just a plane matrix.
No comments:
Post a Comment