Quaternion rotation opengl
By : The Discreet
Date : March 29 2020, 07:55 AM
hop of those help? If i make a quaternion which represents for example a players direction and the angle around this rotation. So for the application I intend to make a plane flying. The quaternion would represent the players direction and the angle around this direction. , I hope I understand the question correctly.

Body axes to earth axes using rotation matrix? [openGL]
By : Paresh Khatri
Date : March 29 2020, 07:55 AM

iOS OpenGL ES 2.0 Quaternion Rotation Slerp to XYZ Position
By : Arnav Roy Karforma
Date : March 29 2020, 07:55 AM
will help you The answer to this question is a combination of the following rotateTo function and a change to the code from Ray's tutorial at ( http://www.raywenderlich.com/12667/howtorotatea3dobjectusingtoucheswithopengl ). As one of the comments on that article says there is an arbitrary factor of 2.0 being multiplied in GLKQuaternion Q_rot = GLKQuaternionMakeWithAngleAndVector3Axis(angle * 2.0, axis);. Remove that "2" and use the following function to create the _slerpEnd  after that the globe will rotate smoothly to XYZ specified. code :
// Rotate the globe using Slerp interpolation to an XYZ coordinate
 (void)rotateToLocationX:(float)x andY:(float)y andZ:(float)z {
// Turn on the interpolation for smooth rotation
_slerping = YES; // Begin auto rotating to this location
_slerpCur = 0;
_slerpMax = 1.0;
_slerpStart = _quat;
// Create a look at vector for which we will create a GLK4Matrix from
float xEye = x;
float yEye = y;
float zEye = z;
_currentSatelliteLocation = GLKMatrix4MakeLookAt(xEye, yEye, zEye, 0, 0, 0, 0, 1, 0);
// Turn our 4x4 matrix into a quat and use it to mark the end point of our interpolation
_slerpEnd = GLKQuaternionMakeWithMatrix4(_currentSatelliteLocation);
}

Converting glm quaternion to rotation matrix and using it with opengl
By : Cman88
Date : March 29 2020, 07:55 AM
Hope that helps GLM won't/can't(?) automagically cast a mat4 to GLfloat* so you have to help it along a bit. Try this: code :
#include <glm/gtc/type_ptr.hpp>
glMultMatrixf( glm::value_ptr( glm::mat4_cast(orientation) ) );
glMultMatrixf( &glm::mat4_cast(orientation)[0][0] );

What is wrong with my Quaternion rotation in OpenGL?
By : zif001
Date : March 29 2020, 07:55 AM
it should still fix some issue Going off notes on the internet helps construct quaternion classes properly. My problem is putting them to practical use and using them for rotations in raw OpenGL. , code :
glRotatef(qRot.x, 1., 0, 0);
glRotatef(qRot.y, 0, 1., 0);
glRotatef(qRot.z, 0, 0, 1.);
template<class T>
mat<T,3,3> mat_rotation(const quat<T> &x)
{
T s = 2/norm2(x); // cheap renormalization even of nonunit quaternions
T wx = x.w*x.x, wy = x.w*x.y, wz = x.w*x.z;
T xx = x.x*x.x, xy = x.x*x.y, xz = x.x*x.z;
T yy = x.y*x.y, yz = x.y*x.z;
T zz = x.z*x.z;
return mat<T,3,3>(
1  s*(yy+zz), s*(xywz), s*(xz+wy),
s*(xy+wz), 1  s*(xx+zz), s*(yzwx),
s*(xzwy), s*(yz+wx), 1  s*(xx+yy)
);
}

