コード例 #1
0
static void iterate( void ) {
	ALfloat orientation[]  = { 0.0f,  0.0f, -1.0f,
				   0.0f,  1.0f,  0.0f };
	ALfloat xaxis[]        = { 1.0f,  0.0f,  0.0f };
	ALfloat yaxis[]        = { 0.0f,  1.0f,  0.0f };
	ALfloat zaxis[]        = { 0.0f,  0.0f,  1.0f };
	ALfloat *at = orientation;
	ALfloat *up = &orientation[3];
	static ALint angle = 0;

	/*
	 * rotate up vector about at vector by angle degrees.
	 */
	_alRotatePointAboutAxis(TORAD(angle), up, at);

	fprintf(stderr, "orientation: \n\tAT(%f %f %f)\n\tUP(%f %f %f)\n",
		orientation[0], orientation[1], orientation[2],
		orientation[3], orientation[4], orientation[5]);

	fprintf(stderr, "angle = %d\n", angle);

	angle += 15; /* increment fifeteen degrees degree */

	alListenerfv(AL_ORIENTATION, orientation);

	micro_sleep(900000);
}
コード例 #2
0
static void iterate( void ) {
	ALfloat orientation[]  = { 0.0f, 0.0f, -1.0f,
				   0.0f, 1.0f, 0.0f };
	static ALint angle = 0;

	/*
	 * rotate at vector about up vector by angle degrees.
	 */
	_alRotatePointAboutAxis(TORAD(angle), orientation, &orientation[3]);

	angle += 15; /* increment fifeteen degrees degree */

	fprintf(stderr, "orientation: \n\tAT(%f %f %f)\n\tUP(%f %f %f)\n",
		orientation[0], orientation[1], orientation[2],
		orientation[3], orientation[4], orientation[5]);

	alListenerfv(AL_ORIENTATION, orientation);

	micro_sleep(1500000);
}