Example #1
0
void Kinect::setRtMatrix(bool isDegree = true, double alpha = 0, double beta = 0, double gamma = 0, double x = 0, double y = 0, double z = 0) //rotation order: z first(beta), x second(alpha), y third(gamma)
{
	if (isDegree)
	{
		alpha = degreeToRad(alpha);
		beta = degreeToRad(beta);
		gamma = degreeToRad(gamma);	
	}

	mRT =  ( Mat_<float>(4,4) << 
		cos(beta)*cos(gamma) - sin(alpha)*sin(beta)*sin(gamma), cos(beta)*sin(gamma) + cos(gamma)*sin(alpha)*sin(beta), -cos(alpha)*sin(beta), x ,							 
		-cos(alpha)*sin(gamma),                                  cos(alpha)*cos(gamma),            sin(alpha), y ,						 
		cos(gamma)*sin(beta) + cos(beta)*sin(alpha)*sin(gamma), sin(beta)*sin(gamma) - cos(beta)*cos(gamma)*sin(alpha),  cos(alpha)*cos(beta), z ,						     
		0													  , 0												      , 0					 , 1 );
}
Example #2
0
float pixelToDeg( int pos, int maxPos, float maxDeg )
{

	return radToDegree( pixelToRad( pos, maxPos, degreeToRad( maxDeg ) ) );

}
void Vector3::RotateZDeg(float angle){
	angle = degreeToRad(angle);
	RotateZRad(angle);
}