四元数

まあ落ち込んでいても仕方ないので適当に頑張るですよ。はあ。


というわけで四元数いじり始め。っていうかしゅごいよ四元数
D12_ver0_12a.png


実験的に、背景を描く前に以下のコードを入れてみました。

#if 1
	static MQQuaternion q;
	static float theta = 0.0f;
	float rad = theta * (PI / 180.0f);
	theta += 1.0f; // 1度ずつ回す
	if( theta >= 360.0f ) theta = 0.0f;
	q.Set( cos( rad / 2.0f), 0.0f, 0.0f, 1.0f * sin( rad / 2.0f ) ); // Z軸を中心に回す

	float matt[16];
	q.GetMatrix( matt ); // 回転行列取得
	glMultMatrixf( matt );
#endif


回った回った!クララが回った!