10 #ifndef vtk_m_rendering_MatrixHelpers_h
11 #define vtk_m_rendering_MatrixHelpers_h
59 matrix(0, 0) = right[0];
60 matrix(0, 1) = right[1];
61 matrix(0, 2) = right[2];
65 matrix(2, 0) = viewDir[0];
66 matrix(2, 1) = viewDir[1];
67 matrix(2, 2) = viewDir[2];
69 matrix(0, 3) = -vtkm::Dot(right, position);
70 matrix(1, 3) = -vtkm::Dot(ru, position);
71 matrix(2, 3) = -vtkm::Dot(viewDir, position);
84 matrix(0, 0) = newx[0];
85 matrix(0, 1) = newy[0];
86 matrix(0, 2) = newz[0];
87 matrix(1, 0) = newx[1];
88 matrix(1, 1) = newy[1];
89 matrix(1, 2) = newz[1];
90 matrix(2, 0) = newx[2];
91 matrix(2, 1) = newy[2];
92 matrix(2, 2) = newz[2];
94 matrix(0, 3) = neworigin[0];
95 matrix(1, 3) = neworigin[1];
96 matrix(2, 3) = neworigin[2];
126 if (p1x == p2x && p1y == p2y)
131 vtkm::Vec3f_32 p1(p1x, p1y, AR3 / ((p1x * p1x + p1y * p1y) * COMPRESSION + AR3));
132 vtkm::Vec3f_32 p2(p2x, p2y, AR3 / ((p2x * p2x + p2y * p2y) * COMPRESSION + AR3));
135 vtkm::Vec3f_32 p2_p1(p2[0] - p1[0], p2[1] - p1[1], p2[2] - p1[2]);
137 t = vtkm::Min(vtkm::Max(t, -1.0f), 1.0f);
149 static_cast<vtkm::Float32>(sqrt(q[0] * q[0] + q[1] * q[1] + q[2] * q[2] + q[3] * q[3]));
155 matrix(0, 0) = 1 - 2 * (q[1] * q[1] + q[2] * q[2]);
156 matrix(0, 1) = 2 * (q[0] * q[1] + q[2] * q[3]);
157 matrix(0, 2) = (2 * (q[2] * q[0] - q[1] * q[3]));
159 matrix(1, 0) = 2 * (q[0] * q[1] - q[2] * q[3]);
160 matrix(1, 1) = 1 - 2 * (q[2] * q[2] + q[0] * q[0]);
161 matrix(1, 2) = (2 * (q[1] * q[2] + q[0] * q[3]));
163 matrix(2, 0) = (2 * (q[2] * q[0] + q[1] * q[3]));
164 matrix(2, 1) = (2 * (q[1] * q[2] - q[0] * q[3]));
165 matrix(2, 2) = (1 - 2 * (q[1] * q[1] + q[0] * q[0]));
173 #endif // vtk_m_rendering_MatrixHelpers_h