Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int cubeCounter = 0;
- double SCALE = 1.005f;
- const int MAX_COUNTER = 100;
- void updateCube()
- {
- auto curpos = cubeMatrix.getTrans();
- cubeMatrix *= osg::Matrix::translate(-curpos);
- cubeMatrix *= osg::Matrix::scale(1.0 / SCALE, 1.0 / SCALE, 1.0 / SCALE);
- cubeCounter++;
- if (cubeCounter >= MAX_COUNTER) {
- cubeCounter = 0;
- for (int i = 0; i < 100; i++) {
- cubeMatrix *= osg::Matrix::scale(SCALE, SCALE, SCALE);
- }
- }
- cubeMatrix *= osg::Matrix::translate(curpos);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement