title: rotation of objects in OpenGL using 3D vector and angle
body: <p>I have a problem with the orientation of objects in the OpenGL program, I can't calculate rotation of x, y, z based on 3D vector and angle or 4D vector.
  Im working with c++.</p>
  
  <p>I have: </p>
  
  <pre><code>Vector3f myVector;
  float angle;    
  float rotx;
  float roty;    
  float rotz;
  
  //i need smomething like
  
  doSomething(a,angle,&amp;rotx,&amp;roty,&amp;rotz);    
  glRotatef(rotx,1.0,0,0);    
  glRotatef(roty,0,1.0,0);    
  glRotatef(rotz,0,0,1.0);
  
  // draw object
  </code></pre>
  
  <p>"myVector" is a vector in 3d space. I want to rotate object in direction of vector. "angle" is rotation of object around the vector. "rotx,roty,rotz" are local variables. How to calculate rotx,roty,royz to do this?</p>
  
  <p><a href="http://en.wikipedia.org/wiki/File:Euler_AxisAngle.png" rel="nofollow">http://en.wikipedia.org/wiki/File:Euler_AxisAngle.png</a></p>
  
  <p>In picture on link my object is oriented in direction of 'x', i want to orinet it in direction of 'e' and 'O' is my "angle".</p>