Translation

Math | Sunday 5 October 2008 12:22 am

In 3D programming translation is often represented as a matrix. The following matrix translates a point by a vector Translation Vector.

The matrix for translation is given below (notice that only points can be translated, not vectors)
Translation Matrix
The inverse of the matrix is simply T(-t).

In OpenGL you can do translation on objects with the following two lines of code. The first line sets that it’s the modelview matrix that you want to perform calculations on.

glMatrixMode(GL_MODELVIEW); 
glTranslatef(tx, ty, tz);
Please share:
  • Print this article!
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Current
  • LinkedIn
  • Live
  • MySpace
  • Netvibes
  • StumbleUpon
  • Twitter
  • Reddit
  • Technorati
  • Yahoo! Bookmarks

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a comment