せん断 (shearing)

 せん断は,XY平面,YZ平面,XZ平面などの平面上の点を固定して,それ以外の点を軸に平行に移動させる変換で,次の変換行列で表わされます。

        fig210.gif

 Nのような文字を,左下奥を原点に合わせて描き,右上前の点をPとします。この点Pの座標(1.0, 2.0, 2.0)は文字Nの大きさになっています。そして,X軸,Y軸,Z軸は,それぞれ,赤,緑,青で表現されています。

fig080.gif
        | characterN pointP xyzAxes compoundObject |
        characterN := JunOpenGL3dObject characterN.
        characterN paint: ColorValue magenta.
        characterN := characterN translatedBy: characterN boundingBox corner.
        pointP := JunOpenGL3dObject cube.
        pointP := pointP scaledBy: 0.1.
        pointP := pointP translatedBy: characterN boundingBox corner.
        xyzAxes := JunOpenGL3dObject axes.
        xyzAxes := xyzAxes scaledBy: 3.5.
        compoundObject := JunOpenGL3dCompoundObject new.
        compoundObject add: characterN.
        compoundObject add: xyzAxes.
        compoundObject add: pointP.
        compoundObject show.
        Transcript cr; show: pointP boundingBox center printString

 文字NをY軸方向に引っ張って少々傾けてみましょう。配列から変換行列を生成するfromArray:というメッセージを使います。指定する配列の要素順番は,変換行列の要素a, b, c, p, d, e, f, q, g, h, i, r, l, m, n, sに対応します。点Pの座標は(1.0, 3.0, 2.0)になります。

fig220.gif
        | characterN pointP aTransformation xyzAxes compoundObject |
        characterN := JunOpenGL3dObject characterN.
        characterN paint: ColorValue magenta.
        characterN := characterN translatedBy: characterN boundingBox corner.
        pointP := JunOpenGL3dObject cube.
        pointP := pointP scaledBy: 0.1.
        pointP := pointP translatedBy: characterN boundingBox corner.
        aTransformation := Jun3dTransformation fromArray: #(1 0 0 0 0 1 0 0 0 0.5 1 0 0 0 0 1).
        characterN := characterN transform: aTransformation.
        pointP := pointP transform: aTransformation.
        xyzAxes := JunOpenGL3dObject axes.
        xyzAxes := xyzAxes scaledBy: 3.5.
        compoundObject := JunOpenGL3dCompoundObject new.
        compoundObject add: characterN.
        compoundObject add: xyzAxes.
        compoundObject add: pointP.
        compoundObject show.
        Transcript cr; show: pointP boundingBox center printString

参照 (see also)


1997年11月06日 文責: 青木 淳