幾個月之前透過 blog 識到一位 designer Bryan (哈哈~ blog 的確有佢 networking 既用途~ 就算你幾個月唔 update 都好 =.=||)

Bryan 想我幫佢手為 Yahoo! 香港既立法會選舉網頁寫一個 Flash 既 interactive banner 一聽到 Yahoo! 就二話不說即刻應承~ 相信一定係好好既 experience~ (結果… 唔… 原來係咁… 真係估唔到…)

Anyway… 講返個 banner

Banner 裡面其中一個 function 係要將一 d avatars randomly placed in 一個 specified area 起初我只係用簡單既切餅方法將一個長方形切成等份 然後 randomly place d avatar 入 d 餅入面…

好明顯… 結果好生硬…

之後嘗試唔用餅~ 直接做 random placement 然後每一次 place 既時候都 check hit area~ if hit 就 replace 結果好好多~ 而且速度完全 acceptable

跟住o既問題就係點樣可以只從o係一個 specific area 裡面 random place 呢? 由於要就返立法會大樓o既 shape~ 所以個 specific area 會係 irregular shape 當然啦~ 要準確的話一定係靠計數 但係計數o既問題係唔 flexible 同埋唔容易 maintain 最後我用左好多長方形去 approximate placeable area 然後每次 More >