O'Reilly logo

Lua Game Development Cookbook by Mário Kašuba

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Moving, rotating, and scaling objects

OpenGL offers you stack-based matrix transformations. These transformations include translating—moving, rotating, and scaling. Stacking means that previous transformations can affect succeeding transformations and they create the hierarchical structure. A typical example may be a human-like arm simulation. The arm consists of several parts connected with joints. Each part's position and orientation is dependent on the position and orientation of the previous part. Similar rules of dependency apply to all parts of the solar system. Planets orbit around stars and moons orbit their planets at the same time.

This recipe will show you how to create a simple scene with your own animated miniature of the solar system. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required