git-svn-id: svn://db.shs.com.ru/libs@62 a8b55f48-bf90-11e4-a774-851b48703e85

This commit is contained in:
2015-12-04 14:42:47 +00:00
parent 576e28354b
commit 5afafe8ac0
2 changed files with 14 additions and 0 deletions

View File

@@ -235,6 +235,19 @@ void GLVBO::translatePoints(const QVector3D & dp) {
}
void GLVBO::scalePoints(const QVector3D & dp) {
if (vertices_.isEmpty()) return;
int vcnt = vertices_.size() / 3;
for (int i = 0; i < vcnt; ++i) {
int vi = i * 3;
vertices_[vi + 0] *= dp.x();
vertices_[vi + 1] *= dp.y();
vertices_[vi + 2] *= dp.z();
}
rebuffer();
}
bool GLVBO::saveToFile(const QString & filename) {
if (filename.isEmpty()) return false;
QFile f(filename);

View File

@@ -47,6 +47,7 @@ public:
QVector<GLfloat> & colors() {changed = true; return colors_;}
void translatePoints(const QVector3D & dp);
void scalePoints(const QVector3D & dp);
bool saveToFile(const QString & filename);
bool loadFromFile(const QString & filename);