...

中間レポート【2013/8/7】

by user

on
Category: Documents
6

views

Report

Comments

Transcript

中間レポート【2013/8/7】
1. 研究の背景と目的
本研究では,近年技術の発達によりよく聞くようになった AR という技術,これについて学
習し,その技術を学ぶとともに学んだ技術を用いて人に「新しい」「面白い」と思ってもら
えるアプリケーションを開発する事を目的する.
1.1 AR とは
AR とは Augmented Reality(拡張現実・拡張現実感)の略で,その時周囲を取り巻く現実環境
に情報を付加する事で,人間から見た現実世界を拡張するものを指す.
そもそも AR の研究は VR(Virtual Reality 仮想現実)の研究の延長から始まったと言われている.
VR とは架空の空間の中に現実の物体を再現する技術の事である.
1965 年,ハーバード大学のアイヴァン・サザーランド準教授が VR の研究をする際,シース
ルーのヘッドマウントディスプレーを使い,現実世界条に CG の画像を重ねてみたのが,AR の
研究の始まりだったという.現実世界をシャットアウトして CG だけを見れば VR に,ヘッドマ
ウントディスプレーをシースルーにすると AR の世界になる.
そもそも AR の研究は VR(Virtual Reality 仮想現実)の研究の延長
から始まったと言われている.VR とは架空の空間の中に現実の物
体を再現する技術の事である.
1965 年,ハーバード大学のアイヴァン・サザーランド準教授が
VR の研究をする際,シースルーのヘッドマウントディスプレーを
使い,現実世界条に CG の画像を重ねてみたのが,AR の研究の始ま
りだったという.現実世界をシャットアウトして CG だけを見れば
VR に,ヘッドマウントディスプレーをシースルーにすると AR の世
界になる.[1]
図 1 研究で用いられたヘッドマウントディスプレー
本当の「AR」とは? AR の歴史と未来の姿を追う!
http://ascii.jp/elem/000/000/514/514146/index-2.html より
AR により情報を付加するプロセスは概ね以下の図の通りである.
現実世界の情報
AR によって
視覚情報等を
付加された情報
AR
付加情報
情報利用者
1
図 2 AR の情報付加のプロセス
付加する情報は,聴覚的な情報,嗅覚的な情報など五感に関わるものがあるが,その中でも一
般的には視覚的な情報を付加する事が多い.
AR を実現するためには,まず現実世界の物体の位置を正しく認識しなくてはならない,そう
しなければ付加した情報がズレて,現実感が損なわれてしまう.以下で AR の実現方法を大きく
分けて 2 種類,全部で 3 種類紹介する.
1.2 AR 実現方法「ロケーションベース AR」
GPS から取得できる位置情報にひも付けて付加的な情報を表示するというのが「ロケーション
ベース AR」である.
GPS による位置情報だけではなく,磁気センサによる方位(情報を見ようとしている人の向い
ている向き)や加速度センサによる傾き(視線の仰角や俯角)など,視覚的な情報を用いずに,
位置情報のみで現実空間に情報を付加する.
メリットとしては,位置情報の取得や,向き・傾きの取得といった要素技術が,現状利用でき
るデバイスやプラットフォームでは比較的容易に扱えるようになっているため,基本的なもので
あれば,特別なライブラリなどを別途利用しなくとも、実現可能であることが挙げられる.
一方デメリットとしては,今のところ主要な位置情報源を GPS に頼る部分が大きく,
付加情報の表示位置の精度的な面でズレが発生する可能性が挙げられる.
最近は,端末に実装されている GPS プロセッサの性能向上や,補正情報の付加などにより誤
差は少なくなってきてはいるが,完全にズレの発生を防ぐのは困難である.[2]
1.3 AR 実現方法「ビジョンベース AR」
画像認識・空間認識などの技術を応用して直接目の前にある環境を認識・解析することで情報
提示を行うのが「ビジョンベース AR」である.
視覚情報を必要とするので,必然的にカメラなどの画像・映像を取り込むデバイスが必要とな
る.また,そこに映った画像・映像に視覚的な情報を付加するものが一般的である.
ビジョンベース AR は大きく2つに分けられる.[2]
1.3.1 マーカー型ビジョンベース AR
マーカー型ビジョンベース AR は,その名の通りマーカーと呼ばれる付加情報の出現キーを用
いる.マーカーとは,付加情報の提示位置を特定する為に対象空間内に設置する目印のようなも
のである.マーカーには認識の対象となるためにある特定のパターンを持った図形が描かれてい
る.
通常,マーカー型 AR を実現する場合,「マーカーの認識」と「認識したマーカーに対して特
定の付加情報を提示する機能」の 2 つを持ったライブラリやエンジンを利用するのが一般的であ
る.マーカーのパターンがどのようなものである必要があるかは,利用するライブラリなどに依
存する.
メリットとしては,マーカーを置くことで付加情報の提示位置を決めることが可能なため,提
示したい場所へ正確に付加情報を提示できることや,すぐに利用できる OSS のライブラリが公
開されていて,比較的取り組みやすいことが挙げられる.
デメリットとしては,マーカーを印刷物などで別途準備しておかなければならないことや,
マーカー自体を現実の環境に配置する必要があるため,物理的な場所,環境としてマーカーを置
くことが難しい(スペースの問題や景観などの側面で)場合には利用できないことなどが挙げら
れる.[2]
2
図 3 マーカー型 AR の例
ARToolKit で用いるマーカー(左)と実用例(右)
http://kougaku-navi.net/media2009/index.php?ARToolKit より
1.3.2 マーカーレス型ビジョンベース AR
マーカーレス型 AR は,特定のマーカーなどを利用することなく,現実の環境に存在している
物体や,その環境自体を空間的に認識することで付加情報の提示位置を特定し,提示する.
メリットとしては,特別なマーカーなどを別途用意する必要がなく,物理的なスペースや景観
上の問題などでマーカーを配置することが難しい場所や,風景そのものにもピンポイントで付加
情報を提示できる点が挙げられる.
デメリットとしては,空間認識や物体の認識では,どうしても計算量が多くなり,ハードウェ
ア的な能力の要求が高くなる事,細かい要求を満たして精度を保ち,かつ計算量も気をつける必
要があるので,空間認識や物体の認識に関する専門的な知識が少なからず必要となってくる事な
どが挙げられる.[2]
1.4 研究に用いる技術
本研究では,前述した AR の実現方法のうち,マーカー型ビジョンベース AR を公開されてい
るライブラリ「ARToolKit」,「NyARToolKit」を用いて実現を目指す.
1.5.1 ARToolKit と NyARToolKit
ARToolKit とは,拡張現実アプリケーションを実現するための C 言語ライブラリである.
AR の研究のために開発されたソフトウェアライブラリであり,奈良先端科学技術大学院大学の
加藤博一教授によって開発された.
このライブラリを利用することで,AR アプリケーションを比較的容易かつリアルタイムに実
装することが可能である.
NyARToolKit とは,上記の ARToolKit を参考に実装されたオープンソースのライブラリである.
2. 研究にあたって
2.1 開発環境
AR アプリケーション開発に必要なもの
① Web カメラ
3
外部環境の情報を取り込むために必要
② PC
Web カメラが動作するパソコンであること
③ C 言語プログラム開発環境
開発には C を用いるので MicrosoftVisualStudio などが必要
④ GLUT
3DCG を描画するための技術である OpenGL の補助ライブラリ,3 次元オブジェクトを描画する
ために必要
⑤ Eclipse の導入
Android 用のアプリ開発には Eclipse を使用する.
日本語化パッチの HP では,すでに日本語化された Eclipse を入手できる
1.1 役割分担
今回の研究においては,AR 技術について学ぶ事と AR 技術を用いたアプリを開発する
4
事が主目的となっており,私が ARToolKit を用いた AR 技術の学習・研究を担当している.
もう一人の研究員は Kinect を用いた AR 技術についての学習・研究を担当している.
3. 研究内容
3.1 目標とするアプリ
本研究での最終目標として,カメラによって取りこんだ映像の中に CG のキャラクターを映しだすだけで
なく,そのキャラクターをキーボードやタッチパッドの入力などによってある程度動きを操作できるようなプ
リの開発を目指す.
3.2 現状
現在,「拡張現実感を実現する ARToolkit プログラミングテクニック」[3]と,サンプルプログ
ラムを参考に,PC で動作する AR アプリの開発を行い,カメラで取り込んだ映像のマーカー上
にシンプルな立方体を出現させるというシンプルな物を実行している段階である.ARToolKit の
機能についても現在学習中の段階だ.
以下に立方体を出現させるサンプルプログラムのソースコードを示す.
/*
* simpleLite.c
*
* Some code to demonstrate use of gsub_lite's argl*() functions.
* Shows the correct GLUT usage to read a video frame (in the idle callback)
* and to draw it (in the display callback).
*
* Press '?' while running for help on available key commands.
*
* Copyright (c) 2001-2007 Philip Lamb (PRL) [email protected]. All rights reserved.
*
*
Rev
Date
Who
Changes
*
1.0.0
20040302 PRL
Initial version, simple test animation using GLUT.
*
1.0.1
20040721 PRL
Correctly sets window size; supports arVideoDispOption().
*
*/
/*
*
* This file is part of ARToolKit.
*
* ARToolKit is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* ARToolKit is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with ARToolKit; if not, write to the Free Software
5
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
// ============================================================================
//
Includes
// ============================================================================
#include <stdio.h>
#include <stdlib.h>
#ifdef __APPLE__
# include <GLUT/glut.h>
#else
# include <GL/glut.h>
#endif
#include <AR/config.h>
#include <AR/video.h>
#include <AR/param.h>
#include <AR/ar.h>
#include <AR/gsub_lite.h>
// malloc(), free()
// arParamDisp()
// ============================================================================
//
Constants
// ============================================================================
#define VIEW_SCALEFACTOR
#define VIEW_DISTANCE_MIN
be displayed.
#define VIEW_DISTANCE_MAX
displayed.
0.025
0.1
// 1.0 ARToolKit unit becomes 0.025 of my OpenGL units.
// Objects closer to the camera than this will not
100.0
// Objects further away from the camera than this will not be
// ============================================================================
//
Global variables
// ============================================================================
// Preferences.
static int prefWindowed = TRUE;
static int prefWidth = 640;
static int prefHeight = 480;
static int prefDepth = 32;
static int prefRefresh = 0;
// Fullscreen mode width.
// Fullscreen mode height.
// Fullscreen mode bit depth.
// Fullscreen mode refresh rate. Set to 0 to use default rate.
// Image acquisition.
static ARUint8
*gARTImage = NULL;
// Marker detection.
static int
static long
gARTThreshhold = 100;
gCallCountMarkerDetect = 0;
// Transformation matrix retrieval.
static double
gPatt_width = 80.0;
// Per-marker, but we are using only 1 marker.
static double
gPatt_centre[2] = {0.0, 0.0}; // Per-marker, but we are using only 1 marker.
static double
gPatt_trans[3][4];
// Per-marker, but we are using only 1 marker.
static int
gPatt_found = FALSE; // Per-marker, but we are using only 1 marker.
static int
gPatt_id;
// Per-marker, but we are using only 1 marker.
// Drawing.
static ARParam
gARTCparam;
static ARGL_CONTEXT_SETTINGS_REF gArglSettings = NULL;
static int gDrawRotate = FALSE;
static float gDrawRotateAngle = 0;
// For use in drawing.
// ============================================================================
//
Functions
// ============================================================================
// Something to look at, draw a rotating colour cube.
static void DrawCube(void)
{
// Colour cube data.
static GLuint polyList = 0;
float fSize = 0.5f;
long f, i;
const GLfloat cube_vertices [8][3] = {
{1.0, 1.0, 1.0}, {1.0, -1.0, 1.0}, {-1.0, -1.0, 1.0}, {-1.0, 1.0, 1.0},
{1.0, 1.0, -1.0}, {1.0, -1.0, -1.0}, {-1.0, -1.0, -1.0}, {-1.0, 1.0, -1.0} };
6
const GLfloat cube_vertex_colors [8][3] = {
{1.0, 1.0, 1.0}, {1.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 1.0, 1.0},
{1.0, 0.0, 1.0}, {1.0, 0.0, 0.0}, {0.0, 0.0, 0.0}, {0.0, 0.0, 1.0} };
GLint cube_num_faces = 6;
const short cube_faces [6][4] = {
{3, 2, 1, 0}, {2, 3, 7, 6}, {0, 1, 5, 4}, {3, 0, 4, 7}, {1, 2, 6, 5}, {4, 5, 6, 7} };
if (!polyList) {
polyList = glGenLists (1);
glNewList(polyList, GL_COMPILE);
glBegin (GL_QUADS);
for (f = 0; f < cube_num_faces; f++)
for (i = 0; i < 4; i++) {
glColor3f (cube_vertex_colors[cube_faces[f][i]][0], cube_vertex_colors[cube_faces[f]
[i]][1], cube_vertex_colors[cube_faces[f][i]][2]);
glVertex3f(cube_vertices[cube_faces[f][i]][0] * fSize, cube_vertices[cube_faces[f][i]][1]
* fSize, cube_vertices[cube_faces[f][i]][2] * fSize);
}
glEnd ();
glColor3f (0.0, 0.0, 0.0);
for (f = 0; f < cube_num_faces; f++) {
glBegin (GL_LINE_LOOP);
for (i = 0; i < 4; i++)
glVertex3f(cube_vertices[cube_faces[f][i]][0] * fSize, cube_vertices[cube_faces[f][i]][1]
* fSize, cube_vertices[cube_faces[f][i]][2] * fSize);
glEnd ();
}
glEndList ();
}
glPushMatrix(); // Save world coordinate system.
glTranslatef(0.0, 0.0, 0.5); // Place base of cube on marker surface.
glRotatef(gDrawRotateAngle, 0.0, 0.0, 1.0); // Rotate about z axis.
glDisable(GL_LIGHTING);
// Just use colours.
glCallList(polyList);
// Draw the cube.
glPopMatrix();
// Restore world coordinate system.
}
static void DrawCubeUpdate(float timeDelta)
{
if (gDrawRotate) {
gDrawRotateAngle += timeDelta * 45.0f; // Rotate cube at 45 degrees per second.
if (gDrawRotateAngle > 360.0f) gDrawRotateAngle -= 360.0f;
}
}
static int setupCamera(const char *cparam_name, char *vconf, ARParam *cparam)
{
ARParam
wparam;
int
xsize, ysize;
// Open the video path.
if (arVideoOpen(vconf) < 0) {
fprintf(stderr, "setupCamera(): Unable to open connection to camera.\n");
return (FALSE);
}
// Find the size of the window.
if (arVideoInqSize(&xsize, &ysize) < 0) return (FALSE);
fprintf(stdout, "Camera image size (x,y) = (%d,%d)\n", xsize, ysize);
// Load the camera parameters, resize for the window and init.
if (arParamLoad(cparam_name, 1, &wparam) < 0) {
fprintf(stderr, "setupCamera(): Error loading parameter file %s for camera.\n", cparam_name);
return (FALSE);
}
arParamChangeSize(&wparam, xsize, ysize, cparam);
fprintf(stdout, "*** Camera Parameter ***\n");
arParamDisp(cparam);
arInitCparam(cparam);
if (arVideoCapStart() != 0) {
fprintf(stderr, "setupCamera(): Unable to begin camera data capture.\n");
7
return (FALSE);
}
return (TRUE);
}
static int setupMarker(const char *patt_name, int *patt_id)
{
// Loading only 1 pattern in this example.
if ((*patt_id = arLoadPatt(patt_name)) < 0) {
fprintf(stderr, "setupMarker(): pattern load error !!\n");
return (FALSE);
}
return (TRUE);
}
// Report state of ARToolKit global variables arFittingMode,
// arImageProcMode, arglDrawMode, arTemplateMatchingMode, arMatchingPCAMode.
static void debugReportMode(const ARGL_CONTEXT_SETTINGS_REF arglContextSettings)
{
if (arFittingMode == AR_FITTING_TO_INPUT) {
fprintf(stderr, "FittingMode (Z): INPUT IMAGE\n");
} else {
fprintf(stderr, "FittingMode (Z): COMPENSATED IMAGE\n");
}
if (arImageProcMode == AR_IMAGE_PROC_IN_FULL) {
fprintf(stderr, "ProcMode (X) : FULL IMAGE\n");
} else {
fprintf(stderr, "ProcMode (X) : HALF IMAGE\n");
}
if (arglDrawModeGet(arglContextSettings) == AR_DRAW_BY_GL_DRAW_PIXELS) {
fprintf(stderr, "DrawMode (C) : GL_DRAW_PIXELS\n");
} else if (arglTexmapModeGet(arglContextSettings) == AR_DRAW_TEXTURE_FULL_IMAGE) {
fprintf(stderr, "DrawMode (C) : TEXTURE MAPPING (FULL RESOLUTION)\n");
} else {
fprintf(stderr, "DrawMode (C) : TEXTURE MAPPING (HALF RESOLUTION)\n");
}
if (arTemplateMatchingMode == AR_TEMPLATE_MATCHING_COLOR) {
fprintf(stderr, "TemplateMatchingMode (M) : Color Template\n");
} else {
fprintf(stderr, "TemplateMatchingMode (M) : BW Template\n");
}
if (arMatchingPCAMode == AR_MATCHING_WITHOUT_PCA) {
fprintf(stderr, "MatchingPCAMode (P) : Without PCA\n");
} else {
fprintf(stderr, "MatchingPCAMode (P) : With PCA\n");
}
}
static void Quit(void)
{
arglCleanup(gArglSettings);
arVideoCapStop();
arVideoClose();
exit(0);
}
static void Keyboard(unsigned char key, int x, int y)
{
int mode;
switch (key) {
case 0x1B:
case 'Q':
case 'q':
Quit();
break;
case ' ':
gDrawRotate = !gDrawRotate;
break;
case 'C':
case 'c':
mode = arglDrawModeGet(gArglSettings);
if (mode == AR_DRAW_BY_GL_DRAW_PIXELS) {
8
// Quit.
arglDrawModeSet(gArglSettings, AR_DRAW_BY_TEXTURE_MAPPING);
arglTexmapModeSet(gArglSettings, AR_DRAW_TEXTURE_FULL_IMAGE);
} else {
mode = arglTexmapModeGet(gArglSettings);
if
(mode
==
AR_DRAW_TEXTURE_FULL_IMAGE)
arglTexmapModeSet(gArglSettings, AR_DRAW_TEXTURE_HALF_IMAGE);
else arglDrawModeSet(gArglSettings, AR_DRAW_BY_GL_DRAW_PIXELS);
}
fprintf(stderr, "*** Camera - %f (frame/sec)\n", (double)gCallCountMarkerDetect/arUtilTimer());
gCallCountMarkerDetect = 0;
arUtilTimerReset();
debugReportMode(gArglSettings);
break;
case 'D':
case 'd':
arDebug = !arDebug;
break;
case '?':
case '/':
printf("Keys:\n");
printf(" q or [esc] Quit demo.\n");
printf(" c
Change arglDrawMode and arglTexmapMode.\n");
printf(" d
Activate / deactivate debug mode.\n");
printf(" ? or /
Show this help.\n");
printf("\nAdditionally, the ARVideo library supplied the following help text:\n");
arVideoDispOption();
break;
default:
break;
}
}
static void Idle(void)
{
static int ms_prev;
int ms;
float s_elapsed;
ARUint8 *image;
ARMarkerInfo *marker_info;
of detected markers.
int
marker_num;
detected.
int
j, k;
// Pointer to array holding the details
// Count of number of markers
// Find out how long since Idle() last ran.
ms = glutGet(GLUT_ELAPSED_TIME);
s_elapsed = (float)(ms - ms_prev) * 0.001;
if (s_elapsed < 0.01f) return; // Don't update more often than 100 Hz.
ms_prev = ms;
// Update drawing.
DrawCubeUpdate(s_elapsed);
// Grab a video frame.
if ((image = arVideoGetImage()) != NULL) {
gARTImage = image;
// Save the fetched image.
gCallCountMarkerDetect++; // Increment ARToolKit FPS counter.
// Detect the markers in the video frame.
if (arDetectMarker(gARTImage, gARTThreshhold, &marker_info, &marker_num) < 0) {
exit(-1);
}
// Check through the marker_info array for highest confidence
// visible marker matching our preferred pattern.
k = -1;
for (j = 0; j < marker_num; j++) {
if (marker_info[j].id == gPatt_id) {
if (k == -1) k = j; // First marker detected.
else if(marker_info[j].cf > marker_info[k].cf) k = j; // Higher confidence marker
detected.
}
}
if (k != -1) {
9
// Get the transformation between the marker and the real camera into gPatt_trans.
arGetTransMat(&(marker_info[k]), gPatt_centre, gPatt_width, gPatt_trans);
gPatt_found = TRUE;
} else {
gPatt_found = FALSE;
}
// Tell GLUT the display has changed.
glutPostRedisplay();
}
}
//
//
This function is called on events when the visibility of the
//
GLUT window changes (including when it first becomes visible).
//
static void Visibility(int visible)
{
if (visible == GLUT_VISIBLE) {
glutIdleFunc(Idle);
} else {
glutIdleFunc(NULL);
}
}
//
//
This function is called when the
//
GLUT window is resized.
//
static void Reshape(int w, int h)
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glViewport(0, 0, (GLsizei) w, (GLsizei) h);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
// Call through to anyone else who needs to know about window sizing here.
}
//
// This function is called when the window needs redrawing.
//
static void Display(void)
{
GLdouble p[16];
GLdouble m[16];
// Select correct buffer for this context.
glDrawBuffer(GL_BACK);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // Clear the buffers for new frame.
arglDispImage(gARTImage, &gARTCparam, 1.0, gArglSettings);
// zoom = 1.0.
arVideoCapNext();
gARTImage = NULL; // Image data is no longer valid after calling arVideoCapNext().
// Projection transformation.
arglCameraFrustumRH(&gARTCparam, VIEW_DISTANCE_MIN, VIEW_DISTANCE_MAX, p);
glMatrixMode(GL_PROJECTION);
glLoadMatrixd(p);
glMatrixMode(GL_MODELVIEW);
// Viewing transformation.
glLoadIdentity();
// Lighting and geometry that moves with the camera should go here.
// (I.e. must be specified before viewing transformations.)
//none
if (gPatt_found) {
// Calculate the camera position relative to the marker.
// Replace VIEW_SCALEFACTOR with 1.0 to make one drawing unit equal to 1.0 ARToolKit units (usually
millimeters).
arglCameraViewRH(gPatt_trans, m, VIEW_SCALEFACTOR);
glLoadMatrixd(m);
10
// All lighting and geometry to be drawn relative to the marker goes here.
DrawCube();
} // gPatt_found
// Any 2D overlays go here.
//none
glutSwapBuffers();
}
int main(int argc, char** argv)
{
char glutGamemode[32];
const char *cparam_name = "Data/camera_para.dat";
//
// Camera configuration.
//
#ifdef _WIN32
char
*vconf = "Data\\WDM_camera_flipV.xml";
#else
char
*vconf = "";
#endif
const char *patt_name = "Data/patt.hiro";
// ---------------------------------------------------------------------------// Library inits.
//
glutInit(&argc, argv);
// ---------------------------------------------------------------------------// Hardware setup.
//
if (!setupCamera(cparam_name, vconf, &gARTCparam)) {
fprintf(stderr, "main(): Unable to set up AR camera.\n");
exit(-1);
}
// ---------------------------------------------------------------------------// Library setup.
//
// Set up GL context(s) for OpenGL to draw into.
glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGBA | GLUT_DEPTH);
if (!prefWindowed) {
if (prefRefresh) sprintf(glutGamemode, "%ix%i:%i@%i", prefWidth, prefHeight, prefDepth, prefRefresh);
else sprintf(glutGamemode, "%ix%i:%i", prefWidth, prefHeight, prefDepth);
glutGameModeString(glutGamemode);
glutEnterGameMode();
} else {
glutInitWindowSize(prefWidth, prefHeight);
glutCreateWindow(argv[0]);
}
// Setup argl library for current context.
if ((gArglSettings = arglSetupForCurrentContext()) == NULL) {
fprintf(stderr, "main(): arglSetupForCurrentContext() returned error.\n");
exit(-1);
}
debugReportMode(gArglSettings);
glEnable(GL_DEPTH_TEST);
arUtilTimerReset();
if (!setupMarker(patt_name, &gPatt_id)) {
fprintf(stderr, "main(): Unable to set up AR marker.\n");
Quit();
}
// Register GLUT event-handling callbacks.
// NB: Idle() is registered by Visibility.
glutDisplayFunc(Display);
glutReshapeFunc(Reshape);
glutVisibilityFunc(Visibility);
glutKeyboardFunc(Keyboard);
glutMainLoop();
11
return (0);
}
一方,スマートフォン用のアプリに関しては,導入の段階であり,動作の確認等はまだ行えて
ない.
4. 研究計画
8月
中間報告書作成.Android を用いた開発環境の確立
9月
Android で立方体を描写するプログラムの開発・実行
10 月
PC・スマートフォンにおいて映った CG 画像をアニメーションさせる
11 月
最終的に使用する CG 画像の制作,CG 画像のアニメーションの種類をより増やす
12 月
キーボード操作によってアニメーションの種類などを操作できるアプリ開発
1月
タッチパッドの操作によってアニメーションの種類などを操作できるアプリ開発
2月
卒論作製
12
5. 今後の課題
今後の課題は,アンドロイド用 AR アプリの開発である.開発環境を整える段階で,現状は止まってし
まっているが,PC 用のアプリを開発しながら環境整理・開発を行っていけるかどうかが課題である.
6. 参考文献
[1] 本当の「AR」とは? AR の歴史と未来の姿を追う!
http://ascii.jp/elem/000/000/514/514146/index-2.html
[2] モバイル AR アプリ開発“超”入門
http://www.atmarkit.co.jp/ait/articles/1109/26/news136.html
[3] 拡張現実感を実現する ARToolkit プログラミングテクニック
著者 谷尻豊寿
13
Fly UP