タグ

algorithmに関するoakiraのブックマーク (21)

  • GRAFICA Obscura

    Curated by Paul Haeberli Welcome to Alpha 0.52 of GRAFICA Obscura, my evolving computer graphics notebook. This is a compilation of technical notes, pictures and essays that I've accumulated over the years. For maximum enjoyment, check the viewing notes provided. Contents Paper and Plotter: A 3D Surface One of my first computer graphics projects is shown here. Laser Cutting for Rapid Manufacturing

    oakira
    oakira 2011/06/26
    tweenerに使われてる・後で読む
  • 滑らかな3次ベジェでゆらゆら曲線を描く - FICC LABS

    FICC 福岡です。 珍しくやる気になりましてAS3関連のエントリー。個人的にゆらゆらした円が描きたくなり、 こんな図を描き出す方法を考えてみました。Flashで滑らかな曲線、といえばgraphics.curveTo()ですが、このcurveToは2次ベジェ曲線しか書く事ができません。ベジェ曲線の詳しい話は省略しますが、できればIllustratorのようにハンドリングが楽な3次ベジェが使いたい。今回はアンカーポイントとコントロールポイントの位置から3次ベジェを計算し、2次ベジェに変換してFlashで描画します。幸いFlashCS3のfl.motion.BezierSegmentクラスが面倒な計算を助けてくれますのでこのクラスを有効活用します。 BezierSegmentを使うには、まず3次ベジェの要素である4つのポイント(上図でのp0,p1,p2,p3)を用います。 var bezier

  • 画像平面分割の高速化(1)【閃光的網站・弛緩複合体 -Review Division-】


     wonderfl fumix fork  ep91ckok forked from: 稿    BitmapData BitmapData 
  • 衝突判定のアルゴリズム

    2 つの図形の衝突判定 (コリジョン判定) のアルゴリズムをまとめます。 図が用意できておらず見難いですが、ご勘弁を。 太字はベクトルを表します。 線分と三角形 線分を p+tl、 三角形を (1-u-v)q0+uq1+vq2 で表します (t, u, v は媒介変数)。 Tomas Moller のアルゴリズム を Cramer の公式で解きます。 0.0≦t≦1.0, 0.0≦u, 0.0≦v, u+v≦1.0 なら交差と判定します。 半直線と三角形 線分と三角形の場合と同様の計算を行います。 0.0≦t, 0.0≦u, 0.0≦v, u+v≦1.0 なら交差と判定します。 点と球 点と球の中心の距離の 2 乗を求めて、 その長さが球の半径の 2 乗以下なら交差と判定します。 線分と球 線分の始点から終点へのベクトルを v、 線分の始点から球の中心へのベクトルを c とします。 v・c

    衝突判定のアルゴリズム
  • BlendMode Math – Andre Michelle

    If you wonder, what blendmodes are doing exactly, you can read this article about blendmodes in common. I tried to work with them in a accurate way to emulate complexer algorithms like animated water waves. Generically you can save a lot of performance, if you need to calculate every single pixel colorvalue from two bitmaps. In most cases, there is a simple solution using ColorTransform and Blendm

    oakira
    oakira 2011/01/23
    ブレンドモードについて
  • blendmodes [Pegtop delphi] (ブレンドモードの説明)

    How do Adobe Photoshop, Micrografx PicturePublisher and Pegtop XFader blend layers? This article tries to give a survey of the most important blend modes, their advantages and disadvantages, and how they are coded. introduction normal mode average mode multiply mode screen mode darken mode lighten mode difference modes overlay mode hard light mode soft light mode dodge modes (color dodge & more) b

    oakira
    oakira 2011/01/23
    ブレンドモードの処理について
  • http://local.wasp.uwa.edu.au/~pbourke/miscellaneous/

  • ベジエ曲線の仕組み (1) - 昔話 - てっく煮ブログ


    asBASIC xy CG15 ActionScript 23
    oakira
    oakira 2011/01/23
    ベジェについて
  • Retrieve user's Network Information AIR 2.0

    Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

    oakira
    oakira 2011/01/23
    2点の緯度経度の求め方
  • NUTSU » [as]ベジェ曲線の分割(2) 破線の描画


    ActionScript t01t /** * t * @param ( 0length ) * @param  * @return t */ public function length2T( len:Number, d:Number=0.1 ):Number{ if( len<0 || len>_length ){ //0NaN return Number.NaN; }else{ //t return seekL( len, d ); } } /** * t *
  • https://www.senocular.com/flash/tutorials/transformmatrix/

    oakira
    oakira 2011/01/23
    matrixの解説
  • polygonal labs » Recursive Dimensional Clustering

    Collision detection with Recursive Dimensional Clustering Brute force comparison Collision detection can be done in many ways. The most straightforward and simplest way is to just test every object against all other objects. Because every object has to test only for others after it in the list of objects, and testing an object with itself is useless, we arrive at the well known brute force compari

    oakira
    oakira 2011/01/23
    衝突判定の高速化
  • もう一つのおっぱい揺れシミュレータの作り方


    flashrod 調   YourAVHost -
    もう一つのおっぱい揺れシミュレータの作り方
  • NUTSU » [as]3次ベジェ切り出し


    12133 3tt=t0t=t1fig1tp0tp1fig2 tp0tp12 2(fig2b)tp1tt1tt=t1t1tt1 1-t0  t1 1-t0 1t1=(t1-t0)/(1.0-t0)  
  • NUTSU » [as]2次ベジェでgetRect


    2getRectShapeDisplayObjectgetRect()Rectangle2() 2 /** * Quadratic Bezier Function * @param t( 01.0 ) * @return  */ /* _point0:Point  _point1:Point  _control:Point  */ function f(t:Number):Point{ var tp:Number = 1.0 - t; return new Point( _point0.x*tp*tp
  • NUTSU » [as]3次ベジェ・2次ベジェ変換

    正直忘れてしまいそうなのでエントリしてみようと思いました。説明はぐだぐだやもですが…。で、3次ベジェから2次ベジェの近似変換について簡単に書いてみます。ソースには2次から3次も書いてありますが、使うことあるのかなぁ的でメモ的に書いているだけです。 今回実装している3次から2次の変換は、まず3次ベジェが一つの2次ベジェで表現できるかチェック、その後段階的に2次ベジェの数を増やして複数の曲線で近似する流れになっています。 一つの2次で表現できるかは下図のような考えで行います。 3次ベジェのコントロール点の延長にある交点を、2次ベジェのコントロール点にしてみるわけです。大抵の場合一致はしません…。 次に複数の曲線の組み合わせを試してみます。基的な方法は3次ベジェを二つの2次ベジェで表現してみることです。 この方法を基として、最初に3次ベジェを二つの2次ベジェ、次に3次ベジェを分割し、それぞれ

  • NUTSU » [as]2次ベジェ曲線の交点


    22Bezier Clipping (FatLine)  ABgetRectfig2   
    oakira
    oakira 2011/01/23
    2次ベジェの交点
  • 著名ソーシャルメディアが使っているアルゴリズムを大公開! | Moz - SEOとインバウンドマーケティングの実践情報

    “アルゴリズム”は、もっとも非人間的なものの代表だともいえる。ソーシャルメディアにとって、そのアルゴリズムが不可欠だというのは、実に皮肉めいている。 僕はこの間、グーグルがどうやってユーザーデータを集めているかについて書いた記事を掲載した(前編、後編)。今回は、著名なソーシャルメディアサイトが、ユーザーデータを活用する上でどのようにアルゴリズムを用いているのか、白日の下にさらそう。 ソーシャルメディアを成り立たせているのは人間の力だが、ユーザーが入力したデータを利用できる状態にする仕組みは、アルゴリズムによって作られている。現在活動している無数のソーシャルメディアサイトで実証済みのことだが、ユーザーの関与とアルゴリズムによる処理ルールの上手いバランスを見出すことは、とても難しくなりがちだ。これから紹介するアルゴリズムは、悪意のないユーザーと結びついて初めてうまくいくものだ。 人気ソーシャル

    著名ソーシャルメディアが使っているアルゴリズムを大公開! | Moz - SEOとインバウンドマーケティングの実践情報
  • Anti-Grain Geometry - Interpolation with Bezier Curves

    Interpolation with Bezier Curves A very simple method of smoothing polygons Initially, there was a question in comp.graphic.algorithms how to interpolate a polygon with a curve in such a way that the resulting curve would be smooth and hit all its vertices. Gernot Hoffmann suggested to use a well-known B-Spline interpolation. Here is his original article. B-Spline works good and it behaves like an

    oakira
    oakira 2011/01/23
    asでの線のスムージングアルゴリズム
  • アルゴリズムの紹介

    ここでは、プログラムなどでよく使用されるアルゴリズムについて紹介したいと思います。 元々は、自分の頭の中を整理することを目的にこのコーナーを開設してみたのですが、最近は継続させることを目的に新しいネタを探すようになってきました。まだまだ面白いテーマがいろいろと残っているので、気力の続く限りは更新していきたいと思います。 今までに紹介したテーマに関しても、新しい内容や変更したい箇所などがたくさんあるため、新規テーマと同時進行で修正作業も行なっています。 アルゴリズムのコーナーで紹介してきたサンプル・プログラムをいくつか公開しています。「ライン・ルーチン」「円弧描画」「ペイント・ルーチン」「グラフィック・パターンの処理」「多角形の塗りつぶし」を一つにまとめた GraphicLibrary と、「確率・統計」より「一般化線形モデル」までを一つにまとめた Statistics を現在は用意していま