25 Inicializa(direction.
Length());
30 Point4D projecao_direction = direction;
31 if ((direction.
GetX() == 0) && (direction.
GetZ() == 0))
34 projecao_direction.
SetY(0);
36 if(direction.
GetY() < 0)
37 angulo = angulo * (-1);
43 if(projecao_direction.
GetZ() > 0)
44 angulo = angulo * (-1);
53 transformacao = translacao2 * rotationY * rotationZ;
56 ApplyTransform(transformacao);
61 void VART::Arrow::Inicializa(
double length)
63 double radius, baseLength, headRadius;
65 radius = length * relativeRadius;
66 baseLength = length * relativeBaseLength;
67 headRadius = length * relativeHeadRadius;
70 double coordinateArray[] = {0, -radius, -radius,
74 baseLength, -radius, -radius,
75 baseLength, -radius, radius,
76 baseLength, radius, radius,
77 baseLength, radius, -radius,
78 baseLength, -headRadius, -headRadius,
79 baseLength, -headRadius, headRadius,
80 baseLength, headRadius, headRadius,
81 baseLength, headRadius, -headRadius,
83 baseLength, -headRadius, -headRadius,
84 baseLength, -headRadius, -headRadius,
85 baseLength, -headRadius, headRadius,
86 baseLength, -headRadius, headRadius,
87 baseLength, headRadius, headRadius,
88 baseLength, headRadius, headRadius,
89 baseLength, headRadius, -headRadius,
90 baseLength, headRadius, -headRadius,
95 double* endOfCoordinateArray = coordinateArray +
sizeof(coordinateArray)/
sizeof(
double);
98 unsigned int indexArrayQuadraticFaces[] = { 0,1,2,3,
104 unsigned int* endOfIndexArrayQuadraticFaces = indexArrayQuadraticFaces +
sizeof(indexArrayQuadraticFaces)/
sizeof(
int);
107 unsigned int indexArrayTriangularFaces[] = {12,10,9,
112 unsigned int* endOfIndexArrayTriangularFaces = indexArrayTriangularFaces +
sizeof(indexArrayTriangularFaces)/
sizeof(
int);
116 vertCoordVec.assign(coordinateArray,endOfCoordinateArray);
118 meshQuadratic.
indexVec.assign(indexArrayQuadraticFaces,endOfIndexArrayQuadraticFaces);
120 meshList.push_back(meshQuadratic);
124 vertCoordVec.assign(coordinateArray,endOfCoordinateArray);
126 meshTriangular.
indexVec.assign(indexArrayTriangularFaces,endOfIndexArrayTriangularFaces);
128 meshList.push_back(meshTriangular);
130 ComputeVertexNormals();
131 ComputeBoundingBox();
132 ComputeRecursiveBoundingBox();
static float relativeBaseLength
Points and vectors using homogeneous coordinates.
double Length() const
Returns the vector's length.
Header file for V-ART class "Mesh".
static float relativeHeadRadius
A mesh is part of an graphical object, in which faces are made of vertices according to some rule of ...
std::vector< unsigned int > indexVec
indexes of the vertices (start at 0) defining faces
Header file for V-ART class "MeshObject".
static const Material & PLASTIC_GREEN()
double GenericAngleTo(const Point4D &p) const
static float relativeRadius