|
GRASS 8 Programmer's Manual 8.6.0dev(2026)-8843f13794
|
OGSF library - setting and manipulating keyframes animation. More...

Go to the source code of this file.
Functions | |
| int | GK_set_interpmode (int mode) |
| Set interpolation mode. | |
| void | GK_set_tension (float tens) |
| Set value for tension when interpmode is KF_SPLINE. | |
| void | GK_showtension_start (void) |
| void | GK_showtension_stop (void) |
| Show tension stop ? | |
| void | GK_update_tension (void) |
| Update tension. | |
| void | GK_print_keys (const char *name) |
| Print keyframe info. | |
| void | GK_update_frames (void) |
| Recalculate path using the current number of frames requested. | |
| void | GK_set_numsteps (int newsteps) |
| Set the number of frames to be interpolated from keyframes. | |
| void | GK_clear_keys (void) |
| Deletes all keyframes, resets field masks. | |
| int | GK_move_key (float oldpos, float precis, float newpos) |
| Move keyframe. | |
| int | GK_delete_key (float pos, float precis, int justone) |
| int | GK_add_key (float pos, unsigned long fmask, int force_replace, float precis) |
| Add keyframe. | |
| void | GK_do_framestep (int step, int render) |
| Moves the animation to frame number "step". | |
| void | GK_show_path (int flag) |
| Draw the current path. | |
| void | GK_show_vect (int flag) |
| Show vector sets. | |
| void | GK_show_site (int flag) |
| Show point sets. | |
| void | GK_show_vol (int flag) |
| Show volumes. | |
| void | GK_show_list (int flag) |
| Show list. | |
OGSF library - setting and manipulating keyframes animation.
GRASS OpenGL gsurf OGSF Library
SPDX-FileCopyrightText: 1999-2008 GRASS Development Team SPDX-License-Identifier: GPL-2.0-or-later
Definition in file gk2.c.
Add keyframe.
The pos value is the relative position in the animation for this particular keyframe - used to compare relative distance to neighboring keyframes, it can be any floating point value.
The fmask value can be any of the following or'd together:
Other fields will be added later.
The value precis and the boolean force_replace are used to determine if a keyframe should be considered to be at the same position as a pre-existing keyframe. e.g., if anykey.pos - newkey.pos <= precis, GK_add_key() will fail unless force_replace is TRUE.
| pos | position |
| fmask | |
| force_replace | |
| precis | precision value |
Definition at line 427 of file gk2.c.
References G_debug(), GK_update_frames(), GS_get_fov(), GS_get_from(), GS_get_twist(), GS_get_viewdir(), KF_DIRX, KF_DIRY, KF_DIRZ, KF_FOV, KF_FROMX, KF_FROMY, KF_FROMZ, KF_TWIST, malloc(), NULL, X, Y, and Z.
Deletes all keyframes, resets field masks.
Doesn't change number of frames requested.
Definition at line 308 of file gk2.c.
References free(), gk_free_key(), and NULL.
Delete keyframe
The values pos and precis are used to determine which keyframes to delete. Any keyframes with their position within precis of pos will be deleted if justone is zero. If justone is non-zero, only the first (lowest pos) keyframe in the range will be deleted.
| pos | position |
| precis | precision |
| justone | delete only one keyframe |
Definition at line 365 of file gk2.c.
References free(), GK_update_frames(), key_node::next, and key_node::pos.
Moves the animation to frame number "step".
Step should be a value between 1 and the number of frames. If render is non-zero, calls draw_all.
| step | step value |
| render |
Definition at line 483 of file gk2.c.
References gk_follow_frames().
Move keyframe.
Precis works as in other functions - to identify keyframe to move. Only the first keyframe in the precis range will be moved.
| oldpos | old position |
| precis | precision value |
| newpos | new position |
Definition at line 334 of file gk2.c.
References GK_update_frames(), key_node::next, and key_node::pos.
Print keyframe info.
| name | filename |
Definition at line 205 of file gk2.c.
References _, key_node::fields, G_fatal_error(), KF_DIRX, KF_DIRY, KF_DIRZ, KF_FOV, KF_FROMX, KF_FROMY, KF_FROMZ, KF_TWIST, name, key_node::next, NULL, and key_node::pos.
Set interpolation mode.
| mode | interpolation mode (KF_LINEAR or KF_SPLINE) |
Definition at line 136 of file gk2.c.
References KF_LEGAL_MODE.
Set the number of frames to be interpolated from keyframes.
| newsteps | number of frames |
Definition at line 295 of file gk2.c.
References GK_update_frames().
Set value for tension when interpmode is KF_SPLINE.
Definition at line 151 of file gk2.c.
References gk_draw_path(), GK_update_frames(), GS_alldraw_wire(), GS_background_color(), GS_clear(), GS_done_draw(), GS_ready_draw(), GS_set_draw(), and GSD_BACK.
Show list.
| flag |
Definition at line 605 of file gk2.c.
References FM_LABEL, and GS_draw_all_list().
Draw the current path.
| flag |
Definition at line 499 of file gk2.c.
References FM_PATH, gk_draw_path(), GS_done_draw(), GS_ready_draw(), GS_set_draw(), and GSD_FRONT.
Show point sets.
| flag |
Definition at line 551 of file gk2.c.
References FM_SITE, GP_alldraw_site(), GS_done_draw(), GS_ready_draw(), GS_set_draw(), and GSD_FRONT.
Show vector sets.
| flag |
Definition at line 525 of file gk2.c.
References FM_VECT, GS_done_draw(), GS_ready_draw(), GS_set_draw(), GSD_FRONT, and GV_alldraw_vect().
Show volumes.
| flag |
Definition at line 578 of file gk2.c.
References FM_VOL, GS_done_draw(), GS_ready_draw(), GS_set_draw(), GSD_FRONT, and GVL_alldraw_vol().
Recalculate path using the current number of frames requested.
Call after changing number of frames or when Keyframes change.
Definition at line 241 of file gk2.c.
References _, key_node::fields, free(), G_warning(), gk_make_framesfromkeys(), gk_make_linear_framesfromkeys(), KF_FROMX, KF_FROMY, KF_FROMZ, KF_LINEAR, NULL, and key_node::pos.
Referenced by GK_add_key(), GK_delete_key(), GK_move_key(), GK_set_numsteps(), GK_set_tension(), and GK_update_tension().