Private-Bookers
Advanced Transformations (Multiple Translations and Rotations)
вернуться

Шрифт:

 …the previously explained code that creates the icos. and toruses

glPopMatrix;

Are you impressed? You should not be,… yet. This system of objects looks very impressive but still you can see that the objects follow a certain pattern. If we add another rotation just before drawing the current scene, then things become quite chaotic:

glPushMatrix;

 glRotatef(angle,1.0,1.0,1.0);

 drawCubeSphere;

 drawIcoToruses;

glPopMatrix;

If now we 'forget' to clear the color buffer, but remember to clear the depth buffer we could have a commercially looking screen saver!

PS: Thanks to Chris Mathers for the clearing the depth buffer idea.

  • 1
  • 2
  • 3

Private-Bookers - русскоязычная библиотека для чтения онлайн. Здесь удобно открывать книги с телефона и ПК, возвращаться к сохраненной странице и держать любимые произведения под рукой. Материалы добавляются пользователями; если считаете, что ваши права нарушены, воспользуйтесь формой обратной связи.

Полезные ссылки

  • Моя полка