views:

713

answers:

2

I'm currently studying this tutorial:

and I understand completely how to rotate/scale/translate each of the strings in that tutorial.

But does anyone know what steps are necessary to shear/taper/twist each of the strings in a user-configurable manner?

As far as I know, those are not part of OpenGL calls, so normally how are such transformations done on 3D text?

+3  A: 

You need to manipulate the modelview matrix. This page about matrices might help with the shearing, twisting, etc. You use glLoadMatrix to load in new values. For rotating, scaling, and transforming, just use the normal OpenGL functions.

Edit: If you already have values in the matrix, you can use glMultMatrix. However, if possible, I start by loading in shear, etc. and then apply the other things on top of that.

Zifre
glMultMatrix() will usually be a better choice than glLoadMatrix(), but both work.
Adam Rosenfield
+3  A: 

You can make your own transformation matrices. They don't even have to "make sense", you can populate them with whatever odd distortions you see fit. For example, shear should look something like this:

float shear[] = { 
   1, Ky, 0, 0, 
   Kx, 1, 0, 0,
    0, 0, 1, 0,
    0, 0, 0, 1 };
glMultMatrixf(shear);
MarkusQ
thank you! exactly what i was looking for!
ShaChris23