A lapok készítése
void Bezier::updateBaseMesh() {
size_t resolution = 50;
mesh.clear();
std::vector<BaseMesh::VertexHandle> handles, tri;
for (size_t i = 0; i < resolution - 1; ++i)
for (size_t j = 0; j < resolution - 1; ++j) {
tri.clear();
tri.push_back(handles[i * resolution + j]);
tri.push_back(handles[i * resolution + j + 1]);
tri.push_back(handles[(i + 1) * resolution + j]);
mesh.add_face(tri);
tri.clear();
tri.push_back(handles[(i + 1) * resolution + j]);
tri.push_back(handles[i * resolution + j + 1]);
tri.push_back(handles[(i + 1) * resolution + j + 1]);
mesh.add_face(tri);
}
Object::updateBaseMesh();
}
Módosítás
void Bezier::drawWithNames(const Visualization &vis) const {
if (!vis.show_control_points)
return;
for (size_t i = 0; i < control_points.size(); ++i) {
const auto &p = control_points[i];
glPushName(i);
glRasterPos3dv(p.data());
glPopName();
}
}
Vector Bezier::postSelection(int selected) {
return control_points[selected];
}
void Bezier::movement(int selected, const Vector &pos) {
control_points[selected] = pos;
}
Kész az ötödik fázis

- Vannak még egyéb funkciók, érdemes körülnézni
Page 1 of 12