const Vertex Matrix3D::operator*(const Vertex &p) const { /* Multiplying a vertex by a matrix */ // Need to update this Vertex temp; temp.SetX((this->_m[0][0] * p.GetX()) + (this->_m[0][1] * p.GetY()) + (this->_m[0][2] * p.GetZ()) + (this->_m[0][3] * p.GetW())); temp.SetY((this->_m[1][0] * p.GetX()) + (this->_m[1][1] * p.GetY()) + (this->_m[1][2] * p.GetZ()) + (this->_m[1][3] * p.GetW())); temp.SetZ((this->_m[2][0] * p.GetX()) + (this->_m[2][1] * p.GetY()) + (this->_m[2][2] * p.GetZ()) + (this->_m[2][3] * p.GetW())); temp.SetW((this->_m[3][0] * p.GetX()) + (this->_m[3][1] * p.GetY()) + (this->_m[3][2] * p.GetZ()) + (this->_m[3][3] * p.GetW())); temp.GetColor().SetValue(p.GetColor().GetValue()); return temp; }
// Gets the vector between 2 vertexs. Vector3D Vertex::GetVector(Vertex v1, Vertex v2) { return Vector3D(v2.GetX() - v1.GetX(), v2.GetY() - v1.GetY(), v2.GetZ() - v1.GetZ()); }