| 28 |
package jp.nyatla.nyar4psg; |
package jp.nyatla.nyar4psg; |
| 29 |
|
|
| 30 |
|
|
| 31 |
import javax.media.opengl.GL; |
import javax.media.opengl.*; |
| 32 |
|
|
| 33 |
import processing.core.*; |
import processing.core.*; |
| 34 |
import processing.opengl.PGraphicsOpenGL; |
import processing.opengl.*; |
| 35 |
|
|
| 36 |
import jp.nyatla.nyartoolkit.*; |
import jp.nyatla.nyartoolkit.*; |
| 37 |
import jp.nyatla.nyartoolkit.core.param.*; |
import jp.nyatla.nyartoolkit.core.param.*; |
| 63 |
* バージョン文字列です。 |
* バージョン文字列です。 |
| 64 |
* NyAR4psgのバージョン情報を示します。 |
* NyAR4psgのバージョン情報を示します。 |
| 65 |
*/ |
*/ |
| 66 |
public final static String VERSION = "NyAR4psg/0.5.1;NyARToolkit for java/3.0.0+;ARToolKit/2.72.1"; |
public final static String VERSION = "NyAR4psg/0.9.0;NyARToolkit for java/3.0.0+;ARToolKit/2.72.1"; |
| 67 |
/** ProcessingスタイルのProjectionMatrixです。*/ |
/** ProcessingスタイルのProjectionMatrixです。*/ |
| 68 |
protected PMatrix3D _ps_projection=new PMatrix3D(); |
protected PMatrix3D _ps_projection=new PMatrix3D(); |
| 69 |
/** 参照するAppletのインスタンスです。*/ |
/** 参照するAppletのインスタンスです。*/ |
| 132 |
*/ |
*/ |
| 133 |
public PMatrix3D setPerspective(PMatrix3D i_projection) |
public PMatrix3D setPerspective(PMatrix3D i_projection) |
| 134 |
{ |
{ |
| 135 |
if(!(this._ref_papplet.g instanceof PGraphicsOpenGL)){ |
if(!(this._ref_papplet.g instanceof PGraphics3D)){ |
| 136 |
this._ref_papplet.die("NyAR4Psg require PGraphicsOpenGL instance."); |
this._ref_papplet.die("NyAR4Psg require PGraphics3D instance."); |
| 137 |
} |
} |
| 138 |
PGraphics3D g=(PGraphics3D)this._ref_papplet.g; |
PGraphics3D g=(PGraphics3D)this._ref_papplet.g; |
| 139 |
//現在のProjectionMatrixを保存する。 |
//現在のProjectionMatrixを保存する。 |
| 141 |
ret.set(g.projection); |
ret.set(g.projection); |
| 142 |
//ProjectionMatrixの設定 |
//ProjectionMatrixの設定 |
| 143 |
g.projection.set(i_projection); |
g.projection.set(i_projection); |
| 144 |
|
//OpenGLの時はちょっと細工 |
| 145 |
if(this._ref_papplet.g instanceof PGraphicsOpenGL) |
if(this._ref_papplet.g instanceof PGraphicsOpenGL) |
| 146 |
{ |
{ |
| 147 |
GL gl=((PGraphicsOpenGL)g).gl; |
GL gl=((PGraphicsOpenGL)g).gl; |