I would like to ask for some help regarding OpenGL transformations. Before someone would ask, yes, it is a university assignment, but I’m not asking for any code, merely the theoretical answer.

One of the tasks is to rotate an existing cube (which is originally at the origo) around an arbitrary axis. This axis is a line, which the user can enter two sets of coordinates for to define it, as well as an angle of rotation. I handled the drawing of the line, the user input already and I know how to use the transformation functions, but I am stuck with this line rotation in theory.

I would like to ask for some help regarding OpenGL transformations. Before someone would ask, yes, it is a university assignment, but I’m not asking for any code, merely the theoretical answer.

One of the tasks is to rotate an existing cube (which is originally at the origo) around an arbitrary axis. This axis is a line, which the user can enter two sets of coordinates for to define it, as well as an angle of rotation. I handled the drawing of the line, the user input already and I know how to use the transformation functions, but I am stuck with this line rotation in theory.

Any help would be highly appreciated![/QUOTE]

Well the transfromation are done like this : Rotate the thing scale it than move it . when you want this to be a code in opengl you just have to multiplay the 3 matrices in the inverse ordare which mean
final transformation = translate_ matrix * scaling_matrix * Rotate_matrix
some code from my transform class