Ejemplo n.º 1
0
void rotate(mat4 target, float angle, float x, float y, float z) {

    float q[4];
    setQuat(q, angle, x, y, z);

    rotateQ(target, q);
}
Ejemplo n.º 2
0
void rotate3D(quat target, vec3 angles) {

    float quatX[4], quatY[4], quatZ[4];

    // make quat for every axis
    setQuat(quatY, angles[1], 1, 0, 0);
    setQuat(quatX, angles[0], 0, 1, 0);
    setQuat(quatZ, angles[2], 0, 0, -1);

    // X * Y
    float quatXY[4];
    multQ(quatX, quatY, quatXY);

    // XY * Z
    float quatXYZ[4];
    multQ(quatXY, quatZ, quatXYZ);

    // write to target quat
    target[0] = quatXYZ[0];
    target[1] = quatXYZ[1];
    target[2] = quatXYZ[2];
    target[3] = quatXYZ[3];
}
Ejemplo n.º 3
0
void ArcBall::setViewDefault()
{
	setQuat(Quat::VIEWDEFAULT);
}
Ejemplo n.º 4
0
void ArcBall::setViewYZ()
{
	setQuat(Quat::VIEWYZ);
}
Ejemplo n.º 5
0
void ArcBall::setViewXZ()
{
	setQuat(Quat::VIEWXZ);
}
Ejemplo n.º 6
0
// set view
void ArcBall::setViewXY()
{
	setQuat(Quat::VIEWXY);
}