jp.nyatla.nyar4psg
クラス NyARPsgBaseClass

java.lang.Object
  上位を拡張 jp.nyatla.nyar4psg.NyARPsgBaseClass
直系の既知のサブクラス:
MultiMarker, SingleMarkerBaseClass

 class NyARPsgBaseClass
extends Object

このクラスは、NyARToolkit for Processingのベースクラスです。 ARToolkit座標系の環境定数、環境設定機能を継承クラスに対して提供します。


フィールドの概要
protected  NyARParam _ar_param
          ARToolkitパラメータのインスタンスです。
protected  NyAR4PsgConfig _config
           
protected  NyARFrustum _frustum
           
protected  NyARPerspectiveRasterReader _preader
          画像抽出用のオブジェクトです。
protected  PMatrix3D _ps_projection
          ProcessingスタイルのProjectionMatrixです。
protected  PApplet _ref_papplet
          参照するAppletのインスタンスです。
protected  PImageRaster _src_raster
          入力画像ラスタです。
static String VERSION
          バージョン文字列です。
 
コンストラクタの概要
protected NyARPsgBaseClass()
          コンストラクタです。
 
メソッドの概要
protected  void initInstance(PApplet parent, String i_cparam_file, int i_width, int i_height, NyAR4PsgConfig i_config)
           
protected static void matResult2GLArray(NyARTransMatResult i_src, double[] o_gl_array)
           
protected static void matResult2PMatrix3D(NyARDoubleMatrix44 i_src, int i_mode, PMatrix3D o_pmatrix)
          変換行列をProcessingのMatrixへ変換します。
protected  PImage pickupMarkerImage(NyARDoubleMatrix44 i_mat, int i_x1, int i_y1, int i_x2, int i_y2, int i_x3, int i_y3, int i_x4, int i_y4, int i_out_w_pix, int i_out_h_pix)
          PImageをラップしたラスタから画像を得ます。
protected static void PMatrix2GLProjection(PMatrix3D i_in, double[] o_out)
           
protected static void PMatrix2GLProjection(PMatrix3D i_in, float[] o_out)
           
protected  PVector screen2MarkerCoordSystem(NyARDoubleMatrix44 i_mat, int i_x, int i_y)
          この関数は、i_mat平面から、自由変形した画像を取得します。
 PMatrix3D setARPerspective()
          この関数は、ARToolKit準拠のProjectionMatrixをProcessingにセットします。
 PMatrix3D setPerspective(PMatrix3D i_projection)
          この関数は、ProjectionMatrixをProcessingにセットします。
 
クラス java.lang.Object から継承されたメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

フィールドの詳細

VERSION

public static final String VERSION
バージョン文字列です。 NyAR4psgのバージョン情報を示します。

関連項目:
定数フィールド値

_ref_papplet

protected PApplet _ref_papplet
参照するAppletのインスタンスです。


_ps_projection

protected final PMatrix3D _ps_projection
ProcessingスタイルのProjectionMatrixです。


_ar_param

protected final NyARParam _ar_param
ARToolkitパラメータのインスタンスです。


_frustum

protected final NyARFrustum _frustum

_config

protected NyAR4PsgConfig _config

_src_raster

protected PImageRaster _src_raster
入力画像ラスタです。PImageをラップします。継承クラスで入力画像をセットします。


_preader

protected NyARPerspectiveRasterReader _preader
画像抽出用のオブジェクトです。_src_rasterを参照します。

コンストラクタの詳細

NyARPsgBaseClass

protected NyARPsgBaseClass()
コンストラクタです。

メソッドの詳細

initInstance

protected void initInstance(PApplet parent,
                            String i_cparam_file,
                            int i_width,
                            int i_height,
                            NyAR4PsgConfig i_config)
                     throws NyARException
例外:
NyARException

setARPerspective

public PMatrix3D setARPerspective()
この関数は、ARToolKit準拠のProjectionMatrixをProcessingにセットします。 関数を実行すると、ProcessingのProjectionMatrixがARToolKitのカメラパラメータのものに変わり、映像にマッチした描画ができるようになります。 ProcessingのデフォルトFrustumに戻すときは、PGraphics3D.perspective()を使います。 Frustumの有効期間は、次にPGraphics3D.perspective()PGraphics3D.perspective()をコールするまでです。

戻り値:
置き換えら得る前のprojectionMatrixを返します。

setPerspective

public PMatrix3D setPerspective(PMatrix3D i_projection)
この関数は、ProjectionMatrixをProcessingにセットします。

パラメータ:
i_projection - 設定するProjectionMatrixを指定します。
戻り値:
置き換えら得る前のprojectionMatrixを返します。

Processing/1.3になったら、PApplet#matrixMode使ってきちんと使えるようになると思う。 今は無理なので、frustum経由


PMatrix2GLProjection

protected static void PMatrix2GLProjection(PMatrix3D i_in,
                                           float[] o_out)

PMatrix2GLProjection

protected static void PMatrix2GLProjection(PMatrix3D i_in,
                                           double[] o_out)

matResult2GLArray

protected static void matResult2GLArray(NyARTransMatResult i_src,
                                        double[] o_gl_array)

matResult2PMatrix3D

protected static void matResult2PMatrix3D(NyARDoubleMatrix44 i_src,
                                          int i_mode,
                                          PMatrix3D o_pmatrix)
変換行列をProcessingのMatrixへ変換します。

パラメータ:
i_src -
i_mode -
o_pmatrix -

screen2MarkerCoordSystem

protected PVector screen2MarkerCoordSystem(NyARDoubleMatrix44 i_mat,
                                           int i_x,
                                           int i_y)
この関数は、i_mat平面から、自由変形した画像を取得します。

パラメータ:
i_mat -
i_x -
i_y -
戻り値:

pickupMarkerImage

protected PImage pickupMarkerImage(NyARDoubleMatrix44 i_mat,
                                   int i_x1,
                                   int i_y1,
                                   int i_x2,
                                   int i_y2,
                                   int i_x3,
                                   int i_y3,
                                   int i_x4,
                                   int i_y4,
                                   int i_out_w_pix,
                                   int i_out_h_pix)
PImageをラップしたラスタから画像を得ます。

パラメータ:
i_mat -
i_x1 -
i_y1 -
i_x2 -
i_y2 -
i_x3 -
i_y3 -
i_x4 -
i_y4 -
i_out_w_pix -
i_out_h_pix -
戻り値:


NyAR4psgは、NyARToolkit projectで開発している、NyARToolKitのProcessingフロントエンドです。ソースコードは、sorceforge.jpNyARToolkitからダウンロードできます。
Copyright 2011 NyARToolkit project. All rights reserved.