Sponsored Content
Full Discussion: Basic VI tricks
Top Forums UNIX for Advanced & Expert Users Basic VI tricks Post 302544962 by Habitual on Friday 5th of August 2011 01:47:51 PM
Old 08-05-2011
For an educational entity, you'd think they'd spell "cancelling" correctly on that page.
 

5 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

tar tricks

Hello there, Is there anyway to make the tar utility print the contents of the files inside it (not list the files, but rather their contents) sequentially from the command line? What I ultimately would like to do is to have a way of printing the contents of each file in the tar archive... (2 Replies)
Discussion started by: neked
2 Replies

2. Shell Programming and Scripting

need couple of ksh tricks please

1) I ran myScript with 2 arguments, I meant to use 3 if I do r my, it will rerun it with the 2 arguments. is there a way I can do r my and add a third argument at the end? 2) say I did myAcript.ksh 2 5 7 8 I realise my typo. is there an easy way to redo the command replacing A with S? ... (4 Replies)
Discussion started by: JamesByars
4 Replies

3. Post Here to Contact Site Administrators and Moderators

Solaris tips and tricks

What do you think could we open new top topic with tips and tricks and to show to other users some tricks what do we know like dtrace , new virtual server , how to add new users etc. This is only suggestion (1 Reply)
Discussion started by: solaris_user
1 Replies

4. UNIX for Dummies Questions & Answers

Sed Tricks

I have a file which containd a string "old" and I need to replace all old with "new" if and only if it is a string not part of a string like Gold or fold etc. I tried with sed like below echo "old gold old" | sed 's/old/new/g' It doesn't give the desired output, It give "old Gnew new".... (3 Replies)
Discussion started by: siba.s.nayak
3 Replies

5. UNIX for Beginners Questions & Answers

Vim tips and tricks

Vim Tips and Tricks Save and quit :w => Save :q => Exit as long as there have been no changes :q! => Exit and ignore any changes :wq => Save and Exit. :x => Exit, saving changes ZZ => Exit and save changes if any have been made :10,20w filename => writes the... (34 Replies)
Discussion started by: ungalnanban
34 Replies
exspline(3alleg4)						  Allegro manual						 exspline(3alleg4)

NAME
exspline - Constructing smooth movement paths from spline curves. Allegro game programming library. SYNOPSIS
#include <allegro.h> Example exspline DESCRIPTION
This program demonstrates the use of spline curves to create smooth paths connecting a number of node points. This can be useful for con- structing realistic motion and animations. The technique is to connect the series of guide points p1..p(n) with spline curves from p1-p2, p2-p3, etc. Each spline must pass though both of its guide points, so they must be used as the first and fourth of the spline control points. The fun bit is coming up with sensible values for the second and third spline control points, such that the spline segments will have equal gradients where they meet. I came up with the following solution: For each guide point p(n), calculate the desired tangent to the curve at that point. I took this to be the vector p(n-1) -> p(n+1), which can easily be calculated with the inverse tangent function, and gives decent looking results. One implication of this is that two dummy guide points are needed at each end of the curve, which are used in the tangent calculations but not connected to the set of splines. Having got these tangents, it becomes fairly easy to calculate the spline control points. For a spline between guide points p(a) and p(b), the second control point should lie along the positive tangent from p(a), and the third control point should lie along the negative tangent from p(b). How far they are placed along these tangents controls the shape of the curve: I found that applying a 'curviness' scaling factor to the distance between p(a) and p(b) works well. One thing to note about splines is that the generated points are not all equidistant. Instead they tend to bunch up nearer to the ends of the spline, which means you will need to apply some fudges to get an object to move at a constant speed. On the other hand, in situations where the curve has a noticeable change of direction at each guide point, the effect can be quite nice because it makes the object slow down for the curve. SEE ALSO
END_OF_MAIN(3alleg4), SCREEN_W(3alleg4), acquire_screen(3alleg4), alert(3alleg4), allegro_error(3alleg4), allegro_init(3alleg4), alle- gro_message(3alleg4), calc_spline(3alleg4), circlefill(3alleg4), clear_keybuf(3alleg4), clear_to_color(3alleg4), desktop_palette(3alleg4), fixatan2(3alleg4), fixcos(3alleg4), fixed(3alleg4), fixmul(3alleg4), fixsin(3alleg4), fixsqrt(3alleg4), fixtof(3alleg4), fixtoi(3alleg4), font(3alleg4), ftofix(3alleg4), install_keyboard(3alleg4), install_mouse(3alleg4), install_timer(3alleg4), itofix(3alleg4), key(3alleg4), keypressed(3alleg4), line(3alleg4), makecol(3alleg4), mouse_b(3alleg4), mouse_x(3alleg4), mouse_y(3alleg4), palette_color(3alleg4), poll_mouse(3alleg4), readkey(3alleg4), release_screen(3alleg4), screen(3alleg4), set_gfx_mode(3alleg4), set_palette(3alleg4), show_mouse(3alleg4), spline(3alleg4), textout_centre_ex(3alleg4), textprintf_centre_ex(3alleg4), textprintf_ex(3alleg4), vsync(3alleg4), xor_mode(3alleg4) Allegro version 4.4.2 exspline(3alleg4)
All times are GMT -4. The time now is 05:20 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy