assert(this._target_type==RT_KNOWN);\r
//RECT座標を作成\r
NyARDoublePoint3d[] da4=this._ref_pool._wk_da3_4;\r
- da4[0].x=i_x; da4[0].y=i_y; da4[0].z=0;\r
- da4[1].x=i_x+i_w;da4[1].y=i_y; da4[1].z=0;\r
- da4[2].x=i_x+i_w;da4[2].y=i_y+i_h;da4[2].z=0;\r
- da4[3].x=i_x; da4[3].y=i_y+i_h;da4[3].z=0;\r
+ da4[0].x=i_x; da4[0].y=i_y+i_h;da4[0].z=0;//LB\r
+ da4[1].x=i_x+i_w;da4[1].y=i_y+i_h;da4[1].z=0;//RB\r
+ da4[2].x=i_x+i_w;da4[2].y=i_y; da4[2].z=0;//RT\r
+ da4[3].x=i_x; da4[3].y=i_y; da4[3].z=0;//LT\r
return getRgbPatt3d(i_src,da4,null,i_resolution,o_raster);\r
}\r
\r
final int freq_table[]=this._freq_table;\r
//初期化\r
final double[] cpara=this._cparam;\r
-// final INyARRgbPixelReader reader=this._raster.getRgbPixelReader();\r
final int[] ref_x=this._ref_x;\r
final int[] ref_y=this._ref_y;\r
final int[] pixcel_temp=this._pixcel_temp;\r
\r
public boolean readDataBits(INyARRgbPixelReader i_reader,NyARIntSize i_raster_size,PerspectivePixelReader.TThreshold i_th,MarkerPattEncoder o_bitbuffer)throws NyARException\r
{\r
+ final int raster_width=i_raster_size.w;\r
+ final int raster_height=i_raster_size.h;\r
+ \r
final double[] index_x=this.__readDataBits_index_bit_x;\r
final double[] index_y=this.__readDataBits_index_bit_y;\r
\r
\r
int pt=0;\r
for(int i2=0;i2<resolution;i2++)\r
- { \r
-\r
+ {\r
+ int xx,yy;\r
double d;\r
double cx0=1+index_x[i2*2+0];\r
double cx1=1+index_x[i2*2+1];\r
double cpx3_1=cpara_3*cx1;\r
\r
d=cp6_0+cpy0_7;\r
- ref_x[pt]=(int)((cpx0_0+cpy0_12)/d);\r
- ref_y[pt]=(int)((cpx3_0+cpy0_45)/d);\r
+ ref_x[pt]=xx=(int)((cpx0_0+cpy0_12)/d);\r
+ ref_y[pt]=yy=(int)((cpx3_0+cpy0_45)/d);\r
+ if(xx<0 || xx>=raster_width || yy<0 || yy>=raster_height)\r
+ {\r
+ ref_x[pt]=xx<0?0:(xx>=raster_width?raster_width-1:raster_width);\r
+ ref_y[pt]=yy<0?0:(yy>=raster_height?raster_height-1:raster_height);\r
+ }\r
pt++;\r
\r
d=cp6_0+cpy1_7;\r
- ref_x[pt]=(int)((cpx0_0+cpy1_12)/d);\r
- ref_y[pt]=(int)((cpx3_0+cpy1_45)/d);\r
+ ref_x[pt]=xx=(int)((cpx0_0+cpy1_12)/d);\r
+ ref_y[pt]=yy=(int)((cpx3_0+cpy1_45)/d);\r
+ if(xx<0 || xx>=raster_width || yy<0 || yy>=raster_height)\r
+ {\r
+ ref_x[pt]=xx<0?0:(xx>=raster_width?raster_width-1:raster_width);\r
+ ref_y[pt]=yy<0?0:(yy>=raster_height?raster_height-1:raster_height);\r
+ }\r
pt++;\r
\r
d=cp6_1+cpy0_7;\r
- ref_x[pt]=(int)((cpx0_1+cpy0_12)/d);\r
- ref_y[pt]=(int)((cpx3_1+cpy0_45)/d);\r
+ ref_x[pt]=xx=(int)((cpx0_1+cpy0_12)/d);\r
+ ref_y[pt]=yy=(int)((cpx3_1+cpy0_45)/d);\r
+ if(xx<0 || xx>=raster_width || yy<0 || yy>=raster_height)\r
+ {\r
+ ref_x[pt]=xx<0?0:(xx>=raster_width?raster_width-1:raster_width);\r
+ ref_y[pt]=yy<0?0:(yy>=raster_height?raster_height-1:raster_height);\r
+ }\r
pt++;\r
\r
d=cp6_1+cpy1_7;\r
- ref_x[pt]=(int)((cpx0_1+cpy1_12)/d);\r
- ref_y[pt]=(int)((cpx3_1+cpy1_45)/d);\r
+ ref_x[pt]=xx=(int)((cpx0_1+cpy1_12)/d);\r
+ ref_y[pt]=yy=(int)((cpx3_1+cpy1_45)/d);\r
+ if(xx<0 || xx>=raster_width || yy<0 || yy>=raster_height)\r
+ {\r
+ ref_x[pt]=xx<0?0:(xx>=raster_width?raster_width-1:raster_width);\r
+ ref_y[pt]=yy<0?0:(yy>=raster_height?raster_height-1:raster_height);\r
+ }\r
pt++;\r
}\r
- //ここ、値チェックしてないけど? →周波数出すときに周辺部でエラー出したら落ちるようにしてるから平気では?エラーはいたら教えて。\r
//1行分のピクセルを取得(場合によっては専用アクセサを書いた方がいい)\r
i_reader.getPixelSet(ref_x,ref_y,resolution*4,pixcel_temp);\r
//グレースケールにしながら、line→mapへの転写\r
p++;\r
}\r
}\r
-/* \r
- for(int i=0;i<225*4;i++){\r
- this.vertex_x[i]=0;\r
- this.vertex_y[i]=0;\r
- }\r
- for(int i=0;i<(resolution)*2;i++){\r
- for(int i2=0;i2<(resolution)*2;i2++){\r
- this.vertex_x[i*(resolution)*2+i2]=(int)index_x[i2];\r
- this.vertex_y[i*(resolution)*2+i2]=(int)index_y[i];\r
- \r
- }\r
- }\r
-*/ return true;\r
+ return true;\r
}\r
public boolean setSquare(NyARIntPoint2d[] i_vertex) throws NyARException\r
{\r
{\r
this.current_id = (this.current_id << 8) | code.packet[i];\r
}\r
+ System.out.println("NyARId:"+this.current_id);\r
}\r
this.transmat = null;\r
}\r
synchronized(this._sync_object){\r
current_code=i_code;\r
}\r
+ System.out.println("Marker Number:"+i_code);\r
}\r
protected void onLeaveHandler()\r
{\r
\r
/**\r
* Java3Dサンプルプログラム\r
- * 単一マーカー追跡用のBehaviorを使って、背景と1個のマーカーに連動した\r
- * TransformGroupを動かします。\r
+ * Hiroマーカ1個の上に、カラーキューブを表示します。\r
+ * このサンプルでは、Java3dのTransformGroupをマーカの位置姿勢に合致させるBehaviorと、\r
+ * 背景のオブジェクト一つを使います。\r
*\r
*/\r
public class NyARJava3D extends JFrame implements NyARSingleMarkerBehaviorListener\r
+/* \r
+ * PROJECT: NyARToolkit JOGL sample program.\r
+ * --------------------------------------------------------------------------------\r
+ * The MIT License\r
+ * Copyright (c) 2008-2011 nyatla\r
+ * airmail(at)ebony.plala.or.jp\r
+ * http://nyatla.jp/nyartoolkit/\r
+ * \r
+ * Permission is hereby granted, free of charge, to any person obtaining a copy\r
+ * of this software and associated documentation files (the "Software"), to deal\r
+ * in the Software without restriction, including without limitation the rights\r
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r
+ * copies of the Software, and to permit persons to whom the Software is\r
+ * furnished to do so, subject to the following conditions:\r
+ * The above copyright notice and this permission notice shall be included in\r
+ * all copies or substantial portions of the Software.\r
+ * \r
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\r
+ * THE SOFTWARE.\r
+ * \r
+ */\r
package jp.nyatla.nyartoolkit.rpf.sample;\r
\r
import java.awt.Color;\r
\r
public Test_NyARRealityGl_ARMarker(NyARParam i_param) throws NyARException\r
{\r
- Frame frame = new Frame("NyARReality on OpenGL");\r
+ Frame frame = new Frame("NyARToolkit+RPF["+this.getClass().getName()+"]");\r
\r
// キャプチャの準備\r
JmfCaptureDeviceList devlist = new JmfCaptureDeviceList();\r
this._capture.setOnCapture(this);\r
//Realityの構築\r
i_param.changeScreenSize(SCREEN_X, SCREEN_Y); \r
- //キャプチャ画像と互換性のあるRealitySourceを構築\r
- this._src=new NyARRealitySource_Jmf(this._capture.getCaptureFormat(),i_param.getDistortionFactor(),2,100);\r
+ //キャプチャ画像と互換性のあるRealitySourceを構築(樽型歪みの少ないカメラの時は、distortionFactorをnullにすること。)\r
+// this._src=new NyARRealitySource_Jmf(this._capture.getCaptureFormat(),i_param.getDistortionFactor(),2,100);\r
+ this._src=new NyARRealitySource_Jmf(this._capture.getCaptureFormat(),null,2,100);\r
//OpenGL互換のRealityを構築 \r
this._reality=new NyARRealityGl(i_param.getPerspectiveProjectionMatrix(),i_param.getScreenSize(),10,10000,3,10);\r
//マーカライブラリ(ARTKId)の構築\r
{\r
}\r
\r
- private final static String PARAM_FILE = "../Data/camera_para.dat";\r
- private final static String PATT_HIRO = "../Data/patt.hiro";\r
- private final static String PATT_KANJI = "../Data/patt.kanji";\r
+ private final static String PARAM_FILE = "../../Data/camera_para.dat";\r
+ private final static String PATT_HIRO = "../../Data/patt.hiro";\r
+ private final static String PATT_KANJI = "../../Data/patt.kanji";\r
\r
public static void main(String[] args)\r
{\r
+/* \r
+ * PROJECT: NyARToolkit JOGL sample program.\r
+ * --------------------------------------------------------------------------------\r
+ * The MIT License\r
+ * Copyright (c) 2008-2011 nyatla\r
+ * airmail(at)ebony.plala.or.jp\r
+ * http://nyatla.jp/nyartoolkit/\r
+ * \r
+ * Permission is hereby granted, free of charge, to any person obtaining a copy\r
+ * of this software and associated documentation files (the "Software"), to deal\r
+ * in the Software without restriction, including without limitation the rights\r
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r
+ * copies of the Software, and to permit persons to whom the Software is\r
+ * furnished to do so, subject to the following conditions:\r
+ * The above copyright notice and this permission notice shall be included in\r
+ * all copies or substantial portions of the Software.\r
+ * \r
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\r
+ * THE SOFTWARE.\r
+ * \r
+ */\r
package jp.nyatla.nyartoolkit.rpf.sample;\r
\r
import java.awt.Color;\r
import jp.nyatla.nyartoolkit.core.types.NyARIntPoint2d;\r
import jp.nyatla.nyartoolkit.core.types.matrix.NyARDoubleMatrix44;\r
import jp.nyatla.nyartoolkit.rpf.mklib.ASyncIdMarkerTable;\r
-import jp.nyatla.nyartoolkit.rpf.mklib.RawbitSerialIdTable;\r
import jp.nyatla.nyartoolkit.rpf.mklib.ASyncIdMarkerTable.IResultListener;\r
import jp.nyatla.nyartoolkit.rpf.reality.nyartk.NyARRealityTarget;\r
import jp.nyatla.nyartoolkit.rpf.reality.nyartk.NyARRealityTargetList;\r
\r
public Test_NyARRealityGl_AsyncIdMarker(NyARParam i_param) throws NyARException\r
{\r
- Frame frame = new Frame("NyARReality on OpenGL");\r
+ Frame frame = new Frame("NyARToolkit+RPF["+this.getClass().getName()+"]");\r
\r
// キャプチャの準備\r
JmfCaptureDeviceList devlist = new JmfCaptureDeviceList();\r
//Realityの構築\r
i_param.changeScreenSize(SCREEN_X, SCREEN_Y); \r
//キャプチャ画像と互換性のあるRealitySourceを構築\r
- this._src=new NyARRealitySource_Jmf(this._capture.getCaptureFormat(),i_param.getDistortionFactor(),1,100);\r
+// this._src=new NyARRealitySource_Jmf(this._capture.getCaptureFormat(),i_param.getDistortionFactor(),2,100);\r
+ this._src=new NyARRealitySource_Jmf(this._capture.getCaptureFormat(),null,2,100);\r
//OpenGL互換のRealityを構築 \r
this._reality=new NyARRealityGl(i_param.getPerspectiveProjectionMatrix(),i_param.getScreenSize(),10,10000,3,3);\r
//非同期マーカライブラリ(NyId)の構築\r
{\r
}\r
\r
- private final static String PARAM_FILE = "../Data/camera_para.dat";\r
+ private final static String PARAM_FILE = "../../Data/camera_para.dat";\r
\r
public static void main(String[] args)\r
{\r
+/* \r
+ * PROJECT: NyARToolkit JOGL sample program.\r
+ * --------------------------------------------------------------------------------\r
+ * The MIT License\r
+ * Copyright (c) 2008-2011 nyatla\r
+ * airmail(at)ebony.plala.or.jp\r
+ * http://nyatla.jp/nyartoolkit/\r
+ * \r
+ * Permission is hereby granted, free of charge, to any person obtaining a copy\r
+ * of this software and associated documentation files (the "Software"), to deal\r
+ * in the Software without restriction, including without limitation the rights\r
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r
+ * copies of the Software, and to permit persons to whom the Software is\r
+ * furnished to do so, subject to the following conditions:\r
+ * The above copyright notice and this permission notice shall be included in\r
+ * all copies or substantial portions of the Software.\r
+ * \r
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\r
+ * THE SOFTWARE.\r
+ * \r
+ */\r
package jp.nyatla.nyartoolkit.rpf.sample;\r
\r
import java.awt.Color;\r
\r
import javax.media.Buffer;\r
import javax.media.opengl.*;\r
-import javax.media.opengl.glu.GLU;\r
\r
import jp.nyatla.nyartoolkit.NyARException;\r
import jp.nyatla.nyartoolkit.core.param.NyARParam;\r
-import jp.nyatla.nyartoolkit.core.param.NyARPerspectiveProjectionMatrix;\r
-import jp.nyatla.nyartoolkit.core.transmat.NyARTransMatResult;\r
import jp.nyatla.nyartoolkit.core.types.NyARDoublePoint2d;\r
import jp.nyatla.nyartoolkit.core.types.NyARIntPoint2d;\r
-import jp.nyatla.nyartoolkit.core.types.NyARIntSize;\r
import jp.nyatla.nyartoolkit.core.types.matrix.NyARDoubleMatrix44;\r
-import jp.nyatla.nyartoolkit.detector.NyARSingleDetectMarker;\r
-import jp.nyatla.nyartoolkit.rpf.mklib.ARTKMarkerTable;\r
import jp.nyatla.nyartoolkit.rpf.mklib.CardDetect;\r
-import jp.nyatla.nyartoolkit.rpf.mklib.RawbitSerialIdTable;\r
import jp.nyatla.nyartoolkit.rpf.reality.nyartk.NyARRealityTarget;\r
import jp.nyatla.nyartoolkit.rpf.reality.nyartk.NyARRealityTargetList;\r
import jp.nyatla.nyartoolkit.rpf.realitysource.nyartk.NyARRealitySource_Jmf;\r
import jp.nyatla.nyartoolkit.jmf.utils.JmfCaptureDeviceList;\r
import jp.nyatla.nyartoolkit.jmf.utils.JmfCaptureListener;\r
import jp.nyatla.nyartoolkit.jogl.utils.NyARGLDrawUtil;\r
-import jp.nyatla.nyartoolkit.jogl.utils.NyARGLUtil;\r
import jp.nyatla.nyartoolkit.rpf.reality.nyartk.gl.NyARRealityGl;\r
\r
import com.sun.opengl.util.Animator;\r
public Test_NyARRealityGl_CreditCardDetect(NyARParam i_param) throws NyARException\r
{\r
clock=0;\r
- Frame frame = new Frame("CreditCard sample on OpenGL");\r
+ Frame frame = new Frame("NyARToolkit+RPF["+this.getClass().getName()+"]");\r
\r
// キャプチャの準備\r
JmfCaptureDeviceList devlist = new JmfCaptureDeviceList();\r
//Realityの構築\r
i_param.changeScreenSize(SCREEN_X, SCREEN_Y); \r
//キャプチャ画像と互換性のあるRealitySourceを構築\r
- this._src=new NyARRealitySource_Jmf(this._capture.getCaptureFormat(),i_param.getDistortionFactor(),2,100);\r
+// this._src=new NyARRealitySource_Jmf(this._capture.getCaptureFormat(),i_param.getDistortionFactor(),2,100);\r
+ this._src=new NyARRealitySource_Jmf(this._capture.getCaptureFormat(),null,2,100);\r
//OpenGL互換のRealityを構築 \r
this._reality=new NyARRealityGl(i_param.getPerspectiveProjectionMatrix(),i_param.getScreenSize(),10,10000,3,10);\r
//マーカライブラリ(比率推定)の構築\r
{\r
}\r
\r
- private final static String PARAM_FILE = "../Data/camera_para.dat";\r
+ private final static String PARAM_FILE = "../../Data/camera_para.dat";\r
\r
public static void main(String[] args)\r
{\r
+/* \r
+ * PROJECT: NyARToolkit JOGL sample program.\r
+ * --------------------------------------------------------------------------------\r
+ * The MIT License\r
+ * Copyright (c) 2008-2011 nyatla\r
+ * airmail(at)ebony.plala.or.jp\r
+ * http://nyatla.jp/nyartoolkit/\r
+ * \r
+ * Permission is hereby granted, free of charge, to any person obtaining a copy\r
+ * of this software and associated documentation files (the "Software"), to deal\r
+ * in the Software without restriction, including without limitation the rights\r
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r
+ * copies of the Software, and to permit persons to whom the Software is\r
+ * furnished to do so, subject to the following conditions:\r
+ * The above copyright notice and this permission notice shall be included in\r
+ * all copies or substantial portions of the Software.\r
+ * \r
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\r
+ * THE SOFTWARE.\r
+ * \r
+ */\r
package jp.nyatla.nyartoolkit.rpf.sample;\r
\r
import java.awt.Color;\r
\r
public Test_NyARRealityGl_IdMarker(NyARParam i_param) throws NyARException\r
{\r
- Frame frame = new Frame("NyARReality on OpenGL");\r
+ Frame frame = new Frame("NyARToolkit+RPF["+this.getClass().getName()+"]");\r
\r
// キャプチャの準備\r
JmfCaptureDeviceList devlist = new JmfCaptureDeviceList();\r
//Realityの構築\r
i_param.changeScreenSize(SCREEN_X, SCREEN_Y); \r
//キャプチャ画像と互換性のあるRealitySourceを構築\r
- this._src=new NyARRealitySource_Jmf(this._capture.getCaptureFormat(),i_param.getDistortionFactor(),1,100);\r
+// this._src=new NyARRealitySource_Jmf(this._capture.getCaptureFormat(),i_param.getDistortionFactor(),2,100);\r
+ this._src=new NyARRealitySource_Jmf(this._capture.getCaptureFormat(),null,2,100);\r
//OpenGL互換のRealityを構築 \r
this._reality=new NyARRealityGl(i_param.getPerspectiveProjectionMatrix(),i_param.getScreenSize(),10,10000,3,10);\r
//マーカライブラリ(NyId)の構築\r
{\r
}\r
\r
- private final static String PARAM_FILE = "../Data/camera_para.dat";\r
+ private final static String PARAM_FILE = "../../Data/camera_para.dat";\r
\r
public static void main(String[] args)\r
{\r
+/* \r
+ * PROJECT: NyARToolkit JOGL sample program.\r
+ * --------------------------------------------------------------------------------\r
+ * The MIT License\r
+ * Copyright (c) 2008-2011 nyatla\r
+ * airmail(at)ebony.plala.or.jp\r
+ * http://nyatla.jp/nyartoolkit/\r
+ * \r
+ * Permission is hereby granted, free of charge, to any person obtaining a copy\r
+ * of this software and associated documentation files (the "Software"), to deal\r
+ * in the Software without restriction, including without limitation the rights\r
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r
+ * copies of the Software, and to permit persons to whom the Software is\r
+ * furnished to do so, subject to the following conditions:\r
+ * The above copyright notice and this permission notice shall be included in\r
+ * all copies or substantial portions of the Software.\r
+ * \r
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\r
+ * THE SOFTWARE.\r
+ * \r
+ */\r
package jp.nyatla.nyartoolkit.rpf.sample;\r
\r
import java.awt.Frame;\r
public void mouseReleased(MouseEvent e){}\r
public Test_NyARRealityGl_ScreenPos(NyARParam i_param) throws NyARException\r
{\r
- Frame frame = new Frame("NyARReality on OpenGL");\r
+ Frame frame = new Frame("NyARToolkit+RPF["+this.getClass().getName()+"]");\r
\r
// キャプチャの準備\r
JmfCaptureDeviceList devlist = new JmfCaptureDeviceList();\r
//Realityの構築\r
i_param.changeScreenSize(SCREEN_X, SCREEN_Y); \r
//キャプチャ画像と互換性のあるRealitySourceを構築\r
- this._src=new NyARRealitySource_Jmf(this._capture.getCaptureFormat(),i_param.getDistortionFactor(),2,100);\r
+// this._src=new NyARRealitySource_Jmf(this._capture.getCaptureFormat(),i_param.getDistortionFactor(),2,100);\r
+ this._src=new NyARRealitySource_Jmf(this._capture.getCaptureFormat(),null,2,100);\r
//OpenGL互換のRealityを構築\r
this._reality=new NyARRealityGl(i_param.getPerspectiveProjectionMatrix(),i_param.getScreenSize(),10,10000,3,3);\r
//マーカライブラリ(NyId)の構築\r
{\r
}\r
\r
- private final static String PARAM_FILE = "../Data/camera_para.dat";\r
+ private final static String PARAM_FILE = "../../Data/camera_para.dat";\r
\r
public static void main(String[] args)\r
{\r
\r
/**\r
* NyARRealityのテストプログラム。動作保証なし。\r
+ * \r
+ * ターゲットプロパティの取得実験用のテストコードです。\r
+ * クリックしたマーカや、その平面周辺から、画像を取得するテストができます。\r
*\r
*/\r
\r
//3d(カメラ)\r
{\r
NyARDoublePoint3d[] p=NyARDoublePoint3d.createArray(4);\r
- p[3].x=-40;p[3].y=-40;p[3].z=0;\r
- p[2].x=40; p[2].y=-40;p[2].z=0;\r
+ p[0].x=-60;p[0].y=40 ;p[0].z=0;\r
p[1].x=40; p[1].y=40 ;p[1].z=0;\r
- p[0].x=-40;p[0].y=40 ;p[0].z=0;\r
+ p[2].x=40; p[2].y=-40;p[2].z=0;\r
+ p[3].x=-60;p[3].y=-40;p[3].z=0;\r
this._reality.getRgbPatt3d(this._input_source.reality_in,p, rt.refTransformMatrix(), 1, bmp);\r
this.getGraphics().drawImage(bmp.getBufferedImage(),this.getInsets().left+100,this.getInsets().top+240,null);\r
}\r
//3d(Target)\r
{\r
NyARDoublePoint3d[] p=NyARDoublePoint3d.createArray(4);\r
- p[3].x=-40;p[3].y=-40;p[3].z=0;\r
- p[2].x=40; p[2].y=-40;p[2].z=0;\r
+ p[0].x=-40;p[0].y=40 ;p[0].z=0;\r
p[1].x=40; p[1].y=40 ;p[1].z=0;\r
- p[0].x=-80;p[0].y=40 ;p[0].z=0;\r
+ p[2].x=40; p[2].y=-40;p[2].z=0;\r
+ p[3].x=-40;p[3].y=-40;p[3].z=0;\r
rt.getRgbPatt3d(this._input_source.reality_in,p,null, 1, bmp);\r
this.getGraphics().drawImage(bmp.getBufferedImage(),this.getInsets().left+200,this.getInsets().top+240,null);\r
}\r
//3d(Target)\r
{\r
- rt.getRgbRectPatt3d(this._input_source.reality_in,-80,-80,80,80,1, bmp);\r
+ rt.getRgbRectPatt3d(this._input_source.reality_in,-40,-40,80,80,1, bmp);\r
this.getGraphics().drawImage(bmp.getBufferedImage(),this.getInsets().left+300,this.getInsets().top+240,null);\r
}\r
break;\r
\r
NyARParam _param;\r
\r
- private final static String SAMPLE_FILES = "../Data/320x240ABGR.png";\r
- private final static String PARAM_FILE = "../Data/camera_para.dat";\r
+ private final static String SAMPLE_FILES = "../../Data/320x240ABGR.png";\r
+ private final static String PARAM_FILE = "../../Data/camera_para.dat";\r
\r
private static final long serialVersionUID = -2110888320986446576L;\r
\r
g.drawString("[D]("+t.grab_rate+")",r.x,r.y);\r
}\r
\r
- private final static String PATT_HIRO = "../Data/patt.hiro";\r
+ private final static String PATT_HIRO = "../../Data/patt.hiro";\r
\r
\r
\r