grotate のガタガタを逆に利用できないか試してみる

grotate のガタガタを逆に利用して味のある感じに仕上げたりとかできんもんかな? とか思って試してみました。

#include "hspmath.as"
#define gbox( %1, %2, %3, %4 ) line %3, %2, %1, %2:\
                               line %3, %4:\
                               line %1, %4:\
                               line %1, %2

#const WINDOW_ID_MAIN 0
#const WINDOW_ID_PICTURE 1
#const WINDOW_ID_WORK 2
randomize

buffer WINDOW_ID_PICTURE
picload dir_exe + "\\sample\\demo\\jp6girl.bmp"
copyLeft    = 0
copyTop     = 0
copyWidth   = ginfo_winx
copyHeight  = ginfo_winy

*st

rotate      = M_PI / 180 * rnd( 360 )
scale       = 0.01 * ( 1000 / ( rnd( 80 ) + 4 ) )

sin_rotate  = sin( rotate )
cos_rotate  = cos( rotate )

repeat 4
    x = double( copyWidth ) / 2
    if ( ( cnt + 1 ) \ 4 ) <= 1 {
        x *= -1
    }
    y = double( copyHeight ) / 2
    if cnt <= 1 {
        y *= -1
    }
    x *= scale
    y *= scale
    xx = cos_rotate * x - sin_rotate * y
    y  = sin_rotate * x + cos_rotate * y
    x = xx

    if ( cnt == 0 ) || ( minX > x ) {
        minX = x
    }
    if ( cnt == 0 ) || ( minY > y ) {
        minY = y
    }
    if ( cnt == 0 ) || ( maxX < x ) {
        maxX = x
    }
    if ( cnt == 0 ) || ( maxY < y ) {
        maxY = y
    }
loop

buffer WINDOW_ID_WORK, maxX - minX + 1, maxY - minY + 1

pos ( maxX - minX + 1 ) / 2, ( maxY - minY + 1 ) / 2
gmode GMODE_GDI, copyWidth, copyHeight
grotate WINDOW_ID_PICTURE, copyLeft, copyTop, rotate, scale * copyWidth, scale * copyHeight
redraw

screen WINDOW_ID_MAIN, copyWidth, copyHeight

pos copyWidth / 2, copyHeight / 2

gmode GMODE_GDI, maxX - minX + 1, maxY - minY + 1
grotate WINDOW_ID_WORK, 0, 0, -rotate, ( maxX - minX + 1 ) / scale, ( maxY - minY + 1 ) / scale
onclick goto *st
stop

何が味のある感じですか。ただの劣化じゃーん。失敗作。

インフォメーション

公開日時
2007年9月16日 午前10時45分40秒
最終更新日時
2007年9月16日 午前10時58分33秒
カテゴリ
HSP