So I made my own class in order to hold a 3D vertex. That basically looks like:
class Vertex // Vertex Class
{
public:
float x; // X Component
float y; // Y Component
float z; // Z Component
float getX() {
return x;
}
float getY() {
return y;
}
float getZ() {
return z;
}
};
Now I need to make a 2D array of these but when I initialize it it won't work. Basically each row will be a face of a polygon. And each column will contain a vertex of that row. So if one row is
(0,0,0) (1, 1, 1) (3, 3, 3) (4,4,4);
Then that row will represent a face with vertices (0,0,0) (1, 1, 1) (3, 3, 3) (4,4,4);
Now when I try to initialize it using
Vertex faces = new Vertex[num_faces][4];
It work work. This seems pretty simple so what am I doing wrong?
EDIT: I changed it to
Vertex *faces = new Vertex[num_faces][4];
and I get this error:
cannot convert from 'Vertex (*)[4]' to 'Vertex *'