Sorry but Im German. Yes my english is not very well
I will describe my Problem again, I hope with better words
I will draw a simple Cylinder with OpenGl.
The Cylinder-Axis starts from the Point (x,y,z) and should go to the Point (x1,y1,z1). (Like the Tower in Pisa :-))
The Problem is to calculate the angle(s) for the rotation function(s).
I still don’t understand. Any rotations you do to it should be done before you translate it to the desired position, and they should be done by constructing a rotation matrix to apply before applying the translation.
ie. Make your cylinder at the origin with axis length (x1-x, y1-y, z1-z). Rotate it how you want by building a rotation matrix and applying it, then translate your cylinder to where you really want it in the world.
I use gluCylinder(). Where i can set the lenght and the widht but not the direction.
So i rotate the the Z-Axis and the Y-Axis of the matrix that the normalvec of the plane in in the same direction as a line from point1 to point2. Then i can draw the cylinder with gluCylinder. Is it Ok?
But how can i easy calculate the angles for the rotations?