git-svn-id: svn://db.shs.com.ru/libs@62 a8b55f48-bf90-11e4-a774-851b48703e85
This commit is contained in:
@@ -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) {
|
bool GLVBO::saveToFile(const QString & filename) {
|
||||||
if (filename.isEmpty()) return false;
|
if (filename.isEmpty()) return false;
|
||||||
QFile f(filename);
|
QFile f(filename);
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ public:
|
|||||||
QVector<GLfloat> & colors() {changed = true; return colors_;}
|
QVector<GLfloat> & colors() {changed = true; return colors_;}
|
||||||
|
|
||||||
void translatePoints(const QVector3D & dp);
|
void translatePoints(const QVector3D & dp);
|
||||||
|
void scalePoints(const QVector3D & dp);
|
||||||
|
|
||||||
bool saveToFile(const QString & filename);
|
bool saveToFile(const QString & filename);
|
||||||
bool loadFromFile(const QString & filename);
|
bool loadFromFile(const QString & filename);
|
||||||
|
|||||||
Reference in New Issue
Block a user