Um yeah.
Code:
struct Vertex
{
float x;
float y;
float z;
Vertex():x(0.0f),y(0.0f),z(0.0f) { }
};
Vertex *pVertices = new Vertex[500];
Vertex Vertex_array[500];
std::vector<Vertex *> ptrVertices;
std::vector<Vertex> Vertices;
How would you efficently create a 3-d matrix....
A 3D matrix as in a matrix used for 3D or do you want a 3D array? There is no efficient way to create and use a 3D array and you should not be doing it.
A 3D matrix is easy.
Code:
void BuildTranslationMatrix(float matrix[4][4],float dx,float dy,float dz)
{
float matrix[4][4];
matrix[0][0] = 0.0f;
matrix[0][1] = 0.0f;
matrix[0][2] = 0.0f;
matrix[0][3] = dx;
matrix[1][0] = 0.0f;
matrix[1][1] = 0.0f;
matrix[1][2] = 0.0f;
matrix[1][3] = dy;
matrix[2][0] = 0.0f;
matrix[2][1] = 0.0f;
matrix[2][2] = 0.0f;
matrix[2][3] = dz;
matrix[3][0] = 0.0f;
matrix[3][1] = 0.0f;
matrix[3][2] = 0.0f;
matrix[3][3] = 1.0f;
}
That is a translation matrix in Direct3D. I don't think that's what you wanted