X-Git-Url: https://git.ucc.asn.au/?p=atyndall%2Fcits2231.git;a=blobdiff_plain;f=scene.c;h=8bf5f29af54349a1fe4e23882d00b46c5fd07930;hp=491943b7da1b1c74e61e2eb1379a2e40b807439f;hb=dd422a5ff7cb12b97fd62c92971e2debf043d237;hpb=2e066d076e25d4cd765ba886fc4e6478c8137d06 diff --git a/scene.c b/scene.c index 491943b..8bf5f29 100644 --- a/scene.c +++ b/scene.c @@ -308,12 +308,13 @@ void motion(int x, int y) { // For big/small scaling, we map negative numbers to 0->1 and positive numbers to 1->inf float diff = (y - starty); + float map = (diff - -((float)height/2))/(0 - -((float)height/2)); float scaling; if ( diff < 0 ) { - scaling = (diff - -((float)height/2))/(0 - -((float)height/2)); + scaling = map; } else { - scaling = pow(1.00000010101010100100001115, diff); + scaling = pow(1/map, diff); } if ( scaling != 0 ) {