| 33 |
import processing.core.*; |
import processing.core.*; |
| 34 |
import processing.opengl.*; |
import processing.opengl.*; |
| 35 |
|
|
| 36 |
|
|
| 37 |
import jp.nyatla.nyartoolkit.*; |
import jp.nyatla.nyartoolkit.*; |
| 38 |
import jp.nyatla.nyartoolkit.core.param.*; |
import jp.nyatla.nyartoolkit.core.param.*; |
| 39 |
import jp.nyatla.nyartoolkit.core.transmat.*; |
import jp.nyatla.nyartoolkit.core.transmat.*; |
| 40 |
|
import jp.nyatla.nyartoolkit.core.types.NyARDoublePoint3d; |
| 41 |
import jp.nyatla.nyartoolkit.core.types.matrix.NyARDoubleMatrix44; |
import jp.nyatla.nyartoolkit.core.types.matrix.NyARDoubleMatrix44; |
| 42 |
|
|
| 43 |
|
|
| 263 |
o_pmatrix.m31 = 0.0f; |
o_pmatrix.m31 = 0.0f; |
| 264 |
o_pmatrix.m32 = 0.0f; |
o_pmatrix.m32 = 0.0f; |
| 265 |
o_pmatrix.m33 = 1.0f; |
o_pmatrix.m33 = 1.0f; |
| 266 |
if(i_mode==MultiMarker.CS_LEFT_HAND) |
if(i_mode==CS_LEFT_HAND) |
| 267 |
{ |
{ |
| 268 |
o_pmatrix.apply(_lh_mat); |
o_pmatrix.apply(_lh_mat); |
| 269 |
} |
} |
| 270 |
|
} |
| 271 |
|
/** |
| 272 |
|
* この関数は、i_mat平面から、自由変形した画像を取得します。 |
| 273 |
|
* @param i_mat |
| 274 |
|
* @param i_id |
| 275 |
|
* @param i_x |
| 276 |
|
* @param i_y |
| 277 |
|
* @return |
| 278 |
|
*/ |
| 279 |
|
protected PVector screen2MarkerCoordSystem(NyARDoubleMatrix44 i_mat,int i_x,int i_y) |
| 280 |
|
{ |
| 281 |
|
PVector ret=new PVector(); |
| 282 |
|
NyARDoublePoint3d tmp=new NyARDoublePoint3d(); |
| 283 |
|
this._frustum.unProjectOnMatrix(i_x, i_y,i_mat,tmp); |
| 284 |
|
ret.x=(float)tmp.x; |
| 285 |
|
ret.y=(float)tmp.y; |
| 286 |
|
ret.z=(float)tmp.z; |
| 287 |
|
if(this._coord_system==CS_LEFT_HAND){ |
| 288 |
|
ret.x*=-1; |
| 289 |
|
} |
| 290 |
|
return ret; |
| 291 |
} |
} |
| 292 |
/** |
/** |
| 293 |
* この関数は、スクリーン座標を撮像点座標に変換します。 |
* この関数は、スクリーン座標を撮像点座標に変換します。 |