+++ /dev/null
-/* \r
- * PROJECT: NyARToolkit JOGL utilities.\r
- * --------------------------------------------------------------------------------\r
- * This work is based on the original ARToolKit developed by\r
- * Hirokazu Kato\r
- * Mark Billinghurst\r
- * HITLab, University of Washington, Seattle\r
- * http://www.hitl.washington.edu/artoolkit/\r
- *\r
- * The NyARToolkit is Java version ARToolkit class library.\r
- * Copyright (C)2008 R.Iizuka\r
- *\r
- * This program is free software; you can redistribute it and/or\r
- * modify it under the terms of the GNU General Public License\r
- * as published by the Free Software Foundation; either version 2\r
- * of the License, or (at your option) any later version.\r
- * \r
- * This program is distributed in the hope that it will be useful,\r
- * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
- * GNU General Public License for more details.\r
- * \r
- * You should have received a copy of the GNU General Public License\r
- * along with this framework; if not, write to the Free Software\r
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
- * \r
- * For further information please contact.\r
- * http://nyatla.jp/nyatoolkit/\r
- * <airmail(at)ebony.plala.or.jp>\r
- * \r
- */\r
-package jp.nyatla.nyartoolkit.jogl.utils2;\r
-\r
-import jp.nyatla.nyartoolkit.NyARException;\r
-import jp.nyatla.nyartoolkit.core.NyARCode;\r
-import jp.nyatla.nyartoolkit.core.param.NyARParam;\r
-import jp.nyatla.nyartoolkit.core.transmat.NyARTransMatResult;\r
-import jp.nyatla.nyartoolkit.core2.x2.*;\r
-\r
-\r
-/**\r
- * NyARSingleDetectMarkerにOpenGL向け関数を追加したもの\r
- */\r
-public class GLNyARSingleDetectMarker_X2 extends NyARSingleDetectMarker_X2\r
-{\r
- private NyARTransMatResult trans_mat_result = new NyARTransMatResult();\r
-\r
- private double view_scale_factor = 0.025;// #define VIEW_SCALEFACTOR 0.025 // 1.0 ARToolKit unit becomes 0.025 of my OpenGL units.\r
-\r
- public GLNyARSingleDetectMarker_X2(NyARParam i_param, NyARCode i_code, double i_marker_width) throws NyARException\r
- {\r
- super(i_param, i_code, i_marker_width);\r
- }\r
-\r
- public void setScaleFactor(double i_new_value)\r
- {\r
- view_scale_factor = i_new_value;\r
- }\r
-\r
- // public static void arglCameraViewRH(const double para[3][4], GLdouble m_modelview[16], const double scale)\r
- public double[] getCameraViewRH() throws NyARException\r
- {\r
- double[] result = new double[16];\r
- getCameraViewRH(result);\r
- return result;\r
- }\r
-\r
- /**\r
- * \r
- * @param o_result\r
- * 結果値を格納する配列を指定してください。double[16]以上が必要です。\r
- * @throws NyARException\r
- */\r
- public void getCameraViewRH(double[] o_result) throws NyARException\r
- {\r
- // 座標を計算\r
- this.getTransmationMatrix(this.trans_mat_result);\r
- // 行列変換\r
- final NyARTransMatResult mat = this.trans_mat_result;\r
- o_result[0 + 0 * 4] = mat.m00; // R1C1\r
- o_result[0 + 1 * 4] = mat.m01; // R1C2\r
- o_result[0 + 2 * 4] = mat.m02;\r
- o_result[0 + 3 * 4] = mat.m03;\r
- o_result[1 + 0 * 4] = -mat.m10; // R2\r
- o_result[1 + 1 * 4] = -mat.m11;\r
- o_result[1 + 2 * 4] = -mat.m12;\r
- o_result[1 + 3 * 4] = -mat.m13;\r
- o_result[2 + 0 * 4] = -mat.m20; // R3\r
- o_result[2 + 1 * 4] = -mat.m21;\r
- o_result[2 + 2 * 4] = -mat.m22;\r
- o_result[2 + 3 * 4] = -mat.m23;\r
- o_result[3 + 0 * 4] = 0.0;\r
- o_result[3 + 1 * 4] = 0.0;\r
- o_result[3 + 2 * 4] = 0.0;\r
- o_result[3 + 3 * 4] = 1.0;\r
- if (view_scale_factor != 0.0) {\r
- o_result[12] *= view_scale_factor;\r
- o_result[13] *= view_scale_factor;\r
- o_result[14] *= view_scale_factor;\r
- }\r
- return;\r
- }\r
-}\r