src/basics.cpp

changeset 1068
283de3bd8b0e
parent 1053
2a48c0fff107
child 1072
9ce9496427f2
equal deleted inserted replaced
1067:819973864620 1068:283de3bd8b0e
35 35
36 Vertex::Vertex (qreal xpos, qreal ypos, qreal zpos) : 36 Vertex::Vertex (qreal xpos, qreal ypos, qreal zpos) :
37 QVector3D(xpos, ypos, zpos) {} 37 QVector3D(xpos, ypos, zpos) {}
38 38
39 39
40 void Vertex::transform (const Matrix& matr, const Vertex& pos) 40 void Vertex::transform (const Matrix& matrix, const Vertex& pos)
41 { 41 {
42 double x2 = (matr[0] * x()) + (matr[1] * y()) + (matr[2] * z()) + pos.x(); 42 double x2 = (matrix(0, 0) * x()) + (matrix(0, 1) * y()) + (matrix(0, 2) * z()) + pos.x();
43 double y2 = (matr[3] * x()) + (matr[4] * y()) + (matr[5] * z()) + pos.y(); 43 double y2 = (matrix(1, 0) * x()) + (matrix(1, 1) * y()) + (matrix(1, 2) * z()) + pos.y();
44 double z2 = (matr[6] * x()) + (matr[7] * y()) + (matr[8] * z()) + pos.z(); 44 double z2 = (matrix(2, 0) * x()) + (matrix(2, 1) * y()) + (matrix(2, 2) * z()) + pos.z();
45 setX (x2); 45 setX (x2);
46 setY (y2); 46 setY (y2);
47 setZ (z2); 47 setZ (z2);
48 } 48 }
49 49

mercurial