1#include"../include/helpersSynthesis.h"
6std::vector<uint32_t> generate_picture_EBO(
const cv::Size& s)
8 const size_t W = s.width;
9 const size_t H = s.height;
11 size_t elements_number = 3 * 2 * (H - 1) * (W - 1);
12 std::vector<uint32_t> indices;
13 indices.resize(elements_number);
16 for (
size_t y = 0; y < H - 1; ++y)
18 for (
size_t x = 0; x < W - 1; ++x)
20 indices[3 * INDEX_E(x, y, (W - 1)) + 0] = uint32_t(INDEX_E(x, y, W));
21 indices[3 * INDEX_E(x, y, (W - 1)) + 1] = uint32_t(INDEX_E(x + 1, y, W));
22 indices[3 * INDEX_E(x, y, (W - 1)) + 2] = uint32_t(INDEX_E(x, y + 1, W));
27 for (
size_t y = 1; y < H; ++y)
29 for (
size_t x = 0; x < W - 1; ++x)
31 indices[offset + 3 * INDEX_E(x, y - 1, (W - 1)) + 0] = uint32_t(INDEX_E(x, y, W));
32 indices[offset + 3 * INDEX_E(x, y - 1, (W - 1)) + 1] = uint32_t(INDEX_E(x + 1, y - 1, W));
33 indices[offset + 3 * INDEX_E(x, y - 1, (W - 1)) + 2] = uint32_t(INDEX_E(x + 1, y, W));
37 printf(
"Real number of elements %i\n",
int(elements_number));
41cv::Matx33f rotationMatrixFromRotationAroundX(
float rx)
45 0.f, cos(rx), -sin(rx),
46 0.f, sin(rx), cos(rx));
49cv::Matx33f rotationMatrixFromRotationAroundY(
float ry)
52 cos(ry), 0.f, sin(ry),
54 -sin(ry), 0.f, cos(ry));
57cv::Matx33f rotationMatrixFromRotationAroundZ(
float rz)
60 cos(rz), -sin(rz), 0.f,
61 sin(rz), cos(rz), 0.f,
65cv::Matx33f EulerAnglesToRotationMatrix(cv::Vec3f rotation)
70 rotationMatrixFromRotationAroundZ(rotation[0]) *
71 rotationMatrixFromRotationAroundY(rotation[1]) *
72 rotationMatrixFromRotationAroundX(rotation[2]);
75cv::Matx33f EulerAnglesDegreeToRotationMatrixNotOMAF(cv::Vec3f rotationDegrees)
79 cv::Vec3f tmp = rotationDegrees;
80 auto const radperdeg = 0.01745329252f;
81 auto rotation = radperdeg * tmp;
82 return rotationMatrixFromRotationAroundZ(rotation[2]) *
83 rotationMatrixFromRotationAroundY(rotation[1]) *
84 rotationMatrixFromRotationAroundX(rotation[0]);
88glm::mat3x3 glmRotationMatrixFromRotationAroundX(
float rx)
98 0.f, cos(rx), sin(rx),
99 0.f, -sin(rx), cos(rx));
102glm::mat3x3 glmRotationMatrixFromRotationAroundY(
float ry)
112 cos(ry), 0.f, -sin(ry),
114 sin(ry), 0.f, cos(ry));
117glm::mat3x3 glmRotationMatrixFromRotationAroundZ(
float rz)
126 cos(rz), sin(rz), 0.f,
127 -sin(rz), cos(rz), 0.f,
131glm::mat3x3 glmEulerAnglesDegreeToRotationMatrix(glm::vec3 rotationDegrees)
135 auto const radperdeg = 0.01745329252f;
136 auto rotation = radperdeg * rotationDegrees;
138 glmRotationMatrixFromRotationAroundZ(rotation[0]) *
139 glmRotationMatrixFromRotationAroundY(rotation[1]) *
140 glmRotationMatrixFromRotationAroundX(rotation[2]);
143glm::mat3x3 glmEulerAnglesDegreeToRotationMatrixNotOMAF(glm::vec3 rotationDegrees)
147 auto const radperdeg = 0.01745329252f;
148 auto rotation = radperdeg * rotationDegrees;
149 return glmRotationMatrixFromRotationAroundZ(rotation[2]) *
150 glmRotationMatrixFromRotationAroundY(rotation[1]) *
151 glmRotationMatrixFromRotationAroundX(rotation[0]);