31 double maxY,
double minZ,
double maxZ,
bool oneMesh) {
32 assert((minX <= maxX) && (minY <= maxY) && (minZ <= maxZ));
35 double coordinateArray[] = { minX,minY,minZ,
59 double* endOfCoordinateArray = coordinateArray +
sizeof(coordinateArray)/
sizeof(
double);
60 unsigned int indexArray[] = { 0,1,2,3,
66 unsigned int* endOfIndexArray = indexArray +
sizeof(indexArray)/
sizeof(
int);
67 double normalArray[] = { 0,0,-1, 0,0,-1, 0,0,-1, 0,0,-1,
68 0,0,1, 0,0,1, 0,0,1, 0,0,1,
69 -1,0,0, -1,0,0, 1,0,0, 1,0,0,
70 -1,0,0, -1,0,0, 1,0,0, 1,0,0,
71 0,-1,0, 0,1,0, 0,1,0, 0,-1,0,
72 0,-1,0, 0,1,0, 0,1,0, 0,-1,0 };
73 double* endOfNormalArray = normalArray +
sizeof(normalArray)/
sizeof(
double);
74 float textArray[] = { 1,0,0, 1,1,0, 0,1,0, 0,0,0,
75 0,0,0, 0,1,0, 1,1,0, 1,0,0,
76 0,0,0, 0,1,0, 1,1,0, 1,0,0,
77 1,0,0, 1,1,0, 0,1,0, 0,0,0,
78 0,0,0, 0,1,0, 1,1,0, 1,0,0,
79 0,1,0, 0,0,0, 1,0,0, 1,1,0 };
80 float* endOfTextArray = textArray +
sizeof(textArray)/
sizeof(
float);
86 vertCoordVec.assign(coordinateArray,endOfCoordinateArray);
87 normCoordVec.assign(normalArray,endOfNormalArray);
88 textCoordVec.assign(textArray,endOfTextArray);
92 mesh.
indexVec.assign(indexArray,endOfIndexArray);
94 meshList.push_back(mesh);
97 unsigned int* index = indexArray;
98 for(
int i = 0 ; i < 6 ; ++i, index += 4){
101 mesh.
indexVec.assign(index, index + 4);
103 meshList.push_back(mesh);
107 ComputeBoundingBox();
108 ComputeRecursiveBoundingBox();
121 if ((numberFace >= 0) && (numberFace <= 5)) {
122 list<VART::Mesh>::iterator iter = meshList.begin();
123 for (
int i = 0 ; i < numberFace; ++iter, ++i);
125 iter->material = mat;
127 else if (numberFace == 6)
128 this->SetMaterial(mat);
Header file for V-ART class "Mesh".
static const Material & DARK_PLASTIC_GRAY()
Header file for V-ART class "File".
A mesh is part of an graphical object, in which faces are made of vertices according to some rule of ...
Box()
Creates an uninitialized box.
void MakeBox(double minX, double maxX, double minY, double maxY, double minZ, double maxZ, bool oneMesh=true)
Creates a box aligned with the 3 reference planes (XY, XZ and YZ).
Header file for V-ART class "Box".
Material properties for graphical objects.
std::vector< unsigned int > indexVec
indexes of the vertices (start at 0) defining faces
void SetMaterialBoxFace(const Material &mat, int numberFace=6)
Assigns a material to the mesh of one (or all) face of a box object.
Header file for V-ART class "MeshObject".
Graphical object made of polygon meshes.