exquat man page on DragonFly
Printed from http://www.polarhome.com/service/man/?qf=exquat&af=0&tf=2&of=DragonFly
exquat(3) Allegro manual exquat(3)
NAME
exquat - A comparison between Euler angles and quaternions. Allegro
game programming library.
SYNOPSIS
#include <allegro.h>
Example exquat
DESCRIPTION
Euler angles are convenient for storing and creating 3D orientations.
However, this program demonstrates that they are not good when interpo‐
lating between two different orientations. The problem is solved by
using Allegro's quaternion operations.
In this program, two cubes are rotated between random orientations.
Notice that although they have the same beginning and ending orienta‐
tions, they do not follow the same path between orientations.
One cube is being rotated by directly incrementing or decrementing the
Euler angles from the starting point to the ending point. This is an
intuitive notion, but it is incorrect because it does not cause the
object to turn around a single unchanging axis of rotation. The axis
of rotation wobbles resulting in the object spinning in strange ways.
The object will eventually end up in the orientation that the user
intended, but it gets there in a way that is unattractive. Imagine if
this method was used to update the position of a camera in a game!
Sometimes it would swing wildly and disorient the player.
The other cube is animated using quaternions. This results in a much
more pleasing animation because the cube turns around a single axis of
rotation.
SEE ALSO
BITMAP(3), END_OF_MAIN(3), MATRIX_f(3), QUAT(3), acquire_bitmap(3),
allegro_error(3), allegro_init(3), allegro_message(3),
apply_matrix_f(3), blit(3), circle(3), clear_keybuf(3),
clear_to_color(3), create_bitmap(3), desktop_palette(3), destroy_bit‐
map(3), font(3), get_camera_matrix_f(3), get_rotation_matrix(3),
get_rotation_matrix_f(3), get_rotation_quat(3), install_keyboard(3),
keypressed(3), line(3), matrix_mul_f(3), palette_color(3),
persp_project_f(3), quat_interpolate(3), quat_to_matrix(3), readkey(3),
release_bitmap(3), rest(3), screen(3), set_gfx_mode(3), set_palette(3),
set_projection_viewport(3), textout_ex(3)
Allegro version 4.4.2 exquat(3)
[top]
List of man pages available for DragonFly
Copyright (c) for man pages and the logo by the respective OS vendor.
For those who want to learn more, the polarhome community provides shell access and support.
[legal]
[privacy]
[GNU]
[policy]
[cookies]
[netiquette]
[sponsors]
[FAQ]
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
|
Vote for polarhome
|