JP4151983B2 - Moving direction calculation device and moving direction calculation program - Google Patents

Moving direction calculation device and moving direction calculation program Download PDF

Info

Publication number
JP4151983B2
JP4151983B2 JP2006124289A JP2006124289A JP4151983B2 JP 4151983 B2 JP4151983 B2 JP 4151983B2 JP 2006124289 A JP2006124289 A JP 2006124289A JP 2006124289 A JP2006124289 A JP 2006124289A JP 4151983 B2 JP4151983 B2 JP 4151983B2
Authority
JP
Japan
Prior art keywords
acceleration
vector
acceleration data
data
controller
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
JP2006124289A
Other languages
Japanese (ja)
Other versions
JP2007295990A (en
Inventor
賢太 佐藤
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nintendo Co Ltd
Original Assignee
Nintendo Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nintendo Co Ltd filed Critical Nintendo Co Ltd
Priority to JP2006124289A priority Critical patent/JP4151983B2/en
Priority to US11/520,813 priority patent/US7988558B2/en
Publication of JP2007295990A publication Critical patent/JP2007295990A/en
Application granted granted Critical
Publication of JP4151983B2 publication Critical patent/JP4151983B2/en
Priority to US12/957,910 priority patent/US9002676B2/en
Priority to US12/958,003 priority patent/US8287377B2/en
Priority to US12/969,586 priority patent/US8672760B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Description

本発明は、移動方向算出装置および移動方向算出プログラムに関し、より特定的には、入力装置の移動方向を算出する移動方向算出装置および移動方向算出プログラムに関する。   The present invention relates to a movement direction calculation device and a movement direction calculation program, and more particularly to a movement direction calculation device and a movement direction calculation program for calculating the movement direction of an input device.

特許文献1には、手にはめるグローブを模したコントローラの動きを検出する技術が記載されている。このコントローラは、加速度センサを備えており、加速度センサによって3軸方向に関する各加速度値を検出する。そして、検出された各加速度値の波形のパターンに基づいて、コントローラの動き(すなわち、パンチの種類)を判断する。
特開2002−153673号公報
Patent Document 1 describes a technique for detecting the movement of a controller simulating a glove worn on a hand. This controller includes an acceleration sensor, and each acceleration value in the three-axis directions is detected by the acceleration sensor. Then, based on the detected waveform pattern of each acceleration value, the movement of the controller (that is, the type of punch) is determined.
JP 2002-153673 A

上記特許文献1に記載のコントローラは、波形のパターンによってパンチを数種類に分類することしかできず、コントローラの移動方向を詳細に判断することはできない。そのため、プレイヤが入力可能の操作の種類は数種類に限られることからゲームの内容も単純になってしまい、ゲームの面白みに欠けるおそれがあった。   The controller described in Patent Document 1 can only classify punches into several types according to the waveform pattern, and cannot determine the movement direction of the controller in detail. For this reason, since the types of operations that can be input by the player are limited to several types, the content of the game is simplified, and the game may not be interesting.

それ故、本発明の目的は、入力装置の移動方向を正確に算出することが可能な移動方向算出装置および移動方向算出プログラムを提供することである。   Therefore, an object of the present invention is to provide a movement direction calculation device and a movement direction calculation program capable of accurately calculating the movement direction of an input device.

本発明は、上記の課題を解決するために、以下の構成を採用した。なお、本欄における括弧内の参照符号および補足説明等は、本発明の理解を助けるために後述する実施形態との対応関係を示したものであって、本発明を何ら限定するものではない。   The present invention employs the following configuration in order to solve the above problems. Note that the reference numerals in parentheses and supplementary explanations in this section show the correspondence with the embodiments described later in order to help understanding of the present invention, and do not limit the present invention.

第1の発明は、入力装置(コントローラ7)の移動方向を算出する移動方向算出装置(ゲーム装置3)である。移動方向算出装置は、取得手段(ステップS2を実行するCPU10等。以下、この欄において同様の場合にはステップ番号のみを記載する。)と、期間検出手段(S4,S7)と、差分算出手段(S23)と、移動方向算出手段(S24)と、を備えている。取得手段は、入力装置に搭載される多軸加速度センサ(37)から出力される加速度データ(621)を逐次取得する。期間検出手段は、取得される加速度データに基づいて、入力装置が動き始めてから動きが終了するまでの期間を移動期間として検出する。差分算出手段は、加速度データにより示される各軸に関する加速度値のうちの複数の軸に関する加速度値を各成分とするベクトルを加速度ベクトルとするとき、移動期間内に取得される複数の加速度データ(選出加速度データ群631)毎に、加速度データに対応する加速度ベクトルと当該加速度データの次に取得された加速度データに対応する加速度ベクトルとの差分ベクトルを算出する。移動方向算出手段は、移動期間内に取得される各加速度データについて算出された各差分ベクトルに対して差分ベクトルの大きさに応じた重み付けを行って当該各差分ベクトルの総和を算出し、当該総和が示すベクトルによって決められる方向を移動方向とする。   1st invention is the movement direction calculation apparatus (game device 3) which calculates the movement direction of an input device (controller 7). The moving direction calculation device includes an acquisition unit (CPU 10 or the like that executes step S2; hereinafter, only the step number is described in the same case in this column), a period detection unit (S4, S7), and a difference calculation unit. (S23) and a moving direction calculation means (S24). The acquisition means sequentially acquires acceleration data (621) output from the multi-axis acceleration sensor (37) mounted on the input device. The period detection means detects a period from when the input device starts to move until the movement ends as a movement period based on the acquired acceleration data. The difference calculating means is configured to select a plurality of acceleration data (selected) within a moving period when a vector having acceleration components related to a plurality of axes among the acceleration values related to each axis indicated by the acceleration data is used as an acceleration vector. For each acceleration data group 631), a difference vector between the acceleration vector corresponding to the acceleration data and the acceleration vector corresponding to the acceleration data acquired next to the acceleration data is calculated. The moving direction calculating means weights each difference vector calculated for each acceleration data acquired within the moving period according to the magnitude of the difference vector, calculates the sum of the difference vectors, and calculates the sum The direction determined by the vector indicated by is the moving direction.

第2の発明において、期間検出手段は、開始設定手段(S4)と、終了設定手段(S7)とを含んでいてもよい。開始設定手段は、メモリに記憶された加速度データにより示される各軸に関する加速度値のうちの所定の1軸(z軸)に関する加速度値が第1閾値を上回った時点を移動期間の開始時点に設定する。終了設定手段は、メモリに記憶された加速度データにより示される各軸に関する加速度値のうちの所定の1軸に関する加速度値が第2閾値を下回った時点を移動期間の終了時点に設定する。   In the second invention, the period detection means may include a start setting means (S4) and an end setting means (S7). The start setting means sets a time point at which an acceleration value related to a predetermined one axis (z axis) among acceleration values related to each axis indicated by the acceleration data stored in the memory exceeds a first threshold value as a start time of the movement period. To do. The end setting means sets, as the end point of the movement period, the time point when the acceleration value related to a predetermined one axis among the acceleration values related to each axis indicated by the acceleration data stored in the memory falls below the second threshold value.

第3の発明において、多軸加速度センサは3軸加速度センサであってもよい。このとき、差分算出手段は、加速度データにより示される各軸に関する加速度値のうちの、所定の1軸以外の2軸に関する加速度値を各成分とするベクトルを加速度ベクトルとして用いる。   In the third invention, the multi-axis acceleration sensor may be a three-axis acceleration sensor. At this time, the difference calculation means uses, as an acceleration vector, a vector having acceleration components related to two axes other than the predetermined one axis as acceleration components among the acceleration values related to each axis indicated by the acceleration data.

第4の発明において、移動方向算出装置は、重力方向算出手段(S25)と、ゲーム処理手段(S9)と、をさらに備えていてもよい。重力方向算出手段は、移動期間内に取得される複数の加速度データに対応する各加速度ベクトルの総和を示すベクトルを、入力装置に加わる重力方向として算出する。ゲーム処理手段は、移動方向と重力方向とに基づいて所定のゲーム処理を実行する。   In the fourth invention, the movement direction calculating device may further include gravity direction calculating means (S25) and game processing means (S9). The gravity direction calculation means calculates a vector indicating the sum of the acceleration vectors corresponding to the plurality of acceleration data acquired within the movement period as the gravity direction applied to the input device. The game processing means executes a predetermined game process based on the moving direction and the gravity direction.

また、本発明は、上記の動作を移動方向算出装置のコンピュータに実行させるための移動方向算出プログラム(ゲームプログラム61)の形態で提供されてもよい。   Further, the present invention may be provided in the form of a movement direction calculation program (game program 61) for causing the computer of the movement direction calculation apparatus to execute the above-described operation.

第1の発明によれば、移動期間内に取得された各加速度データについて差分ベクトルが算出される。そして、差分ベクトルに重みを付けて総和を算出することによって移動方向が算出される。ここで、重みを付けずに差分ベクトルの総和を算出する方法では、所定期間の検出結果によっては、第1移動方向を正確に認識できないおそれがある。例えば、所定期間内において最初に取得された加速度データの値と、最後に取得された加速度データの値とがほぼ同じになる場合には、総和がほぼ「0」になってしまうため、第1移動方向を正確に認識できない。これに対して、第1の発明によれば、上記重みを考慮して総和を算出するので、所定期間内において最初および最後に取得された2つの加速度データの値が同じになる場合であっても、総和を示すベクトルは「0」にはならない。第1の発明によれば、各差分ベクトルのうちで大きさが相対的に大きい差分ベクトルの成分が当該総和によって表されることとなり、第1移動方向を正確に算出することができる。   According to the first aspect, a difference vector is calculated for each piece of acceleration data acquired during the movement period. Then, the moving direction is calculated by weighting the difference vector and calculating the sum. Here, in the method of calculating the sum of the difference vectors without weighting, there is a possibility that the first moving direction cannot be accurately recognized depending on the detection result of the predetermined period. For example, if the value of the acceleration data acquired first within a predetermined period and the value of the acceleration data acquired last are substantially the same, the sum is almost “0”. The direction of movement cannot be recognized accurately. On the other hand, according to the first invention, since the sum is calculated in consideration of the weights, the values of the two acceleration data acquired first and last in the predetermined period are the same. However, the vector indicating the sum is not “0”. According to the first aspect, among the difference vectors, the component of the difference vector having a relatively large size is represented by the sum, and the first movement direction can be accurately calculated.

第2の発明によれば、入力装置が移動している期間の開始時点および終了時点を容易に検出することができる。   According to the second invention, it is possible to easily detect the start time and end time of the period during which the input device is moving.

第3の発明によれば、3軸加速度センサの所定の1軸に関する加速度値を用いて、上記移動期間を容易に検出することができるとともに、所定の1軸以外の2軸に関する加速度値を用いて、当該2軸方向に関する移動方向を容易に算出することができる。   According to the third aspect of the invention, the movement period can be easily detected using the acceleration value related to the predetermined one axis of the three-axis acceleration sensor, and the acceleration value related to two axes other than the predetermined one axis is used. Thus, the moving direction with respect to the two axis directions can be easily calculated.

第4の発明によれば、移動方向だけでなく、入力装置に加わる重力方向が算出される。すなわち、入力装置から取得された加速度データから、移動方向および重力方向という、入力装置の状態を示す2種類の情報が算出される。そして、ゲーム装置は、これら2種類の情報をゲーム操作に反映してゲーム処理を行う。したがって、第4の発明によれば、センサが1つという簡易な構成でありながら、入力装置の2種類の状態に基づいた複雑なゲーム操作をプレイヤに行わせることが可能となる。   According to the fourth aspect, not only the moving direction but also the direction of gravity applied to the input device is calculated. That is, from the acceleration data acquired from the input device, two types of information indicating the state of the input device, the moving direction and the gravity direction, are calculated. Then, the game apparatus performs game processing by reflecting these two types of information in the game operation. Therefore, according to the fourth invention, it is possible to cause the player to perform a complicated game operation based on the two types of states of the input device while having a simple configuration with one sensor.

図1を参照して、本発明の一実施形態に係る移動方向算出装置の一例であるゲーム装置を含むゲームシステム1について説明する。図1は、当該ゲームシステム1の外観図である。以下、据置型のゲーム装置を一例にして、ゲーム装置およびゲームプログラムについて説明する。   With reference to FIG. 1, a game system 1 including a game apparatus which is an example of a moving direction calculation apparatus according to an embodiment of the present invention will be described. FIG. 1 is an external view of the game system 1. Hereinafter, a game apparatus and a game program will be described using a stationary game apparatus as an example.

図1において、ゲームシステム1は、家庭用テレビジョン受像機等のスピーカを備えたディスプレイ(以下、モニタと記載する)2に、接続コードを介して接続される据置型ゲーム装置(以下、単にゲーム装置と記載する)3および当該ゲーム装置3に操作データを与えるコントローラ7によって構成される。また、モニタ2の周辺(図では画面の上側)には、2つのマーカ8aおよび8bが設置される。マーカ8aおよび8bは、具体的には赤外LEDであり、それぞれモニタ2の前方に向かって赤外光を出力する。ゲーム装置3は、接続端子を介して受信ユニット6が接続される。受信ユニット6は、コントローラ7から無線送信される操作データを受信し、コントローラ7とゲーム装置3とは無線通信によって接続される。なお、他の実施形態においてはコントローラ7とゲーム装置3とは有線で接続されてもよい。また、ゲーム装置3には、当該ゲーム装置3に対して交換可能に用いられる情報記憶媒体の一例である光ディスク4が脱着される。ゲーム装置3の上部主面には、当該ゲーム装置3の電源ON/OFFスイッチ、ゲーム処理のリセットスイッチ、およびゲーム装置3上部の蓋を開くOPENスイッチが設けられている。ここで、プレイヤがOPENスイッチを押下することによって上記蓋が開き、光ディスク4の脱着が可能となる。   In FIG. 1, a game system 1 is a stationary game apparatus (hereinafter simply referred to as a game) connected to a display (hereinafter referred to as a monitor) 2 having a speaker such as a home television receiver via a connection cord. 3) and a controller 7 for giving operation data to the game apparatus 3. Also, two markers 8a and 8b are installed around the monitor 2 (upper side of the screen in the figure). The markers 8a and 8b are specifically infrared LEDs, and output infrared light toward the front of the monitor 2, respectively. The game apparatus 3 is connected to the receiving unit 6 via a connection terminal. The receiving unit 6 receives operation data wirelessly transmitted from the controller 7, and the controller 7 and the game apparatus 3 are connected by wireless communication. In other embodiments, the controller 7 and the game apparatus 3 may be connected by wire. Further, an optical disk 4 that is an example of an information storage medium that can be used interchangeably with the game apparatus 3 is attached to and detached from the game apparatus 3. The upper main surface of the game apparatus 3 is provided with a power ON / OFF switch of the game apparatus 3, a reset switch for game processing, and an OPEN switch for opening the lid on the upper part of the game apparatus 3. Here, when the player presses the OPEN switch, the lid is opened, and the optical disk 4 can be attached and detached.

また、ゲーム装置3には、セーブデータ等を固定的に記憶するバックアップメモリ等を搭載する外部メモリカード5が必要に応じて着脱自在に装着される。ゲーム装置3は、光ディスク4に記憶されたゲームプログラムなどを実行することによって、その結果をゲーム画像としてモニタ2に表示する。さらに、ゲーム装置3は、外部メモリカード5に記憶されたセーブデータを用いて、過去に実行されたゲーム状態を再現して、ゲーム画像をモニタ2に表示することもできる。そして、ゲーム装置3のプレイヤは、モニタ2に表示されたゲーム画像を見ながら、コントローラ7を操作することによって、ゲーム進行を楽しむことができる。   Further, an external memory card 5 equipped with a backup memory or the like for storing save data or the like in a fixed manner is detachably attached to the game apparatus 3 as necessary. The game apparatus 3 displays a result as a game image on the monitor 2 by executing a game program or the like stored on the optical disc 4. Furthermore, the game apparatus 3 can reproduce the game state executed in the past by using the save data stored in the external memory card 5 and display the game image on the monitor 2. Then, the player of the game apparatus 3 can enjoy the progress of the game by operating the controller 7 while viewing the game image displayed on the monitor 2.

コントローラ7は、その内部に備える通信部36(後述)から受信ユニット6が接続されたゲーム装置3へ、例えばBluetooth(ブルートゥース)(登録商標)の技術を用いて操作データを無線送信する。コントローラ7は、複数の操作ボタンからなる操作部が設けられている。また、後述により明らかとなるが、コントローラ7は、直線方向の加速度を検出する加速度センサ37(後述)を備えている。加速度センサ37によって検出された加速度を示すデータは上記操作データの一部としてゲーム装置3へ送信される。ゲーム装置3は、当該加速度を示すデータに基づいてコントローラ7の動き及び/又は姿勢を算出し、動き等に応じた処理を適宜実行することができる。また、コントローラ7は、当該コントローラ7から見た画像を撮像するための撮像情報演算部35(後述)を備えている。撮像情報演算部35は、モニタ2の周辺に配置された各マーカ8aおよび8bを撮像対象として、各マーカ8aおよび8bの画像を撮像する。ゲーム装置3は、この画像に基づいた演算処理によってコントローラ7の位置および姿勢に応じた処理を実行することができる。   The controller 7 wirelessly transmits operation data from a communication unit 36 (described later) provided therein to the game apparatus 3 to which the receiving unit 6 is connected, using, for example, Bluetooth (registered trademark) technology. The controller 7 is provided with an operation unit including a plurality of operation buttons. Further, as will be apparent from the description below, the controller 7 includes an acceleration sensor 37 (described later) that detects linear acceleration. Data indicating the acceleration detected by the acceleration sensor 37 is transmitted to the game apparatus 3 as part of the operation data. The game apparatus 3 can calculate the motion and / or posture of the controller 7 based on the data indicating the acceleration, and can appropriately execute processing corresponding to the motion or the like. The controller 7 includes an imaging information calculation unit 35 (described later) for capturing an image viewed from the controller 7. The imaging information calculation unit 35 captures images of the markers 8a and 8b using the markers 8a and 8b arranged around the monitor 2 as imaging targets. The game apparatus 3 can execute processing according to the position and orientation of the controller 7 by arithmetic processing based on this image.

次に、図2を参照して、ゲーム装置3の構成について説明する。なお、図2は、ゲーム装置3の機能ブロック図である。   Next, the configuration of the game apparatus 3 will be described with reference to FIG. FIG. 2 is a functional block diagram of the game apparatus 3.

図2において、ゲーム装置3は、各種プログラムを実行する例えばリスク(RISC)CPU(セントラルプロセッシングユニット)10を備える。CPU10は、図示しないブートROMに記憶された起動プログラムを実行し、メインメモリ13等のメモリの初期化等を行った後、光ディスク4に記憶されているゲームプログラムを実行し、そのゲームプログラムに応じたゲーム処理等を行うものである。CPU10には、メモリコントローラ11を介して、GPU(Graphics Processing Unit)12、メインメモリ13、DSP(Digital Signal Processor)14、およびARAM(Audio RAM)15が接続される。また、メモリコントローラ11には、所定のバスを介して、コントローラI/F(インターフェース)16、ビデオI/F17、外部メモリI/F18、オーディオI/F19、およびディスクI/F21が接続され、それぞれ受信ユニット6、モニタ2、外部メモリカード5、スピーカ22、およびディスクドライブ20が接続されている。   In FIG. 2, the game apparatus 3 includes, for example, a risk (RISC) CPU (Central Processing Unit) 10 that executes various programs. The CPU 10 executes a boot program stored in a boot ROM (not shown), initializes a memory such as the main memory 13, and executes a game program stored in the optical disc 4, and according to the game program. Game processing and the like. A GPU (Graphics Processing Unit) 12, a main memory 13, a DSP (Digital Signal Processor) 14, and an ARAM (Audio RAM) 15 are connected to the CPU 10 via a memory controller 11. Further, a controller I / F (interface) 16, a video I / F 17, an external memory I / F 18, an audio I / F 19, and a disk I / F 21 are connected to the memory controller 11 via a predetermined bus. The receiving unit 6, the monitor 2, the external memory card 5, the speaker 22, and the disk drive 20 are connected.

GPU12は、CPU10の命令に基づいて画像処理を行うものあり、例えば、3Dグラフィックスの表示に必要な計算処理を行う半導体チップで構成される。GPU12は、図示しない画像処理専用のメモリやメインメモリ13の一部の記憶領域を用いて画像処理を行う。GPU12は、これらを用いてモニタ2に表示すべきゲーム画像データやムービー映像を生成し、適宜メモリコントローラ11およびビデオI/F17を介してモニタ2に出力する。   The GPU 12 performs image processing based on a command from the CPU 10, and is configured of a semiconductor chip that performs calculation processing necessary for displaying 3D graphics, for example. The GPU 12 performs image processing using a memory dedicated to image processing (not shown) and a partial storage area of the main memory 13. The GPU 12 generates game image data and movie video to be displayed on the monitor 2 using these, and outputs them to the monitor 2 through the memory controller 11 and the video I / F 17 as appropriate.

メインメモリ13は、CPU10で使用される記憶領域であって、CPU10の処理に必要なゲームプログラム等を適宜記憶する。例えば、メインメモリ13は、CPU10によって光ディスク4から読み出されたゲームプログラムや各種データ等を記憶する。このメインメモリ13に記憶されたゲームプログラムや各種データ等がCPU10によって実行される。   The main memory 13 is a storage area used by the CPU 10 and appropriately stores game programs and the like necessary for the processing of the CPU 10. For example, the main memory 13 stores a game program read from the optical disc 4 by the CPU 10 and various data. The game program and various data stored in the main memory 13 are executed by the CPU 10.

DSP14は、ゲームプログラム実行時にCPU10において生成されるサウンドデータ等を処理するものであり、そのサウンドデータ等を記憶するためのARAM15が接続される。ARAM15は、DSP14が所定の処理(例えば、先読みしておいたゲームプログラムやサウンドデータの記憶)を行う際に用いられる。DSP14は、ARAM15に記憶されたサウンドデータを読み出し、メモリコントローラ11およびオーディオI/F19を介してモニタ2に備えるスピーカ22に出力させる。   The DSP 14 processes sound data generated in the CPU 10 when the game program is executed, and is connected to an ARAM 15 for storing the sound data. The ARAM 15 is used when the DSP 14 performs a predetermined process (for example, storing a pre-read game program or sound data). The DSP 14 reads the sound data stored in the ARAM 15 and outputs the sound data to the speaker 22 provided in the monitor 2 via the memory controller 11 and the audio I / F 19.

メモリコントローラ11は、データ転送を統括的に制御するものであり、上述した各種I/Fが接続される。コントローラI/F16は、例えば4つのコントローラI/Fで構成され、それらが有するコネクタを介して嵌合可能な外部機器とゲーム装置3とを通信可能に接続する。例えば、受信ユニット6は、上記コネクタと嵌合し、コントローラI/F16を介してゲーム装置3と接続される。上述したように受信ユニット6は、コントローラ7からの操作データを受信し、コントローラI/F16を介して当該操作データをCPU10へ出力する。なお、他の実施形態においては、ゲーム装置3は、受信ユニット6に代えて、コントローラ7から送信されてくる操作データを受信する受信モジュールをその内部に設ける構成としてもよい。この場合、受信モジュールが受信した操作データは、所定のバスを介してCPU10に出力される。ビデオI/F17には、モニタ2が接続される。外部メモリI/F18には、外部メモリカード5が接続され、その外部メモリカード5に設けられたバックアップメモリ等とアクセス可能となる。オーディオI/F19にはモニタ2に内蔵されるスピーカ22が接続され、DSP14がARAM15から読み出したサウンドデータや、ディスクドライブ20から直接出力されるサウンドデータがスピーカ22から出力される。ディスクI/F21には、ディスクドライブ20が接続される。ディスクドライブ20は、所定の読み出し位置に配置された光ディスク4に記憶されたデータを読み出し、ゲーム装置3のバスやオーディオI/F19に出力する。   The memory controller 11 comprehensively controls data transfer and is connected to the various I / Fs described above. The controller I / F 16 includes, for example, four controller I / Fs, and connects the external device and the game apparatus 3 that can be fitted to each other via a connector included in the controller I / F so as to communicate with each other. For example, the receiving unit 6 is engaged with the connector and connected to the game apparatus 3 via the controller I / F 16. As described above, the receiving unit 6 receives operation data from the controller 7 and outputs the operation data to the CPU 10 via the controller I / F 16. In another embodiment, the game apparatus 3 may have a configuration in which a reception module that receives operation data transmitted from the controller 7 is provided instead of the reception unit 6. In this case, the operation data received by the receiving module is output to the CPU 10 via a predetermined bus. A monitor 2 is connected to the video I / F 17. The external memory I / F 18 is connected to the external memory card 5 and can access a backup memory or the like provided in the external memory card 5. A speaker 22 built in the monitor 2 is connected to the audio I / F 19, and sound data read by the DSP 14 from the ARAM 15 and sound data directly output from the disk drive 20 are output from the speaker 22. A disk drive 20 is connected to the disk I / F 21. The disk drive 20 reads data stored on the optical disk 4 arranged at a predetermined reading position, and outputs it to the bus of the game apparatus 3 and the audio I / F 19.

次に、図3〜図8を参照して、コントローラ7について説明する。図3〜図4は、コントローラ7の外観構成を示す斜視図である。図3Aは、コントローラ7の上側後方から見た斜視図であり、図3Bは、コントローラ7を下側後方から見た斜視図である。図4は、コントローラ7を前方から見た図である。   Next, the controller 7 will be described with reference to FIGS. 3 to 4 are perspective views showing the external configuration of the controller 7. 3A is a perspective view of the controller 7 as viewed from the upper rear side, and FIG. 3B is a perspective view of the controller 7 as viewed from the lower rear side. FIG. 4 is a view of the controller 7 as viewed from the front.

図3A〜図4において、コントローラ7は、例えばプラスチック成型によって形成されたハウジング31を有している。ハウジング31は、その前後方向(図3に示すz軸方向)を長手方向とした略直方体形状を有しており、全体として大人や子供の片手で把持可能な大きさである。プレイヤは、コントローラ7を用いることによって、それに設けられたボタンを押下すること、コントローラ7自体を動かすこと、および、コントローラ7自体の位置や姿勢を変えることによってゲーム操作を行うことができる。例えば、プレイヤは、コントローラ7の傾きを変化させたり、コントローラ7を動かしたりする(例えば、コントローラ7を任意の方向に振る)ことによって、ゲーム空間に登場する操作対象に対する操作を行うことができる。また、例えば、プレイヤは、長手方向を軸としてコントローラ7を回転させたり、コントローラ7によって指し示される画面上の位置を変えたりする操作によって、操作対象に対する操作を行うことができる。ここで、「コントローラ7によって指し示される画面上の位置」とは、理想的には、コントローラ7の前端部から上記長手方向に延ばした直線とモニタ2の画面とが交わる位置であるが、厳密に当該位置である必要はなく、その周辺の位置をゲーム装置3によって算出することができればよい。以下では、コントローラ7によって指し示される画面上の位置を「コントローラ7の指示位置」と呼ぶ。また、コントローラ7(ハウジング31)の長手方向を、「コントローラ7の指示方向」と呼ぶことがある。   3A to 4, the controller 7 includes a housing 31 formed by plastic molding, for example. The housing 31 has a substantially rectangular parallelepiped shape whose longitudinal direction is the front-rear direction (the z-axis direction shown in FIG. 3), and is a size that can be gripped with one hand of an adult or a child as a whole. By using the controller 7, the player can perform a game operation by pressing a button provided on the controller 7, moving the controller 7 itself, and changing the position and posture of the controller 7 itself. For example, the player can perform an operation on the operation target appearing in the game space by changing the tilt of the controller 7 or moving the controller 7 (for example, shaking the controller 7 in an arbitrary direction). Further, for example, the player can perform an operation on the operation target by an operation of rotating the controller 7 about the longitudinal direction or changing a position on the screen indicated by the controller 7. Here, the “position on the screen indicated by the controller 7” is ideally a position where the straight line extending in the longitudinal direction from the front end of the controller 7 and the screen of the monitor 2 intersect. It is not necessary to be the position, and it is only necessary that the surrounding position can be calculated by the game apparatus 3. Hereinafter, the position on the screen pointed to by the controller 7 is referred to as a “designated position of the controller 7”. Further, the longitudinal direction of the controller 7 (housing 31) may be referred to as “instruction direction of the controller 7”.

ハウジング31には、複数の操作キーが設けられる。ハウジング31の上面には、十字キー32a、Xボタン32b、Yボタン32c、Aボタン32d、セレクトスイッチ32e、メニュースイッチ32f、およびスタートスイッチ32gが設けられる。一方、ハウジング31の下面には凹部が形成されており、当該凹部の後面側傾斜面にはBボタン32iが設けられる。これらの各操作キー(ボタン)は、ゲーム装置3が実行するゲームプログラムに応じてそれぞれの機能が割り当てられるが、本発明の説明とは直接関連しないためここでは詳細な説明を省略する。また、ハウジング31の上面には、遠隔からゲーム装置3本体の電源をオン/オフするための電源スイッチ32hが設けられる。   The housing 31 is provided with a plurality of operation keys. On the upper surface of the housing 31, a cross key 32a, an X button 32b, a Y button 32c, an A button 32d, a select switch 32e, a menu switch 32f, and a start switch 32g are provided. On the other hand, a recess is formed in the lower surface of the housing 31, and a B button 32i is provided on the rear inclined surface of the recess. Each of these operation keys (buttons) is assigned a function according to a game program executed by the game apparatus 3, but is not directly related to the description of the present invention, and thus a detailed description thereof is omitted here. In addition, a power switch 32h for turning on / off the power source of the game apparatus 3 from a remote location is provided on the upper surface of the housing 31.

また、コントローラ7は撮像情報演算部35(図5B)を有しており、図4に示すように、ハウジング31前面には撮像情報演算部35の光入射面35aが設けられる。一方、ハウジング31の後面にはコネクタ33が設けられている。コネクタ33は、例えば32ピンのエッジコネクタであり、コントローラ7に他の機器を接続するために利用される。また、ハウジング31上面の後面側には複数のLED34が設けられる。ここで、コントローラ7には、他のコントローラ7と区別するためにコントローラ種別(番号)が付与される。LED34は、コントローラ7に現在設定されている上記コントローラ種別をプレイヤに通知するために用いられる。具体的には、コントローラ7からゲーム装置3へ操作データを送信する際、上記コントローラ種別に応じて複数のLED34のいずれか1つが点灯する。   The controller 7 has an imaging information calculation unit 35 (FIG. 5B). As shown in FIG. 4, a light incident surface 35 a of the imaging information calculation unit 35 is provided on the front surface of the housing 31. On the other hand, a connector 33 is provided on the rear surface of the housing 31. The connector 33 is a 32-pin edge connector, for example, and is used to connect another device to the controller 7. A plurality of LEDs 34 are provided on the rear surface side of the upper surface of the housing 31. Here, a controller type (number) is assigned to the controller 7 in order to distinguish it from other controllers 7. The LED 34 is used to notify the player of the controller type currently set in the controller 7. Specifically, when operating data is transmitted from the controller 7 to the game apparatus 3, any one of the plurality of LEDs 34 is turned on according to the controller type.

次に、図5Aおよび図5Bを参照して、コントローラ7の内部構造について説明する。図5Aおよび図5Bは、コントローラ7の内部構造を示す図である。なお、図5Aは、コントローラ7の上筐体(ハウジング31の一部)を外した状態を示す斜視図である。図5Bは、コントローラ7の下筐体(ハウジング31の一部)を外した状態を示す斜視図である。図5Bに示す斜視図は、図5Aに示す基板300を裏面から見た斜視図となっている。   Next, the internal structure of the controller 7 will be described with reference to FIGS. 5A and 5B. 5A and 5B are diagrams showing the internal structure of the controller 7. FIG. 5A is a perspective view showing a state in which the upper housing (a part of the housing 31) of the controller 7 is removed. FIG. 5B is a perspective view showing a state where the lower casing (a part of the housing 31) of the controller 7 is removed. The perspective view shown in FIG. 5B is a perspective view of the substrate 300 shown in FIG.

図5Aにおいて、ハウジング31の内部には基板300が固設されており、当該基板300の上主面上に操作キー32a〜32h、加速度センサ37、LED34、水晶振動子46、無線モジュール44、およびアンテナ45等が設けられる。そして、これらは、基板300等に形成された配線(図示せず)によってマイクロコンピュータ(Micro Computer:マイコン)42(図6参照)に接続される。また、無線モジュール44およびアンテナ45によって、コントローラ7がワイヤレスコントローラとして機能する。なお、水晶振動子46は、後述するマイコン42の基本クロックを生成する。   5A, a substrate 300 is fixed inside the housing 31, and operation keys 32a to 32h, an acceleration sensor 37, an LED 34, a crystal resonator 46, a wireless module 44, and a wireless module 44 are provided on the upper main surface of the substrate 300. An antenna 45 and the like are provided. These are connected to a microcomputer (microcomputer) 42 (see FIG. 6) by wiring (not shown) formed on the substrate 300 or the like. Further, the controller 7 functions as a wireless controller by the wireless module 44 and the antenna 45. The crystal unit 46 generates a basic clock for the microcomputer 42 described later.

一方、図5Bにおいて、基板300の下主面上の前端縁に撮像情報演算部35が設けられる。撮像情報演算部35は、コントローラ7の前方から順に赤外線フィルタ38、レンズ39、撮像素子40(例えばCMOSイメージセンサやCCDイメージセンサ)、および画像処理回路41によって構成されおり、それぞれ基板300の下主面に取り付けられる。また、基板300の下主面上の後端縁にコネクタ33が取り付けられる。そして、撮像情報演算部35の後方であって基板300の下主面上にAボタン32iが取り付けられていて、それよりさらに後方に電池47が収容される。電池47とコネクタ33との間の基板300の下主面上には、バイブレータ48が取り付けられる。このバイブレータ48は、例えば振動モータやソレノイドであってよい。バイブレータ48が作動することによってコントローラ7に振動が発生するので、それを把持しているプレイヤの手にその振動が伝達され、いわゆる振動対応ゲームを実現することができる。   On the other hand, in FIG. 5B, the imaging information calculation unit 35 is provided at the front edge on the lower main surface of the substrate 300. The imaging information calculation unit 35 includes an infrared filter 38, a lens 39, an imaging device 40 (for example, a CMOS image sensor or a CCD image sensor), and an image processing circuit 41 in order from the front of the controller 7. Attached to the surface. The connector 33 is attached to the rear edge on the lower main surface of the substrate 300. The A button 32i is attached to the lower main surface of the substrate 300 behind the imaging information calculation unit 35, and the battery 47 is accommodated further rearward. A vibrator 48 is attached on the lower main surface of the substrate 300 between the battery 47 and the connector 33. The vibrator 48 may be, for example, a vibration motor or a solenoid. Since the vibration is generated in the controller 7 by the operation of the vibrator 48, the vibration is transmitted to the hand of the player holding the vibrator 48, and a so-called vibration-compatible game can be realized.

なお、図3A〜図5Bに示したコントローラ7の形状や、各操作キーの形状、加速度センサやバイブレータの数および設置位置等は単なる一例に過ぎず、他の形状、数、および設置位置であっても、本発明を実現することができることは言うまでもない。例えば、加速度センサをX軸の正負いずれかの方向にずらせばZ軸周りの回転を算出しやすくできたり、バイブレータをコントローラ先端側に配置すればコントローラ全体が揺れやすくできるなどの効果も想定できる。また、コントローラ7における撮像情報演算部35の位置(撮像情報演算部35の光入射面35a)は、ハウジング31の前面でなくてもよく、ハウジング31の外部から光を取り入れることができれば他の面に設けられてもかまわない。このとき、上記「コントローラ7の指示方向」は、光入射面に垂直な方向、すなわち、撮像素子40の撮像方向となる。   It should be noted that the shape of the controller 7 shown in FIGS. 3A to 5B, the shape of each operation key, the number of acceleration sensors and vibrators, the installation positions, and the like are merely examples, and other shapes, numbers, and installation positions. However, it goes without saying that the present invention can be realized. For example, it can be assumed that the rotation around the Z axis can be easily calculated by shifting the acceleration sensor in either the positive or negative direction of the X axis, and that the entire controller can be easily shaken if the vibrator is arranged on the tip side of the controller. Further, the position of the imaging information calculation unit 35 in the controller 7 (the light incident surface 35a of the imaging information calculation unit 35) does not have to be the front surface of the housing 31, and other surfaces can be used as long as light can be taken in from the outside of the housing 31. May be provided. At this time, the “instruction direction of the controller 7” is a direction perpendicular to the light incident surface, that is, an imaging direction of the imaging element 40.

図6は、コントローラ7の構成を示すブロック図である。コントローラ7は、操作部32(各操作キー)、撮像情報演算部35、通信部36、および加速度センサ37を備えている。なお、本実施形態において、コントローラ7は、加速度検出手段(加速度センサ37)を備えていればよく、操作部32および撮像情報演算部35を備えていない構成であってもよい。   FIG. 6 is a block diagram showing the configuration of the controller 7. The controller 7 includes an operation unit 32 (each operation key), an imaging information calculation unit 35, a communication unit 36, and an acceleration sensor 37. In the present embodiment, the controller 7 only needs to include the acceleration detection unit (acceleration sensor 37), and may not include the operation unit 32 and the imaging information calculation unit 35.

加速度センサ37は、コントローラ7の加速度(重力加速度を含む)を検出する、すなわち、コントローラ7に加わる力(重力を含む)を検出する。加速度センサ37は、当該加速度センサ37の検出部に加わっている加速度のうち、センシング軸方向に沿った直線方向の加速度の値を検出する。例えば、2軸以上の多軸加速度センサの場合には、加速度センサの検出部に加わっている加速度として、各軸に沿った成分の加速度(直線加速度)をそれぞれ検出する。例えば、3軸または2軸の加速度センサ37は、アナログ・デバイセズ株式会社(Analog Devices, Inc.)またはSTマイクロエレクトロニクス社(STMicroelectronics N.V.)から入手可能である種類のものでもよい。   The acceleration sensor 37 detects the acceleration (including gravitational acceleration) of the controller 7, that is, detects the force (including gravity) applied to the controller 7. The acceleration sensor 37 detects the acceleration value in the linear direction along the sensing axis direction among the accelerations applied to the detection unit of the acceleration sensor 37. For example, in the case of a multi-axis acceleration sensor having two or more axes, component acceleration along each axis (linear acceleration) is detected as the acceleration applied to the detection unit of the acceleration sensor. For example, the triaxial or biaxial acceleration sensor 37 may be of the type available from Analog Devices, Inc. or ST Microelectronics NV.

本実施形態では、加速度センサ37は、コントローラ7を基準とした上下方向(図3Aおよび図3Bに示すy軸方向)、左右方向(図3Aおよび図3Bに示すx軸方向)および前後方向(図3Aおよび図3Bに示すz軸方向)の3軸方向に関してそれぞれ直線加速度を検出する。加速度センサ37は、各軸に沿った直線方向に関する加速度を検出するものであるため、加速度センサ37からの出力は3軸それぞれの直線加速度の値を表すものとなる。すなわち、検出された加速度は、コントローラ7を基準に設定されるxyz座標系における3次元のベクトルとして表される。以下では、加速度センサ37によって検出される、複数の軸に関する各加速度値を各成分とするベクトルを加速度ベクトルと呼ぶ。   In the present embodiment, the acceleration sensor 37 has a vertical direction (y-axis direction shown in FIGS. 3A and 3B), a horizontal direction (x-axis direction shown in FIGS. 3A and 3B), and a front-rear direction (see FIG. 3). The linear acceleration is detected in each of the three axis directions (z-axis direction shown in 3A and FIG. 3B). Since the acceleration sensor 37 detects acceleration in the linear direction along each axis, the output from the acceleration sensor 37 represents the linear acceleration value of each of the three axes. That is, the detected acceleration is expressed as a three-dimensional vector in the xyz coordinate system set with the controller 7 as a reference. In the following, a vector that is detected by the acceleration sensor 37 and has respective acceleration values related to a plurality of axes as components is referred to as an acceleration vector.

図7および図8は、コントローラ7の動きと加速度センサの出力との関係を示す図である。図7は、重力加速度(図7に示すベクトルVA)がコントローラ7を基準とした下方向を向く状態を示している。なお、図7では、コントローラ7は水平で静止した状態にあるものとする。この状態においては、コントローラ7には常に重力(重力加速度)が加わっているので、加速度ベクトルVAは重力加速度のみを示すものとなる。例えば、図7に示す状態においては加速度ベクトルVAはy軸負方向を向く。つまり、加速度センサ37のy軸負方向に1Gの重力加速度が加わり、x軸およびz軸の加速度はほぼ0となる。なお、本実施形態においては、コントローラ7が静止している状態で加速度センサ37によって検出される加速度の大きさ、すなわち、加速度センサ37によって検出される加速度が重力加速度のみを表すときの当該加速度の大きさを、1と表す。例えば、図7に示す状態において検出される加速度ベクトルVAの各成分の値は、(x,y,z)=(0,−1,0)となる。   7 and 8 are diagrams showing the relationship between the movement of the controller 7 and the output of the acceleration sensor. FIG. 7 shows a state in which the gravitational acceleration (vector VA shown in FIG. 7) is directed downward with the controller 7 as a reference. In FIG. 7, the controller 7 is assumed to be horizontal and stationary. In this state, since gravity (gravity acceleration) is always applied to the controller 7, the acceleration vector VA indicates only gravity acceleration. For example, in the state shown in FIG. 7, the acceleration vector VA is in the negative y-axis direction. That is, 1 G of gravitational acceleration is applied to the acceleration sensor 37 in the negative y-axis direction, and the x-axis and z-axis accelerations are almost zero. In the present embodiment, the magnitude of acceleration detected by the acceleration sensor 37 while the controller 7 is stationary, that is, the acceleration detected when the acceleration detected by the acceleration sensor 37 represents only gravitational acceleration. The size is represented as 1. For example, the value of each component of the acceleration vector VA detected in the state shown in FIG. 7 is (x, y, z) = (0, −1, 0).

一方、図8は、コントローラ7を移動させている時の状態を示している。図8は、xz平面に平行であってかつx軸負方向側から正方向側の向きに、コントローラ7の前端部が後端部よりも大きい半径の円弧を描くように、コントローラ7が移動している状態を示している。コントローラ7が図8に示すように移動する場合とは、典型的には、コントローラ7の前面がプレイヤの前方方向に向くようにプレイヤが一方の手でコントローラ7を把持した状態で右から左にプレイヤがコントローラ7を振った(移動させた)場合である。図8に示す状態においては、加速度センサ37には、重力の他に、コントローラ7の移動による慣性力が加えられる。したがって、加速度センサ37は、コントローラ7に加わる重力に起因する加速度VA’と、コントローラ7の移動による慣性力に起因する加速度VA”(x,y軸成分の合成ベクトルとして現れる)とを合成した加速度VAを検出する。詳細は後述するが、このように検出される加速度VAに基づいて、ゲーム装置3はコントローラ7の振り方向を算出する。なお、本明細書において「振り方向」とは、重力方向に対するコントローラ7の移動方向(絶対的な方向)を指し、コントローラ7の向きを基準として表される移動方向(相対的な方向)と区別する。   On the other hand, FIG. 8 shows a state when the controller 7 is moved. FIG. 8 shows that the controller 7 moves so that the front end of the controller 7 draws an arc having a larger radius than the rear end in a direction parallel to the xz plane and from the x-axis negative direction side to the positive direction side. It shows the state. The case where the controller 7 moves as shown in FIG. 8 is typically from right to left with the player holding the controller 7 with one hand so that the front surface of the controller 7 faces the front of the player. This is a case where the player swings (moves) the controller 7. In the state shown in FIG. 8, an inertial force due to the movement of the controller 7 is applied to the acceleration sensor 37 in addition to the gravity. Therefore, the acceleration sensor 37 combines the acceleration VA ′ caused by gravity applied to the controller 7 and the acceleration VA ″ (appears as a combined vector of x and y axis components) caused by the inertial force due to the movement of the controller 7. Although the details will be described later, the game apparatus 3 calculates the swing direction of the controller 7 based on the acceleration VA detected in this way. It refers to the moving direction (absolute direction) of the controller 7 with respect to the direction, and is distinguished from the moving direction (relative direction) expressed with reference to the direction of the controller 7.

また、加速度センサ37には、その素子の特性によるが検出可能な加速度の大きさに限界がある。本実施形態では、各軸に関して加速度センサ37で検出可能な範囲の限界値を“±2.2”とする。すなわち、加速度センサ37は、実際の加速度が2.2よりも大きい値となる場合や、実際の加速度が−2.2よりも小さい値となる場合であっても、−2.2〜2.2までの範囲で加速度値を出力する。   The acceleration sensor 37 has a limit in the magnitude of acceleration that can be detected depending on the characteristics of the element. In the present embodiment, the limit value of the range that can be detected by the acceleration sensor 37 for each axis is “± 2.2”. That is, even if the acceleration sensor 37 has a value larger than 2.2 or a value smaller than -2.2, the acceleration sensor 37 has a value of -2.2 to 2.2. Acceleration values are output in the range up to 2.

加速度センサ37が検出した加速度(加速度ベクトル)を示すデータ(加速度データ)は、通信部36へ出力される。なお、本実施形態では、コントローラ7の通信部36は、逐次(例えば0.5msに1回)に加速度データをゲーム装置3へ出力する。ゲーム装置3は、この加速度データからコントローラ7の振り方向を算出し、当該振り方向に応じたゲーム処理を実行する。なお、加速度センサ37は、各軸に沿った直線成分の加速度を検出するものであるので、ゲーム装置3は、コントローラ7の振り方向を直接検出することはできない。このため、加速度センサ37を搭載したデバイスの振り方向は、加速度センサの各軸毎に検出される加速度に所定の演算処理を施すことによって算出される。   Data (acceleration data) indicating the acceleration (acceleration vector) detected by the acceleration sensor 37 is output to the communication unit 36. In the present embodiment, the communication unit 36 of the controller 7 sequentially outputs acceleration data to the game apparatus 3 (for example, once every 0.5 ms). The game apparatus 3 calculates the swing direction of the controller 7 from the acceleration data, and executes a game process corresponding to the swing direction. Since the acceleration sensor 37 detects the acceleration of a linear component along each axis, the game apparatus 3 cannot directly detect the swing direction of the controller 7. For this reason, the swing direction of the device on which the acceleration sensor 37 is mounted is calculated by performing a predetermined calculation process on the acceleration detected for each axis of the acceleration sensor.

図6の説明に戻り、撮像情報演算部35は、撮像手段が撮像した画像データを解析してその中で輝度が高い領域を判別してその領域の重心位置やサイズなどを算出するためのシステムである。撮像情報演算部35は、例えば最大200フレーム/秒程度のサンプリング周期を有するので、比較的高速なコントローラ7の動きでも追跡して解析することができる。   Returning to the description of FIG. 6, the imaging information calculation unit 35 analyzes the image data captured by the imaging unit, discriminates a region having high luminance, and calculates the position of the center of gravity, the size, and the like of the region. It is. Since the imaging information calculation unit 35 has a sampling period of, for example, about 200 frames / second at the maximum, it can track and analyze even a relatively fast movement of the controller 7.

撮像情報演算部35は、赤外線フィルタ38、レンズ39、撮像素子40、および画像処理回路41を含んでいる。赤外線フィルタ38は、コントローラ7の前方から入射する光から赤外線のみを通過させる。ここで、モニタ2の表示画面近傍に配置されるマーカ8aおよび8bは、モニタ2の前方に向かって赤外光を出力する赤外LEDである。したがって、赤外線フィルタ38を設けることによってマーカ8aおよび8bの画像をより正確に撮像することができる。レンズ39は、赤外線フィルタ38を透過した赤外線を集光して撮像素子40へ入射させる。撮像素子40は、例えばCMOSセンサやあるいはCCDのような固体撮像素子であり、レンズ39が集光した赤外線を撮像する。したがって、撮像素子40は、赤外線フィルタ38を通過した赤外線だけを撮像して画像データを生成する。以下では、撮像素子40によって撮像された画像を撮像画像と呼ぶ。撮像素子40によって生成された画像データは、画像処理回路41で処理される。画像処理回路41は、撮像画像内における撮像対象(マーカ8aおよび8b)の位置を算出する。   The imaging information calculation unit 35 includes an infrared filter 38, a lens 39, an imaging element 40, and an image processing circuit 41. The infrared filter 38 allows only infrared light to pass from light incident from the front of the controller 7. Here, the markers 8 a and 8 b arranged in the vicinity of the display screen of the monitor 2 are infrared LEDs that output infrared light toward the front of the monitor 2. Therefore, by providing the infrared filter 38, the images of the markers 8a and 8b can be taken more accurately. The lens 39 collects the infrared light transmitted through the infrared filter 38 and makes it incident on the image sensor 40. The image sensor 40 is a solid-state image sensor such as a CMOS sensor or a CCD, for example, and images the infrared rays collected by the lens 39. Accordingly, the image sensor 40 captures only the infrared light that has passed through the infrared filter 38 and generates image data. Hereinafter, an image captured by the image sensor 40 is referred to as a captured image. Image data generated by the image sensor 40 is processed by the image processing circuit 41. The image processing circuit 41 calculates the position of the imaging target (markers 8a and 8b) in the captured image.

撮像画像が入力されると、画像処理回路41は、撮像画像内において所定条件に合致する領域の位置を示す座標を当該領域毎に算出する。ここで、所定条件とは、撮像対象の画像(対象画像)を特定するための条件である。所定条件の具体的な内容は、輝度が所定値以上の領域(高輝度領域)であり、かつ、領域の大きさが所定範囲内の大きさであることである。なお、所定条件は撮像対象を特定するための条件であればよく、他の実施形態においては、画像の色に関する条件を含んでいてもよい。   When a captured image is input, the image processing circuit 41 calculates a coordinate indicating the position of a region that matches a predetermined condition in the captured image for each region. Here, the predetermined condition is a condition for specifying an image to be captured (target image). The specific content of the predetermined condition is that the luminance is a region (high luminance region) having a predetermined value or more, and the size of the region is a size within a predetermined range. The predetermined condition may be a condition for specifying an imaging target, and in other embodiments, may include a condition related to the color of the image.

対象画像の位置を算出する際、まず、画像処理回路41は、撮像画像の領域から上記高輝度領域を対象画像の候補として特定する。撮像画像の画像データにおいて対象画像は高輝度領域として現れるからである。次に、画像処理回路41は、特定された高輝度領域の大きさに基づいて、その高輝度領域が対象画像であるか否かを判定する判定処理を行う。撮像画像には、対象画像である2つのマーカ8aおよび8bの画像の他、窓からの太陽光や部屋の蛍光灯の光によって対象画像以外の画像が含まれている場合がある。この場合、マーカ8aおよび8bの画像以外の画像も高輝度領域として現れてしまう。上記の判定処理は、対象画像であるマーカ8aおよび8bの画像とそれ以外の画像とを区別し、対象画像を正確に特定するための処理である。具体的には、当該判定処理においては、特定された高輝度領域が予め定められた所定範囲内の大きさであるか否かが判定される。そして、高輝度領域が所定範囲内の大きさである場合、当該高輝度領域は対象画像を表すと判定され、高輝度領域が所定範囲内の大きさでない場合、当該高輝度領域は対象画像以外の画像を表すと判定される。   When calculating the position of the target image, first, the image processing circuit 41 specifies the high-intensity region as a target image candidate from the region of the captured image. This is because the target image appears as a high luminance area in the image data of the captured image. Next, the image processing circuit 41 performs determination processing for determining whether or not the high luminance area is a target image based on the size of the specified high luminance area. In addition to the images of the two markers 8a and 8b that are target images, the captured image may include images other than the target image due to sunlight from a window or light from a fluorescent lamp in a room. In this case, images other than the images of the markers 8a and 8b also appear as high brightness areas. The above determination process is a process for distinguishing between the images of the markers 8a and 8b, which are target images, and other images, and accurately specifying the target image. Specifically, in the determination process, it is determined whether or not the specified high luminance area has a size within a predetermined range. If the high brightness area is a size within the predetermined range, the high brightness area is determined to represent the target image. If the high brightness area is not a size within the predetermined range, the high brightness area is other than the target image. It is determined that the image is represented.

さらに、上記の判定処理の結果、対象画像を表すと判定された高輝度領域について、画像処理回路41は当該高輝度領域の位置を算出する。具体的には、当該高輝度領域の重心位置を算出する。なお、重心位置は撮像素子40の解像度よりも詳細なスケールで算出することが可能である。例えば、撮像素子40によって撮像された撮像画像の解像度が126×96である場合でも、重心位置を1024×768のスケールで算出することが可能である。このとき、重心位置の座標は、(0,0)から(1024,768)までの整数値で表現される。   Furthermore, as a result of the above determination processing, the image processing circuit 41 calculates the position of the high luminance region for the high luminance region determined to represent the target image. Specifically, the barycentric position of the high brightness area is calculated. Note that the position of the center of gravity can be calculated on a more detailed scale than the resolution of the image sensor 40. For example, even when the resolution of a captured image captured by the image sensor 40 is 126 × 96, the center of gravity position can be calculated on a scale of 1024 × 768. At this time, the coordinates of the barycentric position are expressed by integer values from (0, 0) to (1024, 768).

以上のようにして、画像処理回路41は、撮像画像内において所定条件に合致する領域の位置を示す座標を当該領域毎に算出する。画像処理回路41は、算出された座標を通信部36のマイコン42へ出力する。この座標のデータは、マイコン42によって操作データとしてゲーム装置3に送信される。この座標はコントローラ7自体の向き(姿勢)や位置に対応して変化するので、ゲーム装置3はこの座標値を用いてコントローラ7の向きや位置を算出することができる。なお、本実施形態では、上記座標のデータはゲーム処理に用いられないので、コントローラ7は撮像情報演算部35を備えていない構成であってもよい。   As described above, the image processing circuit 41 calculates the coordinates indicating the position of the region that matches the predetermined condition in the captured image for each region. The image processing circuit 41 outputs the calculated coordinates to the microcomputer 42 of the communication unit 36. The coordinate data is transmitted to the game apparatus 3 as operation data by the microcomputer 42. Since these coordinates change corresponding to the orientation (posture) and position of the controller 7 itself, the game apparatus 3 can calculate the orientation and position of the controller 7 using this coordinate value. In the present embodiment, since the coordinate data is not used for the game process, the controller 7 may not include the imaging information calculation unit 35.

操作部32は、上述した十字キー32a等の各操作キー32a〜32iに相当し、各操作キー32a〜32iに対する入力状態(各操作キー32a〜32iが押下されたか否か)を示すデータを通信部36のマイコン42へ出力する。   The operation unit 32 corresponds to each operation key 32a to 32i such as the cross key 32a described above, and communicates data indicating an input state (whether or not each operation key 32a to 32i is pressed) to each operation key 32a to 32i. The data is output to the microcomputer 42 of the unit 36.

通信部36は、マイコン42、メモリ43、無線モジュール44、およびアンテナ45を含んでいる。マイコン42は、処理の際にメモリ43を記憶領域として用いながら、マイコン42が取得したデータを無線送信する無線モジュール44を制御する。   The communication unit 36 includes a microcomputer 42, a memory 43, a wireless module 44, and an antenna 45. The microcomputer 42 controls the wireless module 44 that wirelessly transmits data acquired by the microcomputer 42 while using the memory 43 as a storage area during processing.

操作部32および撮像情報演算部35および加速度センサ37からマイコン42へ出力されたデータは、一時的にメモリ43に格納される。ここで、通信部36から受信ユニット6への無線送信は所定の周期毎に行われるが、ゲームの処理は1/60秒を単位として(1フレーム時間として)行われることが一般的であるので、この時間以下の周期で送信を行うことが好ましい。マイコン42は、受信ユニット6への送信タイミングが到来すると、メモリ43に格納されているデータを操作データとして無線モジュール44へ出力する。無線モジュール44は、例えばBluetooth(ブルートゥース)(登録商標)の技術を用いて、所定周波数の搬送波を操作データで変調し、その微弱電波信号をアンテナ45から放射する。つまり、操作データは、無線モジュール44で微弱電波信号に変調されてコントローラ7から送信される。微弱電波信号はゲーム装置3側の受信ユニット6で受信される。受信された微弱電波信号について復調や復号を行うことによって、ゲーム装置3は操作データを取得することができる。そして、ゲーム装置3のCPU10は、取得した操作データとゲームプログラムとに基づいて、ゲーム処理を行う。   Data output from the operation unit 32, the imaging information calculation unit 35, and the acceleration sensor 37 to the microcomputer 42 is temporarily stored in the memory 43. Here, the wireless transmission from the communication unit 36 to the receiving unit 6 is performed every predetermined period, but the game processing is generally performed in units of 1/60 seconds (one frame time). It is preferable to perform transmission at a period equal to or shorter than this time. When the transmission timing to the receiving unit 6 arrives, the microcomputer 42 outputs the data stored in the memory 43 to the wireless module 44 as operation data. The wireless module 44 modulates a carrier wave of a predetermined frequency with operation data using, for example, Bluetooth (registered trademark) technology, and radiates a weak radio signal from the antenna 45. That is, the operation data is modulated by the wireless module 44 into a weak radio signal and transmitted from the controller 7. The weak radio signal is received by the receiving unit 6 on the game apparatus 3 side. By demodulating and decoding the received weak radio signal, the game apparatus 3 can acquire operation data. And CPU10 of the game device 3 performs a game process based on the acquired operation data and a game program.

上記コントローラ7を用いることによって、プレイヤは、各操作キーを押下する従来の一般的なゲーム操作に加えて、コントローラ7の姿勢を変化させたり、コントローラ7自身の位置を動かしたり、コントローラ7を回転させたりするというゲーム操作を行うことができる。   By using the controller 7, the player can change the attitude of the controller 7, move the position of the controller 7, or rotate the controller 7 in addition to the conventional general game operation of pressing each operation key. It is possible to perform game operations such as

図9は、コントローラ7を用いてゲーム操作するときの状態を概説する図解図である。ゲームシステム1においてコントローラ7を用いてゲームをプレイする際、プレイヤは、図9に示すように一方の手でコントローラ7を把持する。本実施形態では、プレイヤは、把持したコントローラ7を任意の方向に振る(移動させる)ことによってゲーム操作を行う。   FIG. 9 is an illustrative view outlining a state when a game operation is performed using the controller 7. When playing a game using the controller 7 in the game system 1, the player holds the controller 7 with one hand as shown in FIG. In the present embodiment, the player performs a game operation by swinging (moving) the gripped controller 7 in an arbitrary direction.

以下、上述したゲームシステム1を用いて行われるゲームの具体例について説明する。図10および図11は、本実施形態においてモニタ2に表示されるゲーム画面の一例を示す図である。図10および図11に示すように、モニタ2には、仮想の3次元ゲーム空間が表示される。ゲーム空間には、丸太を模したオブジェクト51(以下、丸太オブジェクト51と呼ぶ)、および、剣を模したオブジェクト52(以下、剣オブジェクト52と呼ぶ)が配置される。プレイヤは、コントローラ7を用いて剣オブジェクト52を操作し、剣オブジェクト52によって丸太オブジェクト51を切って遊ぶ(図11参照)。   Hereinafter, a specific example of a game performed using the above-described game system 1 will be described. 10 and 11 are diagrams illustrating an example of the game screen displayed on the monitor 2 in the present embodiment. As shown in FIGS. 10 and 11, a virtual three-dimensional game space is displayed on the monitor 2. An object 51 imitating a log (hereinafter referred to as a log object 51) and an object 52 imitating a sword (hereinafter referred to as a sword object 52) are arranged in the game space. The player operates the sword object 52 using the controller 7 and plays by cutting the log object 51 with the sword object 52 (see FIG. 11).

剣オブジェクト52の操作は、コントローラ7を任意の方向に振る動作によって行われる。すなわち、プレイヤは、剣オブジェクト52を操作するためにコントローラ7を任意の方向に振る操作(振り操作)を行う。なお、本ゲームでは、プレイヤは、コントローラ7の長手方向がコントローラ7の振り方向と略垂直になるようにコントローラ7を把持する。また、コントローラ7の持ち方に関して、プレイヤは、コントローラ7の上面が上下左右のどの方向の向きになるように把持してもよい。つまり、コントローラ7はz軸回りの回転方向に関しては任意の姿勢で把持される。   The operation of the sword object 52 is performed by an operation of swinging the controller 7 in an arbitrary direction. That is, the player performs an operation (shake operation) of swinging the controller 7 in an arbitrary direction in order to operate the sword object 52. In this game, the player holds the controller 7 so that the longitudinal direction of the controller 7 is substantially perpendicular to the swing direction of the controller 7. Further, regarding how to hold the controller 7, the player may hold the controller 7 so that the upper surface of the controller 7 is oriented in any direction, up, down, left and right. That is, the controller 7 is held in an arbitrary posture with respect to the rotation direction around the z axis.

プレイヤがコントローラ7を用いた上記振り操作を行うと、ゲーム装置3はまずコントローラ7の振り方向を算出する。本実施形態では、ゲーム装置3は、コントローラ7を基準としたxyz座標系(図3参照)におけるx軸およびy軸に関して、重力方向に対する振り方向を算出する。詳細は後述するが、本実施形態においては、z軸回りの回転方向に関してコントローラ7がどのような向きで把持されても、重力方向に対するコントローラ7の移動方向(振り方向)を算出することが可能である。なお、他の実施形態では、x軸、y軸およびz軸の3軸に関して、重力方向に対する振り方向を算出するようにしてもよい。   When the player performs the above swing operation using the controller 7, the game apparatus 3 first calculates the swing direction of the controller 7. In the present embodiment, the game apparatus 3 calculates the swing direction with respect to the gravity direction with respect to the x axis and the y axis in the xyz coordinate system (see FIG. 3) with the controller 7 as a reference. Although details will be described later, in this embodiment, it is possible to calculate the moving direction (swing direction) of the controller 7 with respect to the gravitational direction, regardless of the orientation of the controller 7 with respect to the rotation direction around the z-axis. It is. In another embodiment, the swing direction with respect to the gravity direction may be calculated with respect to the three axes of the x axis, the y axis, and the z axis.

振り方向を算出すると、ゲーム装置3は、画面内の剣オブジェクト52を振り方向に応じた方向に移動させる。例えば、プレイヤが左から右にコントローラ7を振った場合、剣オブジェクト52は画面の左から右に向かって移動する(図11参照)。また、プレイヤが下から上にコントローラ7を振った場合、剣オブジェクト52は画面の下から上に向かって移動する。   When the swing direction is calculated, the game apparatus 3 moves the sword object 52 in the screen in a direction corresponding to the swing direction. For example, when the player swings the controller 7 from left to right, the sword object 52 moves from left to right on the screen (see FIG. 11). When the player swings the controller 7 from the bottom to the top, the sword object 52 moves from the bottom to the top of the screen.

剣オブジェクト52を移動させると、ゲーム装置3は、剣オブジェクト52が丸太オブジェクト51と接触したか否かを判断する。そして、剣オブジェクト52が丸太オブジェクト51と接触した場合、図11に示すように、剣オブジェクト52の軌道に沿って丸太オブジェクト51を切断して表示する。このように、剣オブジェクト52はコントローラ7の振り方向に応じて移動するので、プレイヤは、コントローラ7を所望の方向に振ることによって、あたかも剣オブジェクト52を振っているかのような操作感を得ることができる。また、コントローラ7を振ってゲーム操作を行うという今までにないゲーム操作が可能となる。   When the sword object 52 is moved, the game apparatus 3 determines whether or not the sword object 52 has come into contact with the log object 51. When the sword object 52 comes into contact with the log object 51, the log object 51 is cut and displayed along the trajectory of the sword object 52 as shown in FIG. Thus, since the sword object 52 moves according to the swing direction of the controller 7, the player can obtain an operation feeling as if the sword object 52 is swung by swinging the controller 7 in a desired direction. Can do. In addition, an unprecedented game operation is possible in which a game operation is performed by shaking the controller 7.

次に、本実施形態においてゲーム装置3で実行されるプログラム処理について説明する。まず、ゲーム処理において用いられる主なデータについて図12を用いて説明する。図12は、ゲーム装置3のメインメモリ13に記憶される主なデータを示す図である。図12に示すように、メインメモリ13には、ゲームプログラム61、操作データ62、およびゲーム処理用データ63等が記憶される。なお、メインメモリ13には、図12に示すデータの他、ゲームに登場するオブジェクトの画像データ等、ゲーム処理に必要なデータが記憶される。   Next, program processing executed by the game apparatus 3 in the present embodiment will be described. First, main data used in the game process will be described with reference to FIG. FIG. 12 is a diagram showing main data stored in the main memory 13 of the game apparatus 3. As shown in FIG. 12, the main memory 13 stores a game program 61, operation data 62, game processing data 63, and the like. In addition to the data shown in FIG. 12, the main memory 13 stores data necessary for game processing, such as image data of objects appearing in the game.

ゲームプログラム61は、ゲーム装置3に電源が投入された後の適宜のタイミングで光ディスク4からその一部または全部が読み込まれてメインメモリ13に記憶される。ゲームプログラム61には、後述するゲーム処理の実行に必要なプログラムが含まれている。   A part or all of the game program 61 is read from the optical disc 4 and stored in the main memory 13 at an appropriate timing after the game apparatus 3 is turned on. The game program 61 includes a program necessary for executing a game process described later.

操作データ62は、コントローラ7からゲーム装置3へ送信されてきて、メインメモリ13に記憶される。操作データ62には、加速度データ621が含まれる。本実施形態では、加速度データ621は、上記x軸、y軸、およびz軸の3軸に関する加速度値を示す。なお、操作データ62には、加速度データ621の他、撮像画像内における撮像対象(マーカ8aおよび8b)の位置を示すデータや、操作部32の各ボタンに対して行われた操作内容を示すデータが含まれていてもよい。   The operation data 62 is transmitted from the controller 7 to the game apparatus 3 and stored in the main memory 13. The operation data 62 includes acceleration data 621. In the present embodiment, the acceleration data 621 indicates acceleration values related to the three axes, the x axis, the y axis, and the z axis. In addition to the acceleration data 621, the operation data 62 includes data indicating the position of the imaging target (markers 8 a and 8 b) in the captured image, and data indicating the operation performed on each button of the operation unit 32. May be included.

ゲーム処理用データ63は、後述するゲーム処理において用いられるデータである。ゲーム処理用データ63は、選出加速度データ群631、補助線データ632、第1〜第4制御点データ633〜636、第1〜第3方向ベクトルデータ637〜639、差分ベクトルデータ群640、移動方向データ641、重力方向データ642、振り方向データ643、および操作フラグデータ644を含む。   The game processing data 63 is data used in game processing described later. The game processing data 63 includes a selected acceleration data group 631, auxiliary line data 632, first to fourth control point data 633 to 636, first to third direction vector data 637 to 639, a difference vector data group 640, a moving direction. Data 641, gravity direction data 642, swing direction data 643, and operation flag data 644 are included.

選出加速度データ群631は、コントローラ7から逐次取得される加速度データのうちから所定の基準に従って選出された加速度データの集合である。所定の基準とは、コントローラ7から逐次取得される加速度データのうちで、移動期間内に取得されたことである。移動期間とは、コントローラ7が移動していると判断される期間である。具体的には、移動期間は、コントローラ7が動き始めたと判断される時点(開始時点)からコントローラ7の動きが終了したと判断される時点(終了時点)までの期間である。詳細は後述するが、移動期間の検出は、加速度センサ37によって検出されるz軸方向の加速度を用いて行われる。なお、選出加速度データ群631に含まれる加速度データは1つのみであることもある。   The selected acceleration data group 631 is a set of acceleration data selected according to a predetermined reference from the acceleration data sequentially acquired from the controller 7. The predetermined standard is that the acceleration data sequentially acquired from the controller 7 is acquired within the movement period. The movement period is a period during which it is determined that the controller 7 is moving. Specifically, the movement period is a period from a time point when it is determined that the controller 7 starts to move (start time point) to a time point when the movement of the controller 7 is determined to end (end time point). Although details will be described later, the detection of the movement period is performed using the acceleration in the z-axis direction detected by the acceleration sensor 37. The selected acceleration data group 631 may include only one acceleration data.

図13は、選出加速度データ群631の一例を示す図である。図13においては、1つのブロックが1つの加速度データを示しており、加速度データが取得された順番に従って上からブロックを配置している。以下では、選出加速度データ群631に含まれる加速度データのうちで、i番目(iは1以上の整数)に取得された加速度データにより示される加速度ベクトルを「VAi 」と示す。 FIG. 13 is a diagram illustrating an example of the selected acceleration data group 631. In FIG. 13, one block indicates one acceleration data, and the blocks are arranged from the top in the order in which the acceleration data is acquired. Hereinafter, among the acceleration data included in the selected acceleration data group 631, the acceleration vector indicated by the i-th (i is an integer of 1 or more) acquired acceleration data is indicated as “VA i ”.

図13に示すように、選出加速度データ群631としてメインメモリ13に記憶される各加速度データは、上記xyz座標系におけるx軸およびy軸に関する加速度値を各成分とする2次元の加速度ベクトルを示す。つまり、コントローラ7から取得された加速度データが選出加速度データ群631としてメインメモリ13に記憶される場合、加速度データにより示される3軸に関する各加速度値のうちのz軸に関する加速度値は記憶されず、残りのx軸およびy軸に関する加速度値のみを示すデータが記憶される。なお、選出加速度データ群631に含まれる加速度データを2次元の加速度ベクトルを示すデータとする理由は、本実施形態ではx軸およびy軸に関する振り方向を算出することを目的とするため、振り方向の算出処理においてz軸に関する加速度値を用いないからである。つまり、本実施形態では、ゲーム装置3は上記2次元の加速度ベクトルを用いてコントローラ7の振り方向を算出する。   As shown in FIG. 13, each acceleration data stored in the main memory 13 as the selected acceleration data group 631 indicates a two-dimensional acceleration vector having acceleration components related to the x-axis and the y-axis in the xyz coordinate system as components. . That is, when the acceleration data acquired from the controller 7 is stored in the main memory 13 as the selected acceleration data group 631, the acceleration value related to the z axis among the acceleration values related to the three axes indicated by the acceleration data is not stored. Data indicating only acceleration values relating to the remaining x-axis and y-axis is stored. The reason why the acceleration data included in the selected acceleration data group 631 is data indicating a two-dimensional acceleration vector is to calculate the swing direction with respect to the x-axis and the y-axis in the present embodiment. This is because the acceleration value relating to the z-axis is not used in the calculation process. That is, in the present embodiment, the game apparatus 3 calculates the swing direction of the controller 7 using the two-dimensional acceleration vector.

また、加速度センサ37は、検出可能な加速度の値には限界があり、限界を超える加速度に対しては限界値が出力される。したがって、選出加速度データ群631には、加速度データにより示される加速度ベクトルの各成分のうちのいずれかが、加速度センサ37で検出可能な範囲の限界値(=±2.2)をとる加速度データが含まれ得る。以下では、このような加速度データを「限界加速度データ」と呼ぶ。また、選出加速度データ群631のうちで限界加速度データでない加速度データを、「非限界加速度データ」と呼ぶ。図13では、第3番目の加速度ベクトルVA3 から第5番目の加速度ベクトルVA5 までの間、加速度ベクトルのx成分の値が、限界値である“−2.2”となる。したがって、第3番目から第5番目の加速度データが限界加速度データ群631’である。限界加速度データ群631’は、後述するデータ補正処理(ステップS22)によって加速度値が補正される。詳細は後述するが、データ補正処理においては、限界加速度データにより示される2次元加速度ベクトルの各成分のうちの上記限界値をとる成分が補正される。 Further, the acceleration sensor 37 has a limit in the detectable acceleration value, and a limit value is output for an acceleration exceeding the limit. Therefore, the selected acceleration data group 631 includes acceleration data in which any one of the components of the acceleration vector indicated by the acceleration data takes a limit value (= ± 2.2) of a range that can be detected by the acceleration sensor 37. May be included. Hereinafter, such acceleration data is referred to as “limit acceleration data”. Further, the acceleration data that is not the limit acceleration data in the selected acceleration data group 631 is referred to as “non-limit acceleration data”. In FIG. 13, between the third acceleration vector VA 3 and the fifth acceleration vector VA 5 , the value of the x component of the acceleration vector is “−2.2” which is a limit value. Therefore, the third to fifth acceleration data are the limit acceleration data group 631 ′. The acceleration value of the limit acceleration data group 631 ′ is corrected by a data correction process (step S22) described later. Although details will be described later, in the data correction process, a component that takes the limit value among the components of the two-dimensional acceleration vector indicated by the limit acceleration data is corrected.

図12の説明に戻り、補助線データ632は、上記限界加速度データ群631’の補正に用いる補助線を示すデータである。本実施形態では、補助線として3次のベジェ曲線を用いる。ベジェ曲線は、以下に示す、変数pと変数uとの関係式(1)によって定義される。
p=P0×(1−u)3+P1×3u(1−u)2+P2×3u2(1−u)+P3u3 …(1)
上式(1)において、変数pは、上記2次元加速度ベクトルと同様、x軸とy軸とからなるxy座標系における座標値である。変数uは、0≦u≦1の範囲内の値をとるスカラー値である。また、定数P0、P1、P2、およびP3は制御点である。これら4つの制御点の値を決めることでベジェ曲線の形状が決定される。
Returning to the description of FIG. 12, the auxiliary line data 632 is data indicating an auxiliary line used for correcting the limit acceleration data group 631 ′. In the present embodiment, a cubic Bezier curve is used as the auxiliary line. A Bezier curve is defined by the following relational expression (1) between a variable p and a variable u.
p = P0 × (1-u) 3 + P1 × 3u (1-u) 2 + P2 × 3u 2 (1-u) + P3u 3 (1)
In the above equation (1), the variable p is a coordinate value in the xy coordinate system composed of the x-axis and the y-axis, like the two-dimensional acceleration vector. The variable u is a scalar value that takes a value in the range of 0 ≦ u ≦ 1. Constants P0, P1, P2, and P3 are control points. By determining the values of these four control points, the shape of the Bezier curve is determined.

第1〜第4制御点データ633〜636は、上記ベジェ曲線の4つの制御点の値を示すデータである。すなわち、第1制御点データ633は上記制御点P0を示し、第2制御点データ634は上記制御点P1を示し、第3制御点データ635は上記制御点P2を示し、第4制御点データ636は上記制御点P3を示す。第1〜第4制御点P0〜P3は、上記x軸とy軸とからなるxy座標系における座標値で表現される。   The first to fourth control point data 633 to 636 are data indicating the values of the four control points of the Bezier curve. That is, the first control point data 633 indicates the control point P0, the second control point data 634 indicates the control point P1, the third control point data 635 indicates the control point P2, and the fourth control point data 636. Indicates the control point P3. The first to fourth control points P0 to P3 are expressed by coordinate values in the xy coordinate system including the x axis and the y axis.

第1〜第3方向ベクトルデータ637〜639は、上記4つの制御点P0〜P3を決定するために用いられる3つのベクトルを示す。すなわち、第1方向ベクトルデータ637は第1方向ベクトルV1を示し、第2方向ベクトルデータ638は第2方向ベクトルV2を示し、第3方向ベクトルデータ639は第3方向ベクトルV3を示す。第1〜第3方向ベクトルは、上記2次元加速度ベクトルと同様、上記xy座標系で表現される。第1〜第3方向ベクトルの算出方法については後述する。   The first to third direction vector data 637 to 639 indicate three vectors used for determining the four control points P0 to P3. That is, the first direction vector data 637 indicates the first direction vector V1, the second direction vector data 638 indicates the second direction vector V2, and the third direction vector data 639 indicates the third direction vector V3. The first to third direction vectors are expressed in the xy coordinate system, similarly to the two-dimensional acceleration vector. A method for calculating the first to third direction vectors will be described later.

差分ベクトルデータ群640は、選出加速度データ群631に含まれる各加速度データから算出される差分ベクトルデータの集合を示す。差分ベクトルデータは、選出加速度データ群631に含まれる各加速度データについて、加速度データにより示される加速度ベクトルと、その次に取得された加速度データにより示される加速度ベクトルとの差分のベクトルを示す。差分ベクトルデータ群640は、後述する移動方向ベクトルを算出するために用いられる。   The difference vector data group 640 indicates a set of difference vector data calculated from each acceleration data included in the selected acceleration data group 631. The difference vector data indicates a vector of a difference between the acceleration vector indicated by the acceleration data and the acceleration vector indicated by the acceleration data acquired next, for each acceleration data included in the selected acceleration data group 631. The difference vector data group 640 is used to calculate a moving direction vector to be described later.

移動方向データ641は、コントローラ7の向きを基準として表される当該コントローラ7の移動方向を示す。この移動方向は、上記xy座標系におけるベクトルによって表現される。以下では、この移動方向を表すベクトルを移動方向ベクトルと呼ぶ。移動方向ベクトルは、上記差分ベクトルデータ群640を用いて算出される。   The movement direction data 641 indicates the movement direction of the controller 7 expressed with reference to the direction of the controller 7. This moving direction is expressed by a vector in the xy coordinate system. Hereinafter, a vector representing this movement direction is referred to as a movement direction vector. The moving direction vector is calculated using the difference vector data group 640.

重力方向データ642は、コントローラ7の向きを基準として表される、コントローラ7に加わる重力の方向を示す。重力方向は、上記xy座標系におけるベクトルによって表現される。以下では、重力方向を表すベクトルを重力方向ベクトルと呼ぶ。重力方向ベクトルは、上記選出加速度データ群631を用いて算出される。   The gravity direction data 642 indicates the direction of gravity applied to the controller 7 expressed with reference to the direction of the controller 7. The direction of gravity is expressed by a vector in the xy coordinate system. Hereinafter, a vector representing the gravity direction is referred to as a gravity direction vector. The gravity direction vector is calculated using the selected acceleration data group 631.

振り方向データ643は、重力方向に対してコントローラ7が振られる方向(振り方向)を示す。振り方向は、重力方向を基準とした方向を表すためのXY座標系(図21参照)におけるベクトルによって表現される。以下では、振り方向を表すベクトルを振り方向ベクトルと呼ぶ。振り方向ベクトルは、上記移動方向ベクトルおよび上記重力方向ベクトルを用いて算出される。本実施形態では、直接的にはこの振り方向ベクトルに基づいてゲーム処理が実行される。すなわち、ゲーム装置3は、振り方向ベクトルの向きに応じた方向に剣オブジェクト52をゲーム空間内において移動させる。   The swing direction data 643 indicates a direction (swing direction) in which the controller 7 is swung with respect to the gravity direction. The swing direction is represented by a vector in an XY coordinate system (see FIG. 21) for representing a direction based on the direction of gravity. Hereinafter, a vector representing the swing direction is referred to as a swing direction vector. The swing direction vector is calculated using the movement direction vector and the gravity direction vector. In the present embodiment, the game process is executed directly based on this swing direction vector. That is, the game apparatus 3 moves the sword object 52 in the game space in a direction corresponding to the direction of the swing direction vector.

操作フラグデータ644は、プレイヤによって振り操作が行われている最中か否かを示す操作フラグのデータである。操作フラグは、振り操作が行われている時はオンに設定され、振り操作が行われていない時はオフに設定される。   The operation flag data 644 is operation flag data indicating whether or not a swing operation is being performed by the player. The operation flag is set to on when the swing operation is performed, and is set to off when the swing operation is not performed.

次に、ゲーム装置3において行われる処理の詳細を、図14〜図18を用いて説明する。図14は、ゲーム装置3において実行される処理の流れを示すメインフローチャートである。ゲーム装置3の電源が投入されると、ゲーム装置3のCPU10は、図示しないブートROMに記憶されている起動プログラムを実行し、これによってメインメモリ13等の各ユニットが初期化される。そして、光ディスク4に記憶されたゲームプログラムがメインメモリ13に読み込まれ、CPU10によって当該ゲームプログラムの実行が開始される。図14に示すフローチャートは、以上の処理が完了した後に行われる処理を示すフローチャートである。   Next, details of processing performed in the game apparatus 3 will be described with reference to FIGS. FIG. 14 is a main flowchart showing the flow of processing executed in the game apparatus 3. When the power of the game apparatus 3 is turned on, the CPU 10 of the game apparatus 3 executes a startup program stored in a boot ROM (not shown), whereby each unit such as the main memory 13 is initialized. Then, the game program stored in the optical disc 4 is read into the main memory 13 and the CPU 10 starts executing the game program. The flowchart shown in FIG. 14 is a flowchart showing processing performed after the above processing is completed.

まず、ステップS1において、以降の処理において用いられるデータの初期化処理が実行される。すなわち、CPU10は、メインメモリ13のゲーム処理用データ63に含まれる各データ631〜643の内容をクリアする。また、操作フラグデータ644の内容をオフを示すデータに設定する。なお、この時点で仮想の3次元空間に丸太オブジェクト51が配置される。ステップS1の実行後、ステップS2〜S11の処理ループが繰り返されることによって、ゲームが進行していく。   First, in step S1, data initialization processing used in the subsequent processing is executed. That is, the CPU 10 clears the contents of the data 631 to 643 included in the game processing data 63 in the main memory 13. Further, the content of the operation flag data 644 is set to data indicating OFF. At this time, the log object 51 is arranged in the virtual three-dimensional space. After execution of step S1, the game progresses by repeating the processing loop of steps S2 to S11.

ステップS2において、CPU10は、コントローラ7から操作データを取得する。すなわち、コントローラ7は所定時間間隔(例えば、1フレーム時間間隔以内)で操作データをゲーム装置3へ送信してくるので、CPU10は、送信されてきた操作データをメインメモリ13に記憶する。この操作データには、少なくとも上記加速度データが含まれている。CPU10は、加速度データをメインメモリ13に記憶する。なお、メインメモリ13にすでに加速度データ621が記憶されている場合には、加速度データ621の内容は取得された加速度データの内容となるように更新して記憶される。本実施形態においてステップS2の処理は、ステップS8〜S10の処理中を除いて1フレーム時間毎に実行されるので、ゲーム装置3は、加速度データを逐次取得することができる。   In step S <b> 2, the CPU 10 acquires operation data from the controller 7. That is, since the controller 7 transmits operation data to the game apparatus 3 at a predetermined time interval (for example, within one frame time interval), the CPU 10 stores the transmitted operation data in the main memory 13. This operation data includes at least the acceleration data. The CPU 10 stores acceleration data in the main memory 13. When acceleration data 621 is already stored in the main memory 13, the contents of the acceleration data 621 are updated and stored so as to be the contents of the acquired acceleration data. In the present embodiment, since the process of step S2 is executed every frame time except during the processes of steps S8 to S10, the game apparatus 3 can sequentially acquire acceleration data.

続くステップS3において、CPU10は、コントローラ7を振る操作がプレイヤによって行われている最中か否かを判定する。ステップS3の判定は、メインメモリ13に記憶されている操作フラグデータ644を参照することによって行われる。すなわち、操作フラグがオンに設定されている場合、コントローラ7を振る操作が行われている最中であると判断され、操作フラグがオフに設定されている場合、コントローラ7を振る操作が行われていないと判断される。ステップS3の判定結果が否定である場合、ステップS4の処理が実行される。一方、ステップS3の判定結果が肯定である場合、後述するステップS7の処理が実行される。   In subsequent step S3, the CPU 10 determines whether or not the operation of shaking the controller 7 is being performed by the player. The determination in step S3 is performed by referring to the operation flag data 644 stored in the main memory 13. That is, when the operation flag is set on, it is determined that the operation of shaking the controller 7 is being performed. When the operation flag is set off, the operation of shaking the controller 7 is performed. It is judged that it is not. If the determination result of step S3 is negative, the process of step S4 is executed. On the other hand, when the determination result of step S3 is affirmative, the process of step S7 described later is executed.

ステップS4において、CPU10は、振り操作が開始されたか否かを判定する。ステップS4の判定は、メインメモリ13に記憶されている加速度データ621に基づいて行われる。すなわち、加速度データ621により示されるz軸に関する加速度値が予め定められた第1閾値よりも大きい場合、振り操作が開始されたと判断され、当該z軸に関する加速度値が当該第1閾値以下である場合、振り操作が開始されていないと判断される。   In step S4, the CPU 10 determines whether or not a swing operation has been started. The determination in step S4 is made based on the acceleration data 621 stored in the main memory 13. That is, when the acceleration value related to the z-axis indicated by the acceleration data 621 is greater than a predetermined first threshold value, it is determined that the swing operation has started, and the acceleration value related to the z-axis is equal to or less than the first threshold value. It is determined that the swing operation has not been started.

ここで、振り操作が行われている間は、図8に示したように、z軸方向に関してコントローラ7に遠心力が加えられる。そのため、ある程度の速さで振り操作が行われている場合にはz軸に関する加速度値が第1閾値よりも大きくなる。したがって、上記ステップS4に示したように、z軸に関する加速度値を参照し、当該加速度値が所定の値(第1閾値)よりも大きいか否かを判定することによって、振り操作が行われているか否かを容易に判定することができる。   Here, while the swinging operation is performed, as shown in FIG. 8, a centrifugal force is applied to the controller 7 in the z-axis direction. Therefore, when the swing operation is performed at a certain speed, the acceleration value related to the z-axis becomes larger than the first threshold value. Therefore, as shown in step S4, the swing operation is performed by referring to the acceleration value related to the z-axis and determining whether the acceleration value is larger than a predetermined value (first threshold value). It can be easily determined whether or not there is.

ステップS4の判定結果が肯定である場合、ステップS5およびS6の処理が実行される。一方、ステップS4の判定結果が否定である場合、ステップS5およびS6の処理がスキップされて後述するステップS11の処理が実行される。   If the determination result of step S4 is affirmative, the processes of steps S5 and S6 are executed. On the other hand, if the determination result of step S4 is negative, the processes of steps S5 and S6 are skipped and the process of step S11 described later is executed.

ステップS5においては、操作フラグがオンに設定される。すなわち、CPU10は、メインメモリ13に記憶されている操作フラグデータ644の内容をオンを示すデータに書き換える。これによって、ステップS2〜S11のループ処理が次に行われるときにはステップS3の判定結果が肯定となる。   In step S5, the operation flag is set to ON. That is, the CPU 10 rewrites the contents of the operation flag data 644 stored in the main memory 13 to data indicating ON. Thereby, when the loop process of steps S2 to S11 is performed next, the determination result of step S3 becomes affirmative.

続くステップS6において、CPU10は、ステップS2で取得された加速度データを選出加速度データ群631として保存する。すなわち、選出加速度データ群631に含まれる加速度データに、メインメモリ13に記憶されている加速度データ621が追加される。なお、上述したように、本実施形態では、加速度データ621により示される3軸に関する各加速度値のうちのz軸に関する加速度値は記憶されず、残りのx軸およびy軸に関する加速度値のみを示すデータが記憶される。つまり、図13に示すように、2次元の加速度ベクトルを示すデータが記憶される。ステップS6の後、後述するステップS11の処理が実行される。   In subsequent step S <b> 6, the CPU 10 stores the acceleration data acquired in step S <b> 2 as a selected acceleration data group 631. That is, the acceleration data 621 stored in the main memory 13 is added to the acceleration data included in the selected acceleration data group 631. As described above, in the present embodiment, the acceleration value related to the z-axis among the acceleration values related to the three axes indicated by the acceleration data 621 is not stored, and only the acceleration values related to the remaining x-axis and y-axis are shown. Data is stored. That is, as shown in FIG. 13, data indicating a two-dimensional acceleration vector is stored. After step S6, the process of step S11 described later is executed.

一方、ステップS7において、CPU10は、振り操作が終了したか否かを判定する。ステップS7の判定は、メインメモリ13に記憶されている加速度データ621に基づいて行われる。すなわち、加速度データにより示されるz軸に関する加速度値が予め定められた第2閾値以下である場合、振り操作が終了したと判断され、当該z軸に関する加速度値が当該第2閾値よりも大きい場合、振り操作が終了していないと判断される。なお、振り操作が行われていない間は、図7に示したように、z軸方向に関してコントローラ7に遠心力が加えられないので、z軸に関する加速度値が第2閾値以下となる。したがって、上記のようにz軸に関する加速度値を参照し、当該加速度値が所定の値(第2閾値)以下であるか否かを判定することによって、振り操作が行われていないか否かを容易に判定することができる。なお、上記第1閾値および第2閾値は、同じ値であってもよいし、異なる値であってもよい。本実施形態では、例えば、第1閾値および第2閾値をともに“1.1”とする。ステップS7の判定結果が肯定である場合、後述するステップS8〜S10の処理が実行される。一方、ステップS7の判定結果が否定である場合、上述のステップS6の処理が実行される。   On the other hand, in step S7, the CPU 10 determines whether or not the swing operation has been completed. The determination in step S7 is made based on the acceleration data 621 stored in the main memory 13. That is, when the acceleration value related to the z-axis indicated by the acceleration data is equal to or smaller than a predetermined second threshold value, it is determined that the swing operation has ended, and when the acceleration value related to the z-axis is larger than the second threshold value, It is determined that the swing operation has not ended. Note that while the swing operation is not performed, as shown in FIG. 7, the centrifugal force is not applied to the controller 7 in the z-axis direction, so the acceleration value related to the z-axis is equal to or less than the second threshold value. Therefore, referring to the acceleration value related to the z-axis as described above, it is determined whether or not a swing operation is performed by determining whether or not the acceleration value is equal to or less than a predetermined value (second threshold value). It can be easily determined. The first threshold value and the second threshold value may be the same value or different values. In the present embodiment, for example, both the first threshold value and the second threshold value are set to “1.1”. If the determination result of step S7 is affirmative, the processes of steps S8 to S10 described later are executed. On the other hand, when the determination result of step S7 is negative, the process of step S6 described above is executed.

図15は、ある期間の間にステップS2で取得された加速度データの推移を示す図である。図15は、当該取得された加速度データにより示される加速度ベクトルを、x座標およびy座標からなる2次元座標系における座標として表している。図15における各点p1〜p19は各加速度ベクトルの終端の位置を示しており、各加速度ベクトルの始端の位置は原点である。例えば、点p1により示される加速度ベクトルは、原点を始端とし、点p1の位置を終端とするベクトルである。図15では、取得された順に点p1から、点p2、点p3、…、点p19までの19個の加速度ベクトルを示している。なお、図15において白丸で示される点は、その加速度ベクトルに対応する加速度データにより示されるz軸に関する加速度値が上記第1閾値(第2閾値)以下となる場合の加速度ベクトルを示す。また、図15において黒丸で示される点は、その加速度ベクトルに対応する加速度データにより示されるz軸に関する加速度値が上記第1閾値(第2閾値)よりも大きい場合の加速度ベクトルを示す。   FIG. 15 is a diagram showing the transition of the acceleration data acquired in step S2 during a certain period. FIG. 15 represents the acceleration vector indicated by the acquired acceleration data as coordinates in a two-dimensional coordinate system composed of x and y coordinates. Each point p1 to p19 in FIG. 15 indicates the position of the end of each acceleration vector, and the position of the start of each acceleration vector is the origin. For example, the acceleration vector indicated by the point p1 is a vector having the origin as the starting point and the position of the point p1 as the ending point. FIG. 15 shows 19 acceleration vectors from point p1 to point p2, point p3,..., Point p19 in the order of acquisition. In FIG. 15, dots indicated by white circles indicate acceleration vectors when the acceleration value related to the z-axis indicated by the acceleration data corresponding to the acceleration vector is equal to or less than the first threshold value (second threshold value). Further, in FIG. 15, a point indicated by a black circle indicates an acceleration vector when the acceleration value related to the z-axis indicated by the acceleration data corresponding to the acceleration vector is larger than the first threshold value (second threshold value).

ゲーム開始直後において振り操作が開始されていない時(コントローラ7が十分な速度で振られていない時を含む)には、白丸の点p1および点p2で示されるような、z軸に関する加速度値が第1閾値以下となる加速度データがステップS2で取得される。このとき、ステップS3およびS4の判定結果がともに否定となるので、加速度データは保存されない。そして、振り操作が開始されてある程度の速度でコントローラ7が振られると、黒丸の点p3で示されるような、z軸に関する加速度値が第1閾値よりも大きい加速度データがステップS2で取得される。このとき、ステップS3の判定結果が否定となるとともにステップS4の判定結果が肯定となる。これによって、ゲーム装置3は、振り操作が開始された時点、すなわち、上記移動期間の開始時点を検出したことになる。そして、振り操作が開始された時点から加速度データの保存が開始される(ステップS6)。図15の例では、点p3に対応する加速度ベクトルがメインメモリ13に記憶される。   When the swing operation is not started immediately after the start of the game (including when the controller 7 is not swinging at a sufficient speed), the acceleration value related to the z axis as indicated by the white circle points p1 and p2 is Acceleration data that is less than or equal to the first threshold is acquired in step S2. At this time, since the determination results in steps S3 and S4 are both negative, the acceleration data is not stored. Then, when the controller 7 is shaken at a certain speed after the swing operation is started, acceleration data having an acceleration value related to the z-axis larger than the first threshold value as shown by a black dot p3 is acquired in step S2. . At this time, the determination result of step S3 is negative and the determination result of step S4 is affirmative. As a result, the game apparatus 3 detects the time when the swing operation is started, that is, the start time of the moving period. Then, the storage of the acceleration data is started from the time when the swing operation is started (step S6). In the example of FIG. 15, the acceleration vector corresponding to the point p <b> 3 is stored in the main memory 13.

振り操作が継続する間は、黒丸の点p4〜点p17のように、z軸に関する加速度値が第1閾値よりも大きい加速度データがステップS2で取得される。このとき、ステップS3の判定結果が肯定となるとともにステップS7の判定結果が否定となるので、加速度データの保存(ステップS6)が継続して行われる。したがって、点p3に続き、点p4〜点p17に対応する加速度ベクトルが順次メインメモリ13に記憶される。   While the swinging operation continues, acceleration data whose acceleration value related to the z-axis is larger than the first threshold value is acquired in step S2, as indicated by black circle points p4 to p17. At this time, since the determination result of step S3 is affirmative and the determination result of step S7 is negative, acceleration data storage (step S6) is continuously performed. Therefore, following the point p3, acceleration vectors corresponding to the points p4 to p17 are sequentially stored in the main memory 13.

コントローラ7の速度が落ちてきて振り操作が終了すると、白丸の点p18で示されるような、z軸に関する加速度値が第1閾値以下となる加速度データがステップS2で取得される。このとき、ステップS3の判定結果が肯定となるとともにステップS7の判定結果が肯定となる。これによって、ゲーム装置3は、振り操作が終了された時点、すなわち、上記移動期間の終了時点を検出したことになる。そして、振り操作が終了された時点で加速度データの保存が終了され、ステップS8〜S10の処理が実行される。以上のように、移動期間中に取得された加速度データにより示される加速度ベクトルのデータが選出加速度データ群631としてメインメモリ13に記憶されることとなる。図15の例においては、点p3〜点p17に対応する加速度ベクトルのデータがメインメモリ13に記憶される。   When the speed of the controller 7 decreases and the swing operation is finished, acceleration data in which the acceleration value related to the z-axis is equal to or less than the first threshold value as shown by a white circle point p18 is acquired in step S2. At this time, the determination result of step S3 is affirmative and the determination result of step S7 is affirmative. As a result, the game apparatus 3 detects the time point when the swing operation is ended, that is, the time point when the moving period ends. Then, when the swing operation is finished, the storage of the acceleration data is finished, and the processes of steps S8 to S10 are executed. As described above, the acceleration vector data indicated by the acceleration data acquired during the movement period is stored in the main memory 13 as the selected acceleration data group 631. In the example of FIG. 15, acceleration vector data corresponding to the points p <b> 3 to p <b> 17 is stored in the main memory 13.

ステップS8〜S10の処理は、振り操作が終了した直後に実行される。ステップS8〜S10の処理においては、振り操作によるコントローラ7の振り方向が算出され(ステップS8)、算出された振り方向に基づいたゲーム処理(ステップS9)が実行される。以下、ステップS8〜S10の処理の詳細を説明する。   The processes in steps S8 to S10 are executed immediately after the swing operation is completed. In the processes of steps S8 to S10, the swing direction of the controller 7 by the swing operation is calculated (step S8), and the game process (step S9) based on the calculated swing direction is executed. Hereinafter, details of the processing in steps S8 to S10 will be described.

まず、ステップS8において振り方向算出処理が実行される。振り方向算出処理は、直前に行われた振り操作によるコントローラ7の振り方向を算出するための処理である。以下、図16を参照して振り方向算出処理の詳細について説明する。   First, in step S8, a swing direction calculation process is executed. The swing direction calculation process is a process for calculating the swing direction of the controller 7 by the swing operation performed immediately before. Hereinafter, details of the swing direction calculation processing will be described with reference to FIG.

図16は、図14に示す振り方向算出処理(ステップS8)の詳細を示すフローチャートである。振り方向算出処理においては、まずステップS21において、CPU10は選出加速度データ群631から限界加速度データを選出する。上述したように、限界加速度データとは、加速度ベクトルの各成分のうちのいずれかが、加速度センサ37で検出可能な範囲の限界値をとる加速度データである。図15の例では、点p5、点p6、点p7、点p13、点p14、および点p15が限界加速度データに対応する。なお、図15に示す点線で囲まれる領域Aは、加速度データが検出可能な範囲(−2.2≦x≦2.2,−2.2≦y≦2.2)を示している。   FIG. 16 is a flowchart showing details of the swing direction calculation process (step S8) shown in FIG. In the swing direction calculation process, first, in step S21, the CPU 10 selects limit acceleration data from the selected acceleration data group 631. As described above, the limit acceleration data is acceleration data in which any one of the components of the acceleration vector takes a limit value in a range that can be detected by the acceleration sensor 37. In the example of FIG. 15, point p5, point p6, point p7, point p13, point p14, and point p15 correspond to the limit acceleration data. Note that a region A surrounded by a dotted line shown in FIG. 15 indicates a range in which acceleration data can be detected (−2.2 ≦ x ≦ 2.2, −2.2 ≦ y ≦ 2.2).

なお、上記ステップS21においては、連続して取得された複数の限界加速度データの集合が、1つの限界加速度データ群631’として選出される。したがって、選出加速度データ群631のうちで、連続して取得された限界加速度データの集合が2つである場合には、2つの限界加速度データ群631’が別の集合として取り扱われる。図15の例では、点p5、点p6、および点p7に対応する限界加速度データの集合が1つの限界加速度データ群631’として選出されるとともに、点p13、点p14、および点p15に対応する限界加速度データの集合がもう1つの限界加速度データ群631’として選出される。   In step S21, a set of a plurality of limit acceleration data acquired continuously is selected as one limit acceleration data group 631 '. Therefore, in the selected acceleration data group 631, when there are two sets of continuously acquired limit acceleration data, the two limit acceleration data groups 631 'are handled as different sets. In the example of FIG. 15, a set of limit acceleration data corresponding to the points p5, p6, and p7 is selected as one limit acceleration data group 631 ′, and also corresponds to the points p13, p14, and p15. A set of limit acceleration data is selected as another limit acceleration data group 631 ′.

ステップS22においてデータ補正処理が実行される。データ補正処理は、上記限界加速度データ群631’に含まれる各限界加速度データの値を補正する処理である。以下、図17を参照してデータ補正処理の詳細について説明する。   In step S22, data correction processing is executed. The data correction process is a process for correcting the value of each limit acceleration data included in the limit acceleration data group 631 '. The details of the data correction process will be described below with reference to FIG.

図17は、図16に示すデータ補正処理(ステップS22)の詳細を示すフローチャートである。データ補正処理においては、まずステップS31において、CPU10は、メインメモリ13に記憶されている限界加速度データ群631’のうちの1つを選択する。上述のように、ステップS21において複数の限界加速度データ群631’が選出されることもあり得るからである。以下に示すステップS32〜S40の処理においては、ステップS31で選択された限界加速度データ群631’を対象として補正が行われる。   FIG. 17 is a flowchart showing details of the data correction process (step S22) shown in FIG. In the data correction process, first, in step S31, the CPU 10 selects one of the limit acceleration data groups 631 'stored in the main memory 13. This is because, as described above, a plurality of limit acceleration data groups 631 'may be selected in step S21. In the processing of steps S32 to S40 shown below, correction is performed for the limit acceleration data group 631 'selected in step S31.

続くステップS32において、CPU10は、補助線の制御点を決めるための第3方向ベクトルを算出する。第3方向ベクトルは、例えば図15に示すベクトルV3であり、メインメモリ13に記憶されている選出加速度データ群631に基づいて算出される。具体的には、第3方向ベクトルV3は、次の式(2)に従って算出される。

Figure 0004151983
上式(2)において、ベクトルVAt は、選出加速度データ群に含まれる第t番目の加速度ベクトルを示す。また、変数kは、選出加速度データ群631に含まれる加速度ベクトルの数を示す。上式(2)から明らかなように、第3方向ベクトルV3は、(a)選出加速度データ群631に含まれる各加速度データについて、加速度データに対応する加速度ベクトル(VAt )と当該加速度データの次に取得された加速度データに対応する加速度ベクトル(VAt+1 )との差分ベクトル(VAt+1 −VAt )をそれぞれ算出し、(b)各差分ベクトルに対して差分ベクトルの大きさ(|VAt+1 −VAt |)に応じた重み付けを行って当該各差分ベクトルの総和を算出することによって算出される。 In subsequent step S32, CPU 10 calculates a third direction vector for determining a control point of the auxiliary line. The third direction vector is a vector V3 shown in FIG. 15, for example, and is calculated based on the selected acceleration data group 631 stored in the main memory 13. Specifically, the third direction vector V3 is calculated according to the following equation (2).
Figure 0004151983
In the above equation (2), the vector VA t represents the t-th acceleration vector included in the selected acceleration data group. The variable k indicates the number of acceleration vectors included in the selected acceleration data group 631. As apparent from the above equation (2), the third direction vector V3 is obtained by (a) for each acceleration data included in the selected acceleration data group 631, the acceleration vector (VA t ) corresponding to the acceleration data and the acceleration data Next, a difference vector (VA t + 1 −VA t ) from the acceleration vector (VA t + 1 ) corresponding to the acquired acceleration data is calculated, and (b) the size of the difference vector for each difference vector. It is calculated by performing weighting according to (| VA t + 1 −VA t |) and calculating the sum of the difference vectors.

以上によって算出された第3方向ベクトルV3を示すデータは、第3方向ベクトルデータ639としてメインメモリ13に記憶される。なお、上式(2)においては、選出加速度データ群631に含まれる全ての加速度データを用いて第3方向ベクトルV3を算出したが、他の実施形態においては、選出加速度データ群631のうちの上記非限界加速度データのみを用いて第3方向ベクトルを算出するようにしてもよい。   Data indicating the third direction vector V3 calculated as described above is stored in the main memory 13 as third direction vector data 639. In the above formula (2), the third direction vector V3 is calculated using all the acceleration data included in the selected acceleration data group 631, but in other embodiments, the third direction vector V3 is selected from the selected acceleration data group 631. The third direction vector may be calculated using only the non-limit acceleration data.

続くステップS33において、CPU10は、第3方向ベクトルの向きを補正する必要があるか否かを判定する。ステップS33の判定は、第3方向ベクトルと、直前加速度ベクトルと、直後加速度ベクトルとに基づいて行われる。ここで、直前加速度ベクトルとは、非限界加速度データのうちで限界加速度データ(ステップS21で選出されている限界加速度データ群)の直前に取得された加速度データにより示される加速度ベクトルである。また、直後加速度ベクトルとは、非限界加速度データのうちで限界加速度データ(ステップS21で選出されている限界加速度データ群)の直後に取得された加速度データにより示される加速度ベクトルである。例えば図15の例で言えば、点p5〜点p7により示される限界加速度データ群が選出されている場合、点p5の直前に取得された点p4に対応する加速度データが直前加速度データであり、点p7の直後に取得された点p8に対応する加速度データが直後加速度データである。   In subsequent step S33, CPU 10 determines whether or not it is necessary to correct the direction of the third direction vector. The determination in step S33 is made based on the third direction vector, the immediately preceding acceleration vector, and the immediately following acceleration vector. Here, the immediately preceding acceleration vector is an acceleration vector indicated by acceleration data acquired immediately before limit acceleration data (limit acceleration data group selected in step S21) among non-limit acceleration data. The immediate acceleration vector is an acceleration vector indicated by acceleration data acquired immediately after limit acceleration data (limit acceleration data group selected in step S21) among non-limit acceleration data. For example, in the example of FIG. 15, when the limit acceleration data group indicated by the points p5 to p7 is selected, the acceleration data corresponding to the point p4 acquired immediately before the point p5 is the immediately preceding acceleration data. The acceleration data corresponding to the point p8 acquired immediately after the point p7 is the immediately following acceleration data.

具体的には、上記ステップS33の判定は、上記直前加速度ベクトルと直後加速度ベクトルとを加算したベクトルと、第3方向ベクトルとの内積を計算することによって行われる。すなわち、内積値が負になる場合、第3方向ベクトルの向きを補正する必要があると判断され、内積値が負にならない場合、第3方向ベクトルの向きを補正する必要がないと判断される。ステップS33の判定結果が肯定である場合、ステップS34の処理が実行される。一方、ステップS33の判定結果が否定である場合、ステップS34の処理がスキップされてステップS35の処理が実行される。   Specifically, the determination in step S33 is performed by calculating the inner product of a vector obtained by adding the immediately preceding acceleration vector and the immediately following acceleration vector and the third direction vector. That is, when the inner product value becomes negative, it is determined that the direction of the third direction vector needs to be corrected. When the inner product value does not become negative, it is determined that the direction of the third direction vector does not need to be corrected. . If the determination result of step S33 is affirmative, the process of step S34 is executed. On the other hand, when the determination result of step S33 is negative, the process of step S34 is skipped and the process of step S35 is executed.

ステップS34においては、ステップS32で算出された第3方向ベクトルが補正される。具体的には、CPU10は、当該第3方向ベクトルの向きが逆向きになるように第3方向ベクトルを補正する。このとき、メインメモリ13に記憶されている第3方向ベクトルデータ639の内容は、補正後の内容を示すデータに書き換えられる。ステップS34の後、ステップS35の処理が実行される。   In step S34, the third direction vector calculated in step S32 is corrected. Specifically, the CPU 10 corrects the third direction vector so that the direction of the third direction vector is reversed. At this time, the content of the third direction vector data 639 stored in the main memory 13 is rewritten to data indicating the content after correction. After step S34, the process of step S35 is executed.

ステップS35において、CPU10は、補助線の制御点を決めるための第1方向ベクトルV1を算出する。本実施形態では、第1方向ベクトルは、上記直前加速度データと、当該直前加速度データより1つ前に取得された非限界加速度データとに基づいて算出される。なお、これらの加速度データは、メインメモリ13に記憶されている選出加速度データ群631に含まれている。具体的には、第1方向ベクトルV1は、次の式(3)に従って算出される。
V1=VAN −VAN-1 …(3)
上式(3)において、ベクトルVAN は直前加速度データにより示される加速度ベクトルであり、ベクトルVAN-1 は直前加速度データの1つ前に取得された非限界加速度データにより示される加速度ベクトルである。上式(3)のように、第1方向ベクトルは、直前加速度データにより示される加速度ベクトルから、当該直前加速度データの1つ前に取得された非限界加速度データにより示される加速度ベクトルを減算したベクトルとして算出される。したがって、図15の例においては、第1方向ベクトルV1は、点p3を始点とし、点p4を終点とするベクトルとなる。以上のように算出された第1方向ベクトルを示すデータは、第1方向ベクトルデータ637としてメインメモリ13に記憶される。
In step S35, the CPU 10 calculates a first direction vector V1 for determining the control point of the auxiliary line. In the present embodiment, the first direction vector is calculated based on the immediately preceding acceleration data and the non-limit acceleration data acquired immediately before the immediately preceding acceleration data. These acceleration data are included in the selected acceleration data group 631 stored in the main memory 13. Specifically, the first direction vector V1 is calculated according to the following equation (3).
V1 = VA N −VA N−1 (3)
In the above equation (3), the vector VA N is an acceleration vector indicated by the immediately preceding acceleration data, and the vector VA N-1 is an acceleration vector indicated by the non-limit acceleration data acquired immediately before the immediately preceding acceleration data. . As in the above equation (3), the first direction vector is a vector obtained by subtracting the acceleration vector indicated by the non-limit acceleration data acquired immediately before the previous acceleration data from the acceleration vector indicated by the immediately preceding acceleration data. Is calculated as Accordingly, in the example of FIG. 15, the first direction vector V1 is a vector having the point p3 as a start point and the point p4 as an end point. Data indicating the first direction vector calculated as described above is stored in the main memory 13 as first direction vector data 637.

なお、他の実施形態においては、第1方向ベクトルV1は、直前加速度データと、当該直前加速度データより前に取得された1以上の加速度データとに基づいて算出されてもよい。例えば、第1方向ベクトルV1は、直前加速度データと、当該直前加速度データより1つ前および2つ前に取得された加速度データとに基づいて算出されてもよい。このとき、CPU10は、これら3つの加速度データに対応する3つの加速度ベクトルの終点に関する近似直線を算出し、当該近似直線の傾きを示すベクトルを第1方向ベクトルとする。   In other embodiments, the first direction vector V1 may be calculated based on the immediately preceding acceleration data and one or more acceleration data acquired before the immediately preceding acceleration data. For example, the first direction vector V1 may be calculated based on the immediately preceding acceleration data and acceleration data acquired one and two times before the immediately preceding acceleration data. At this time, the CPU 10 calculates an approximate line regarding the end points of the three acceleration vectors corresponding to the three acceleration data, and sets a vector indicating the inclination of the approximate line as the first direction vector.

ステップS36において、CPU10は、補助線の制御点を決めるための第2方向ベクトルV2を算出する。本実施形態では、第2方向ベクトルは、上記直後加速度データと、当該直後加速度データより1つ後に取得された非限界加速度データとに基づいて算出される。なお、これらの加速度データは、メインメモリ13に記憶されている選出加速度データ群631に含まれている。具体的には、第2方向ベクトルV2は、次の式(4)に従って算出される。
V2=VAQ −VAQ+1 …(4)
上式(4)において、ベクトルVAQ は直後加速度データにより示される加速度ベクトルであり、ベクトルVAQ+1 は直後加速度データの1つ後に取得された非限界加速度データにより示される加速度ベクトルである。上式(4)のように、第2方向ベクトルは、直後加速度データにより示される加速度ベクトルから、当該直後加速度データの1つ後に取得された非限界加速度データにより示される加速度ベクトルを減算したベクトルとして算出される。したがって、図15の例においては、第2方向ベクトルV2は、点p9を始点とし、点p8を終点とするベクトルとなる。以上のように算出された第2方向ベクトルを示すデータは、第2方向ベクトルデータ638としてメインメモリ13に記憶される。なお、他の実施形態においては、第2方向ベクトルV2は、第1方向ベクトルと同様、直後加速度データと、当該直後加速度データより後に取得された1以上の加速度データとに基づいて算出されてもよい。
In step S36, the CPU 10 calculates a second direction vector V2 for determining the control point of the auxiliary line. In the present embodiment, the second direction vector is calculated based on the immediately-right acceleration data and the non-limit acceleration data acquired immediately after the immediately-right acceleration data. These acceleration data are included in the selected acceleration data group 631 stored in the main memory 13. Specifically, the second direction vector V2 is calculated according to the following equation (4).
V2 = VA Q −VA Q + 1 (4)
In the above equation (4), the vector VA Q is an acceleration vector indicated by the immediate acceleration data, and the vector VA Q + 1 is an acceleration vector indicated by non-limit acceleration data acquired immediately after the immediately following acceleration data. As in the above equation (4), the second direction vector is a vector obtained by subtracting the acceleration vector indicated by the non-limit acceleration data acquired immediately after the immediate acceleration data from the acceleration vector indicated by the immediate acceleration data. Calculated. Therefore, in the example of FIG. 15, the second direction vector V2 is a vector having the point p9 as the start point and the point p8 as the end point. Data indicating the second direction vector calculated as described above is stored in the main memory 13 as second direction vector data 638. In other embodiments, the second direction vector V2 may be calculated based on the immediate acceleration data and one or more acceleration data acquired after the immediate acceleration data, like the first direction vector. Good.

ステップS37において、CPU10は、補助線の制御点を決めるための突出量nを算出する。突出量nは、メインメモリ13に記憶されている選出加速度データ群631に含まれる限界加速度データ群631’に基づいて算出される。具体的には、突出量nは、ステップS31で選出された限界加速度データ群631’に含まれる限界加速度データの数に設定される。なお、詳細は後述するが、突出量nは、補助線の形状に影響を与える。具体的には、突出量nの値が大きくなるほど、補助線が突出する度合いが大きくなる。   In step S <b> 37, the CPU 10 calculates the protrusion amount n for determining the control point of the auxiliary line. The protrusion amount n is calculated based on the limit acceleration data group 631 ′ included in the selected acceleration data group 631 stored in the main memory 13. Specifically, the protrusion amount n is set to the number of limit acceleration data included in the limit acceleration data group 631 'selected in step S31. Although the details will be described later, the protruding amount n affects the shape of the auxiliary line. Specifically, the greater the value of the protrusion amount n, the greater the degree that the auxiliary line protrudes.

続くステップS38において、CPU10は、補助線の各制御点P0〜P3を決定する。図18は、決定される各制御点および補助線の一例を示す図である。図18においては、xy座標系の領域のうち、図15に示す点p3〜点p9が含まれる領域を特に示している。図18に示すように、ベジェ曲線の4つの制御点のうち、一方の端点である第1制御点P0は、上記直前加速度データにより示される加速度ベクトルを表す点p4の位置に決定される。決定された第1制御点P0を示すデータは、第1制御点データ633としてメインメモリ13に記憶される。また、他方の端点である第4制御点P3は、上記直後加速度により示される加速度ベクトルを表す点p8の位置に決定される。決定された第4制御点P3を示すデータは、第4制御点データ636としてメインメモリ13に記憶される。   In subsequent step S38, the CPU 10 determines each control point P0 to P3 of the auxiliary line. FIG. 18 is a diagram illustrating an example of each control point and auxiliary line to be determined. In FIG. 18, the area | region where the point p3-point p9 shown in FIG. 15 is contained among the area | regions of xy coordinate system is shown in particular. As shown in FIG. 18, the first control point P0, which is one of the four control points of the Bezier curve, is determined at the position of the point p4 representing the acceleration vector indicated by the immediately preceding acceleration data. Data indicating the determined first control point P 0 is stored in the main memory 13 as first control point data 633. The fourth control point P3, which is the other end point, is determined at the position of the point p8 representing the acceleration vector indicated by the immediately following acceleration. Data indicating the determined fourth control point P3 is stored in the main memory 13 as fourth control point data 636.

また、ベジェ曲線の4つの制御点のうち、一方の方向点である第2制御点P1は、第1方向ベクトルV1、第3方向ベクトルV3、突出量n、および第1制御点P0に基づいて決定される。具体的には、CPU10は、次の式(5)に従って第2制御点P1の位置を算出する。
P1=P0+(V1+V3×K0)×n×K1 …(5)
上式(5)において、定数K0および定数K1は、適宜の値に予め定められるスカラー値である。算出された第2制御点P1を示すデータは、第2制御点データ634としてメインメモリ13に記憶される。図18に示すように、第2制御点P1は、図18のベクトルV4の方向に、ベクトルV4の長さだけ第1制御点P0の位置を移動させた位置となる。なお、ベクトルV4は、第1方向ベクトルV1および第3方向ベクトルV3を成分とし、突出量nに応じた長さとなるベクトルである。
The second control point P1, which is one of the four control points of the Bezier curve, is based on the first direction vector V1, the third direction vector V3, the protrusion amount n, and the first control point P0. It is determined. Specifically, the CPU 10 calculates the position of the second control point P1 according to the following equation (5).
P1 = P0 + (V1 + V3 × K0) × n × K1 (5)
In the above equation (5), the constant K0 and the constant K1 are scalar values that are predetermined as appropriate values. Data indicating the calculated second control point P 1 is stored in the main memory 13 as second control point data 634. As shown in FIG. 18, the second control point P1 is a position obtained by moving the position of the first control point P0 by the length of the vector V4 in the direction of the vector V4 in FIG. The vector V4 is a vector having the first direction vector V1 and the third direction vector V3 as components and having a length corresponding to the protrusion amount n.

また、ベジェ曲線の4つの制御点のうち、他方の方向点である第3制御点P2は、第2方向ベクトルV2、第3方向ベクトルV3、突出量n、および第4制御点P3に基づいて決定される。具体的には、CPU10は、次の式(6)に従って第3制御点P2の位置を算出する。
P2=P3+(V2+V3×K0)×n×K1 …(6)
上式(6)によって算出された第3制御点P2を示すデータは、第3制御点データ635としてメインメモリ13に記憶される。図18に示すように、第3制御点P2は、図18のベクトルV5の方向に、ベクトルV5の長さだけ第4制御点P3の位置を移動させた位置となる。なお、ベクトルV5は、第2方向ベクトルV2および第3方向ベクトルV3を成分とし、突出量nに応じた長さとなるベクトルである。以上によって、補助線であるベジェ曲線を決定するための各制御点P0〜P3が決定される。
The third control point P2, which is the other direction point among the four control points of the Bezier curve, is based on the second direction vector V2, the third direction vector V3, the protrusion amount n, and the fourth control point P3. It is determined. Specifically, the CPU 10 calculates the position of the third control point P2 according to the following equation (6).
P2 = P3 + (V2 + V3 × K0) × n × K1 (6)
Data indicating the third control point P2 calculated by the above equation (6) is stored in the main memory 13 as third control point data 635. As shown in FIG. 18, the third control point P2 is a position obtained by moving the position of the fourth control point P3 by the length of the vector V5 in the direction of the vector V5 in FIG. The vector V5 is a vector having the second direction vector V2 and the third direction vector V3 as components and having a length corresponding to the protrusion amount n. As described above, the control points P0 to P3 for determining the Bezier curve as the auxiliary line are determined.

なお、他の実施形態においては、図18に示すベクトルV4は、第1方向ベクトルV1および第3方向ベクトルV3のいずれか一方のみに基づいて算出されてもよい。また、図18に示すベクトルV5は、第2方向ベクトルV2および第3方向ベクトルV3のいずれか一方のみに基づいて算出されてもよい。   In other embodiments, the vector V4 shown in FIG. 18 may be calculated based on only one of the first direction vector V1 and the third direction vector V3. Further, the vector V5 shown in FIG. 18 may be calculated based on only one of the second direction vector V2 and the third direction vector V3.

続くステップS39において、CPU10は、メインメモリ13に記憶されている各制御点データ633〜636に基づいて補助線を決定する。具体的には、上式(1)に各制御点P0〜P3の値を代入することによって、補助線であるベジェ曲線を表す関数が決定される。決定された関数を示すデータは、補助線データ632としてメインメモリ13に記憶される。   In subsequent step S <b> 39, the CPU 10 determines an auxiliary line based on the control point data 633 to 636 stored in the main memory 13. Specifically, a function representing a Bezier curve as an auxiliary line is determined by substituting the values of the control points P0 to P3 into the above equation (1). Data indicating the determined function is stored in the main memory 13 as auxiliary line data 632.

図18に示す例においては、各制御点P0〜P3によって決定される補助線は曲線Lのようになる。具体的には、制御点P0における補助線Lの傾きは、制御点P0と制御点P1とを結ぶ線分の傾きとなり、制御点P3における補助線Lの傾きは、制御点P3と制御点P2とを結ぶ線分の傾きとなる。また、制御点P0から制御点P1までの距離が長いほど、補助線Lの長さは長くなり、加速度センサ37が検出可能な範囲を示す領域Aから最も離れた補助線L上の点Bから当該領域Aまでの距離が大きくなる。同様に、制御点P3から制御点P2までの距離が長いほど、補助線Lの長さは長くなり、上記点Bから領域Aまでの距離が大きくなる。   In the example shown in FIG. 18, the auxiliary line determined by the control points P0 to P3 is a curve L. Specifically, the inclination of the auxiliary line L at the control point P0 is the inclination of the line segment connecting the control point P0 and the control point P1, and the inclination of the auxiliary line L at the control point P3 is the control point P3 and the control point P2. The slope of the line segment connecting Further, the longer the distance from the control point P0 to the control point P1, the longer the length of the auxiliary line L. From the point B on the auxiliary line L farthest from the region A indicating the range that the acceleration sensor 37 can detect. The distance to the area A increases. Similarly, the longer the distance from the control point P3 to the control point P2, the longer the length of the auxiliary line L and the greater the distance from the point B to the region A.

続くステップS40において、CPU10は、メインメモリ13に記憶されている補助線データ632に基づいて、限界加速度データ群631’の値を補正する。限界加速度データの値は、補助線上の値となるように補正される。すなわち、CPU10は、限界加速度データにより示される加速度ベクトルのxy座標値を、補助線上の座標値となるように補正する。本実施形態では、各限界加速度データの補正後の座標値は、各限界加速度データに対応する各座標位置によって補助線が等分されるように決定される。図18を例にとって説明すると、限界加速度データに対応する点p5〜p7の補正後の点p5’〜p7’は、各点によって補助線Lを4等分する位置に決定される。具体的には、上式(1)において、変数u=0.25としたときの変数pにより示される位置を点p5’の位置とし、変数u=0.5としたときの変数pにより示される位置を点p6’の位置とし、上式(1)において変数u=0.75としたときの変数pにより示される位置を点p7’の位置とする。なお、補正後の座標は補助線L上に設定されればよく、補助線Lは、領域A内の制御点P0から領域A外を通って領域A内の制御点P3までを結ぶ曲線であるので、補正後の点p5’〜p7’は領域A内の位置となり得る。ステップS40において、メインメモリ13に記憶されている限界加速度データ群631’の内容は、補正後の内容に書き換えられる。   In subsequent step S <b> 40, the CPU 10 corrects the value of the limit acceleration data group 631 ′ based on the auxiliary line data 632 stored in the main memory 13. The value of the limit acceleration data is corrected so as to be a value on the auxiliary line. That is, the CPU 10 corrects the xy coordinate value of the acceleration vector indicated by the limit acceleration data so as to be the coordinate value on the auxiliary line. In the present embodiment, the corrected coordinate value of each limit acceleration data is determined so that the auxiliary line is equally divided by each coordinate position corresponding to each limit acceleration data. Referring to FIG. 18 as an example, corrected points p5 'to p7' of points p5 to p7 corresponding to the limit acceleration data are determined to be positions at which the auxiliary line L is equally divided by each point. Specifically, in the above equation (1), the position indicated by the variable p when the variable u = 0.25 is set as the position of the point p5 ′, and is indicated by the variable p when the variable u = 0.5. The position indicated by the variable p when the variable u = 0.75 in the above equation (1) is the position of the point p7 ′. The corrected coordinates only need to be set on the auxiliary line L, and the auxiliary line L is a curve that connects the control point P0 in the area A to the control point P3 in the area A through the outside of the area A. Therefore, the corrected points p5 ′ to p7 ′ can be positions in the region A. In step S40, the contents of the limit acceleration data group 631 'stored in the main memory 13 are rewritten with the corrected contents.

なお、図18に示した補正方法によれば、各限界加速度データの補正後の各座標値を補助線上にバランス良く配置することができる。加速度データが限界値をとっている間における実際の加速度の間隔がほぼ一定であると想定できる場合には、図18に示す補正方法が有効である。なお、補助線に従って行われる限界加速度データの補正方法は、上記補正方法に限らず、限界加速度データのxy座標値を、補助線上の座標値となるように補正するものであればどのようなものであってもよい。図19は、限界加速度データの補正方法の他の一例を示す図である。図19に示す方法では、限界加速度データのx座標値のみが補正され、y座標値については補正が行われない。このように、他の実施形態においては、限界加速度データの各成分のうちで限界値をとっている成分(図19では、x成分)についてのみ加速度値を補正するようにしてもよい。限界値をとっている成分以外の他の成分の加速度値が信頼できるものであると想定できる場合には、図19に示す方法が有効である。   In addition, according to the correction method shown in FIG. 18, each coordinate value after correction | amendment of each limit acceleration data can be arrange | positioned with sufficient balance on an auxiliary line. The correction method shown in FIG. 18 is effective when it can be assumed that the actual acceleration interval while the acceleration data takes the limit value is almost constant. The method for correcting the limit acceleration data performed according to the auxiliary line is not limited to the above correction method, and any method can be used as long as the xy coordinate value of the limit acceleration data is corrected to the coordinate value on the auxiliary line. It may be. FIG. 19 is a diagram illustrating another example of the method of correcting the limit acceleration data. In the method shown in FIG. 19, only the x coordinate value of the limit acceleration data is corrected, and the y coordinate value is not corrected. As described above, in other embodiments, the acceleration value may be corrected only for the component (the x component in FIG. 19) that takes the limit value among the components of the limit acceleration data. The method shown in FIG. 19 is effective when it can be assumed that acceleration values of components other than the component taking the limit value are reliable.

ステップS41において、CPU10は、全ての限界加速度データを補正したか否かを判定する。ステップS31で選出されていない限界加速度データが残っている場合、補正していない限界加速度データがあると判断され、補正していない限界加速度データに関して、ステップS31の処理が再度実行される。一方、ステップS31で全ての限界加速度データが選出されている場合、全ての限界加速度データを補正したと判断され、CPU10は、図17に示すデータ補正処理を終了する。   In step S41, the CPU 10 determines whether or not all the limit acceleration data have been corrected. If the limit acceleration data not selected in step S31 remains, it is determined that there is limit acceleration data that has not been corrected, and the process of step S31 is executed again for the limit acceleration data that has not been corrected. On the other hand, when all the limit acceleration data are selected in step S31, it is determined that all the limit acceleration data have been corrected, and the CPU 10 ends the data correction process shown in FIG.

以上に説明したデータ補正処理においては、補助線Lが算出され、加速度データにより示されるxy座標が補助線L上の位置となるように加速度データの値が補正される。つまり、限界値の範囲を超えたために実際の値を検出できなかった期間における加速度の推移は、補助線Lによって推定される。これによって、上記移動期間全体における加速度の推移をより正確に知ることができ、選出加速度データ群631の値をより正確なものに補正することができる。   In the data correction process described above, the auxiliary line L is calculated, and the value of the acceleration data is corrected so that the xy coordinates indicated by the acceleration data are positioned on the auxiliary line L. That is, the transition of acceleration during the period in which the actual value could not be detected because the limit value range was exceeded is estimated by the auxiliary line L. Thereby, it is possible to know the transition of acceleration in the entire movement period more accurately, and to correct the value of the selected acceleration data group 631 to be more accurate.

また、上記実施形態においては、補助線(ベジェ曲線)Lの第1制御点P0における傾き(図18に示すベクトルV4)は、第1方向ベクトルV1および第3方向ベクトルV3に基づいて算出される(上式(5)参照)。補助線(ベジェ曲線)Lの第4制御点P3における傾き(図18に示すベクトルV5)は、第2方向ベクトルV2および第3方向ベクトルV3に基づいて算出される(上式(6)参照)。ここで、上記ステップS35からわかるように、第1方向ベクトルV1は、加速度データが限界値をとる直前における加速度データの値の推移を示している。第2方向ベクトルV2は、加速度データが限界値をとる直後における加速度データの値の推移を示している。したがって、第1および第2方向ベクトルV1およびV2を反映して補助線Lの端点における傾きを決定することによって、限界値をとる前後における加速度データの値の推移を示す曲線と、補助線Lとをスムーズに(傾きの変化が連続するように)接続することができる。これによって、限界値の範囲を超えたために実際の値を検出できなかった期間における加速度の推移を、より実際の推移に近くなるように正確に推定することができる。   In the above embodiment, the slope (vector V4 shown in FIG. 18) of the auxiliary line (Bézier curve) L at the first control point P0 is calculated based on the first direction vector V1 and the third direction vector V3. (Refer to the above formula (5)). The inclination (vector V5 shown in FIG. 18) of the auxiliary line (Bézier curve) L at the fourth control point P3 is calculated based on the second direction vector V2 and the third direction vector V3 (see the above equation (6)). . Here, as can be seen from step S35, the first direction vector V1 indicates the transition of the value of the acceleration data immediately before the acceleration data takes the limit value. The second direction vector V2 indicates the transition of the acceleration data value immediately after the acceleration data takes the limit value. Therefore, by determining the inclination at the end point of the auxiliary line L reflecting the first and second direction vectors V1 and V2, a curve indicating the transition of the acceleration data value before and after taking the limit value, the auxiliary line L, Can be connected smoothly (so that the change in inclination is continuous). As a result, it is possible to accurately estimate the transition of the acceleration during the period in which the actual value could not be detected because the limit value range was exceeded so as to be closer to the actual transition.

また、図15に示すように、第3方向ベクトルV3は、移動期間全体における加速度の推移を示している。したがって、第3方向ベクトルV3を反映して補助線Lの端点における傾きを決定することによって、移動期間中における加速度の全体的な推移傾向を反映するように当該傾きを決定することができる。これによって、限界値の範囲を超えたために実際の値を検出できなかった期間における加速度の推移を、より実際に近くなるように正確に推定することができる。例えば、第1および第2方向ベクトルV1およびV2のみに基づいて補助線Lの傾きを決定する方法においては、上記直前加速度データまたは直後加速度データの値が何らかの理由で不正確な値や不規則な値の場合、補助線Lを正確に推定することができなくなるおそれがある。これに対して、さらに第3方向ベクトルV3に基づいて補助線Lの傾きを決定することによって、加速度データのうちのいくつかが不正確な値や不規則な値を示す場合でも補助線Lを正確に推定することができる。   Further, as shown in FIG. 15, the third direction vector V3 indicates the transition of acceleration over the entire movement period. Therefore, by determining the inclination at the end point of the auxiliary line L reflecting the third direction vector V3, the inclination can be determined so as to reflect the overall trend of acceleration during the movement period. As a result, it is possible to accurately estimate the transition of the acceleration during a period in which the actual value could not be detected because the limit value range was exceeded so as to be closer to the actual value. For example, in the method of determining the inclination of the auxiliary line L based only on the first and second direction vectors V1 and V2, the value of the immediately preceding acceleration data or the immediately following acceleration data is incorrect or irregular for some reason. In the case of the value, there is a possibility that the auxiliary line L cannot be accurately estimated. On the other hand, by determining the inclination of the auxiliary line L based on the third direction vector V3, the auxiliary line L is changed even if some of the acceleration data shows an inaccurate value or an irregular value. It can be estimated accurately.

さらに、上記実施形態においては、限界加速度データの数に応じて突出量nを算出し(ステップS37)、第2および第3制御点を突出量nに基づいて決定する(上式(5)および上式(6))。上式(5)および上式(6)より、第2および第3制御点の位置は、突出量nの値が大きいほど、限界値の範囲を示す領域Aから遠ざかる。つまり、領域Aから最も離れた補助線L上の点Bから当該領域Aまでの距離は、突出量nの値が大きいほど大きくなる。ここで、突出量nの値が大きいことは、限界加速度データの数が多いことを意味し、限界値の範囲を超えたために実際の値を検出できなかった期間が長いことを意味する。当該期間中における実際の加速度の値は、当該期間の長さに応じて大きくなると考えられる。したがって、補助線Lの点Bから領域Aまでの距離を突出量nに応じて長くすることによって、加速度の実際の推移により近い補助線を算出することができる。   Further, in the above embodiment, the protrusion amount n is calculated according to the number of limit acceleration data (step S37), and the second and third control points are determined based on the protrusion amount n (the above equation (5) and (6)). From the above equations (5) and (6), the positions of the second and third control points are further away from the region A indicating the range of the limit value as the protrusion amount n is larger. That is, the distance from the point B on the auxiliary line L farthest from the region A to the region A increases as the value of the protrusion amount n increases. Here, a large value of the protrusion amount n means that the number of limit acceleration data is large, and means that a period during which an actual value cannot be detected because the limit value range is exceeded is long. It is considered that the actual acceleration value during the period increases with the length of the period. Therefore, by increasing the distance from the point B of the auxiliary line L to the region A according to the protrusion amount n, an auxiliary line closer to the actual transition of acceleration can be calculated.

図16の説明に戻り、ステップS22の次に、ステップS23およびS24において、補正後の選出加速度データ群631から移動方向ベクトルVmが算出される。移動方向ベクトルVmを算出する処理は、上記ステップS32の処理と同様の演算である。つまり、CPU10は、上式(2)に基づいてxy座標系における2次元ベクトルを算出する。ステップS22が上記ステップS32と異なる点は、それに含まれる限界加速度データ群631’が補正された選出加速度データ群631を用いて上式(2)の計算が行われる点である。補正後の選出加速度データ群631を用いることによって、移動方向ベクトルVmを正確に算出することができる。   Returning to FIG. 16, in step S23 and step S24 after step S22, the moving direction vector Vm is calculated from the corrected selected acceleration data group 631. The process for calculating the movement direction vector Vm is the same operation as the process in step S32. That is, the CPU 10 calculates a two-dimensional vector in the xy coordinate system based on the above equation (2). Step S22 differs from step S32 in that the calculation of the above equation (2) is performed using the selected acceleration data group 631 in which the limit acceleration data group 631 'included therein is corrected. By using the corrected selected acceleration data group 631, the moving direction vector Vm can be accurately calculated.

具体的には、まずステップS23において、補正後の選出加速度データ群631から差分ベクトル群が算出される。CPU10は、選出加速度データ群631に含まれる各加速度データについて、加速度データにより示される加速度ベクトルと、その次に取得された加速度データにより示される加速度ベクトルとの差分(差分ベクトル)を加速度データ毎に算出する。なお、上式(2)の“(VAt+1 −VAt )”がこの差分ベクトルに相当する。ステップS23で算出された各差分ベクトルを示すデータは、差分ベクトルデータ群640としてメインメモリ13に記憶される。次に、ステップS24において、CPU10は、メインメモリ13に記憶されている差分ベクトルデータ群640に基づいて、移動方向ベクトルを算出する。すなわち、各差分ベクトルに対して差分ベクトルの大きさに応じた重み付けを行って当該各差分ベクトルの総和が算出される。なお、上式(2)の“|VAt+1 −VAt |”が各差分ベクトルに付される重みに相当する。また、上式(2)で算出された移動方向ベクトルVmは正規化される。すなわち、長さが“1”に補正される。以上の処理によって算出された移動方向ベクトルVmを示すデータは、移動方向データ641としてメインメモリ13に記憶される。 Specifically, first, in step S23, a difference vector group is calculated from the corrected selected acceleration data group 631. For each piece of acceleration data included in the selected acceleration data group 631, the CPU 10 calculates, for each acceleration data, the difference (difference vector) between the acceleration vector indicated by the acceleration data and the acceleration vector indicated by the next acquired acceleration data. calculate. Note that “(VA t + 1 −VA t )” in the above equation (2) corresponds to this difference vector. Data indicating each difference vector calculated in step S23 is stored in the main memory 13 as a difference vector data group 640. Next, in step S <b> 24, the CPU 10 calculates a moving direction vector based on the difference vector data group 640 stored in the main memory 13. That is, the sum of each difference vector is calculated by weighting each difference vector according to the magnitude of the difference vector. Note that “| VA t + 1 −VA t |” in the above equation (2) corresponds to the weight assigned to each difference vector. Further, the moving direction vector Vm calculated by the above equation (2) is normalized. That is, the length is corrected to “1”. Data indicating the movement direction vector Vm calculated by the above processing is stored in the main memory 13 as movement direction data 641.

次に、ステップS25において、補正後の選出加速度データ群631に基づいて重力方向ベクトルVgが算出される。具体的には、CPU10は、次の式(7)に従って重力方向ベクトルVgを算出する。

Figure 0004151983
上式(7)に示すように、重力方向ベクトルVgは、選出加速度データ群631に含まれる加速度ベクトルVAの総和として算出される。また、上式(7)で算出された重力方向ベクトルVgは正規化される、すなわち、長さが“1”に補正される。以上の処理によって算出された重力方向ベクトルVgを示すデータは、重力方向データ642としてメインメモリ13に記憶される。以上のように算出された重力方向ベクトルVgは、xy座標系における原点を基準点としたとき、選出加速度データ群631に含まれる各加速度ベクトルの、基準点に対する偏りを示している。本実施形態では、この偏りを算出することによって重力方向を算出している。なお、上記偏りは、加速度ベクトルVAの総和を算出する方法に代えて他の方法によって算出されてもよい。 Next, in step S25, the gravity direction vector Vg is calculated based on the corrected selected acceleration data group 631. Specifically, the CPU 10 calculates the gravity direction vector Vg according to the following equation (7).
Figure 0004151983
As shown in the above equation (7), the gravity direction vector Vg is calculated as the sum of the acceleration vectors VA included in the selected acceleration data group 631. Further, the gravity direction vector Vg calculated by the above equation (7) is normalized, that is, the length is corrected to “1”. Data indicating the gravity direction vector Vg calculated by the above processing is stored in the main memory 13 as gravity direction data 642. The gravity direction vector Vg calculated as described above indicates the deviation of each acceleration vector included in the selected acceleration data group 631 with respect to the reference point when the origin in the xy coordinate system is the reference point. In the present embodiment, the direction of gravity is calculated by calculating this bias. The bias may be calculated by another method instead of the method of calculating the sum of the acceleration vectors VA.

続くステップS26において、CPU10は、メインメモリ13に記憶されている移動方向データ641および重力方向データ642に基づいて、振り方向ベクトルを算出する。上述したように、振り方向ベクトルとは、重力方向に対してコントローラ7が移動する方向を示すベクトルである。具体的には、CPU10は、重力方向ベクトルVgが予め定められた基準方向を向くように、移動方向ベクトルVmおよび重力方向ベクトルVgに対して共に回転処理を行う。そして、回転させた移動方向ベクトルVmを振り方向ベクトルVsとする。なお、振り方向ベクトルVsは、重力方向を基準とした方向を表すためのXY座標系で表現されるのに対して、移動方向ベクトルVmおよび重力方向ベクトルVgは、コントローラ7の向きを基準としたxy座標系で表現される。したがって、上記回転処理はxy座標系からXY座標系への座標変換として行われる。具体的には、CPU10は、次の式(8)に従って振り方向ベクトルVs=(SX,SY)を算出する。
SX=−gy×mx+gx×my
SY=−gx×mx−gy×my …(8)
上式(8)においては、移動方向ベクトルVmを(mx、my)とし、重力方向ベクトルVgを(gx、gy)とする。なお、本実施形態では、XY座標系は、コントローラ7の上面が鉛直上向きとなる時の重力方向をY軸負方向とする直交座標系である。したがって、XY座標系における上記基準方向は、Y軸負方向の向きである。
In subsequent step S <b> 26, the CPU 10 calculates a swing direction vector based on the movement direction data 641 and the gravity direction data 642 stored in the main memory 13. As described above, the swing direction vector is a vector indicating the direction in which the controller 7 moves with respect to the direction of gravity. Specifically, the CPU 10 performs rotation processing on both the movement direction vector Vm and the gravity direction vector Vg so that the gravity direction vector Vg faces a predetermined reference direction. Then, the rotated movement direction vector Vm is set as a swing direction vector Vs. The swing direction vector Vs is expressed in an XY coordinate system for representing a direction with respect to the gravity direction, whereas the movement direction vector Vm and the gravity direction vector Vg are based on the direction of the controller 7. Expressed in the xy coordinate system. Therefore, the rotation process is performed as coordinate conversion from the xy coordinate system to the XY coordinate system. Specifically, the CPU 10 calculates the swing direction vector Vs = (SX, SY) according to the following equation (8).
SX = −gy × mx + gx × my
SY = −gx × mx−gy × my (8)
In the above equation (8), the movement direction vector Vm is (mx, my), and the gravity direction vector Vg is (gx, gy). In the present embodiment, the XY coordinate system is an orthogonal coordinate system in which the gravity direction when the upper surface of the controller 7 is vertically upward is the Y axis negative direction. Therefore, the reference direction in the XY coordinate system is the direction of the negative Y-axis direction.

図20は、xy座標系における移動方向ベクトルVmおよび重力方向ベクトルVgを示す図である。また、図21は、XY座標系における振り方向ベクトルを示す図である。例えば、図20に示す移動方向ベクトルVmおよび重力方向ベクトルVgが算出された場合、CPU10は、重力方向ベクトルVgがY軸負方向の向きとなるように、移動方向ベクトルVmおよび重力方向ベクトルVgを共に回転させる座標変換を行う。図21に示すように、回転させられた後(座標変換後)の移動方向ベクトルVmが振り方向ベクトルVsとなる。   FIG. 20 is a diagram showing the moving direction vector Vm and the gravity direction vector Vg in the xy coordinate system. FIG. 21 is a diagram showing a swing direction vector in the XY coordinate system. For example, when the movement direction vector Vm and the gravity direction vector Vg shown in FIG. 20 are calculated, the CPU 10 sets the movement direction vector Vm and the gravity direction vector Vg so that the gravity direction vector Vg is in the negative Y-axis direction. Coordinate transformation to rotate together. As shown in FIG. 21, the movement direction vector Vm after being rotated (after coordinate conversion) becomes the swing direction vector Vs.

以上のようにして得られた振り方向ベクトルVsを示すデータは、振り方向データ643としてメインメモリ13に記憶される。ステップS26の後、CPU10は振り方向算出処理を終了する。なお、本実施形態では振り方向をベクトルを用いて表現したが、他の実施形態では振り方向を角度で表現してもよい。例えば、振り方向は、移動方向ベクトルVmと重力方向ベクトルVgとのなす角の大きさとして表されてもよい。   Data indicating the swing direction vector Vs obtained as described above is stored in the main memory 13 as swing direction data 643. After step S26, the CPU 10 ends the swing direction calculation process. In this embodiment, the swing direction is expressed by using a vector, but in other embodiments, the swing direction may be expressed by an angle. For example, the swing direction may be represented as a magnitude of an angle formed by the movement direction vector Vm and the gravity direction vector Vg.

図15の説明に戻り、ステップS8の次にステップS9の処理が実行される。すなわち、ステップS9において、CPU10は、ステップS8で算出された振り方向に応じたゲーム処理を実行する。具体的には、振り方向に応じた方向に剣オブジェクト52が移動するアニメーションをモニタ2に表示させる(図11参照)。また、CPU10は、ゲーム空間内において剣オブジェクト52を移動させた結果、剣オブジェクト52が丸太オブジェクト51と接触したか否かを判断する。そして、剣オブジェクト52が丸太オブジェクト51と接触した場合、剣オブジェクト52の軌道に沿って丸太オブジェクト51が切断された様子を表示する(図11参照)。また、図15に示すフローチャートには示していないが、丸太オブジェクト51が切断された場合には、切断された丸太オブジェクト51が所定時間表示された後、新たな丸太オブジェクト51が表示されるようにしてもよい。また、丸太オブジェクト51をゲーム空間内において移動させるようにしてもよい。   Returning to the description of FIG. 15, the process of step S9 is executed after step S8. That is, in step S9, the CPU 10 executes a game process corresponding to the swing direction calculated in step S8. Specifically, an animation in which the sword object 52 moves in a direction corresponding to the swing direction is displayed on the monitor 2 (see FIG. 11). Further, the CPU 10 determines whether or not the sword object 52 has come into contact with the log object 51 as a result of moving the sword object 52 in the game space. When the sword object 52 comes into contact with the log object 51, a state in which the log object 51 is cut along the trajectory of the sword object 52 is displayed (see FIG. 11). Further, although not shown in the flowchart shown in FIG. 15, when the log object 51 is cut, the cut log object 51 is displayed for a predetermined time, and then a new log object 51 is displayed. May be. Further, the log object 51 may be moved in the game space.

続くステップS10において、操作フラグがオフに設定される。すなわち、CPU10は、メインメモリ13に記憶されている操作フラグデータ644の内容をオフを示すデータに書き換える。これによって、ステップS2〜S11のループ処理が次に行われるときにはステップS3の判定結果が否定となる。なお、ステップS9においては、メインメモリ13に記憶されている各データ631〜643の内容がクリアされる。   In subsequent step S10, the operation flag is set to OFF. That is, the CPU 10 rewrites the contents of the operation flag data 644 stored in the main memory 13 to data indicating OFF. Thereby, when the loop process of steps S2 to S11 is performed next, the determination result of step S3 is negative. In step S9, the contents of the data 631 to 643 stored in the main memory 13 are cleared.

続くステップS11において、CPU10はゲームを終了するか否かを判定する。ステップS11の判定は、例えば、プレイヤがゲームを終了する指示を行ったか否かや、プレイヤがゲームをクリアしたか否かや、ゲームに制限時間が設けられている場合には当該制限時間が経過したか否かによって行われる。ステップS11の判定結果が否定である場合、ステップS2の処理が再度実行され、以降、ゲームを終了すると判定されるまでステップS2〜S11の処理ループが実行される。一方、ステップS11の判定結果が肯定である場合、CPU10は図14に示す処理を終了する。以上で、ゲーム装置3における処理の説明を終了する。   In subsequent step S11, the CPU 10 determines whether or not to end the game. The determination in step S11 is, for example, whether or not the player has given an instruction to end the game, whether or not the player has cleared the game, and if the game has a time limit, the time limit has elapsed. It is done depending on whether or not. If the determination result of step S11 is negative, the process of step S2 is executed again, and thereafter, the process loop of steps S2 to S11 is executed until it is determined that the game is to be ended. On the other hand, when the determination result of step S11 is affirmative, the CPU 10 ends the process shown in FIG. Above, description of the process in the game device 3 is complete | finished.

以上のように、本実施形態によれば、コントローラ7から加速度データを取得し(ステップS12)、取得した加速度データから、移動方向ベクトルVmおよび重力方向ベクトルVgという2種類のベクトルが算出される(ステップS23〜S25)。このように、本実施形態では、センサによって検出された1種類の情報から、コントローラ7の状態を示す2種類の情報を得ることができる。そして、ゲーム装置3は、これら2種類の情報をゲーム操作に反映してゲーム処理を行う(ステップS9)。これによって、センサが1つという簡易な構成でありながら、コントローラ7の2種類の状態に基づいた複雑なゲーム操作をプレイヤに行わせることが可能となる。   As described above, according to the present embodiment, acceleration data is acquired from the controller 7 (step S12), and two types of vectors, a moving direction vector Vm and a gravity direction vector Vg, are calculated from the acquired acceleration data ( Steps S23 to S25). Thus, in this embodiment, two types of information indicating the state of the controller 7 can be obtained from one type of information detected by the sensor. Then, the game apparatus 3 performs the game process by reflecting these two types of information on the game operation (step S9). This makes it possible for the player to perform a complicated game operation based on the two types of states of the controller 7 while having a simple configuration with one sensor.

また、本実施形態によれば、加速度データの値が限界値となる場合には、上記補助線を用いて限界加速度データ群の値が補正される(ステップS22)。つまり、ゲーム装置3は、加速度センサ37が実際の加速度値を検出できない場合には、補助線を用いて実際の加速度値を推定する。これによって、実際の加速度値が限界値を超える場合であっても、実際の加速度値を正確に算出することができる。ひいては、算出した加速度値を用いてコントローラ7の状態(例えば、振り方向)を算出する場合に、コントローラ7の状態をより正確に算出することができる。   Further, according to the present embodiment, when the value of the acceleration data becomes the limit value, the value of the limit acceleration data group is corrected using the auxiliary line (step S22). That is, when the acceleration sensor 37 cannot detect the actual acceleration value, the game apparatus 3 estimates the actual acceleration value using the auxiliary line. Thereby, even if the actual acceleration value exceeds the limit value, the actual acceleration value can be accurately calculated. As a result, when calculating the state of the controller 7 (for example, the swing direction) using the calculated acceleration value, the state of the controller 7 can be calculated more accurately.

また、上記実施形態においては、ゲーム装置3は、移動期間中に検出される各加速度ベクトルの総和を算出することによって重力方向を算出する(ステップS25)。ここで、移動期間中に検出される加速度ベクトルには、コントローラ7に加わる重力に起因する成分に加えて、コントローラ7の移動に起因する成分が含まれるので、移動期間中においては、検出される加速度そのものでは重力方向を正確に認識することができない。これに対して、本実施形態では、移動期間中に検出される各加速度ベクトルの総和を算出するので、各加速度ベクトルにおけるコントローラ7の移動に起因する成分を相殺し、常に検出されている、重力に起因する成分のみを抽出することができる。これは、特にゲームの場合にはプレイヤの1つの動作がどの様な動作であるかを認識することが重要であることからその動作の開始と終了があることに着目したものである。したがって、ステップS25の処理によって、コントローラ7の移動を伴うプレイヤの1つの動作における当該コントローラに対する重力方向を認識することができる。   In the above embodiment, the game apparatus 3 calculates the direction of gravity by calculating the sum of the acceleration vectors detected during the movement period (step S25). Here, since the acceleration vector detected during the movement period includes a component due to the movement of the controller 7 in addition to the component due to the gravity applied to the controller 7, it is detected during the movement period. The direction of gravity cannot be accurately recognized by the acceleration itself. On the other hand, in this embodiment, since the sum total of each acceleration vector detected during the movement period is calculated, the component due to the movement of the controller 7 in each acceleration vector is canceled out, and the gravity that is always detected is detected. It is possible to extract only the components resulting from. In particular, in the case of a game, it is important to recognize what kind of action a player performs, so that attention is paid to the start and end of the action. Therefore, the gravity direction with respect to the controller in one operation of the player accompanying the movement of the controller 7 can be recognized by the process of step S25.

また、上記実施形態においては、ゲーム装置3は、選出加速度データ群631の値の推移を示す差分ベクトルに基づいて移動方向ベクトルを算出する。具体的には、ゲーム装置3は、選出加速度データ群631について差分ベクトルを算出し、差分ベクトルに所定の重みを付けて総和を算出することによって、移動方向ベクトルを算出する(ステップS23およびS24)。所定の重みは、差分ベクトルの大きさに応じた値に設定される(上式(2))。差分ベクトルが大きい部分は、素早い振りが行われているということであって、振りの動きの特徴的な部分であるので、選出加速度データ群631から算出される各差分ベクトルのうちで大きさが大きい差分ベクトルを特徴的な部分として高く評価することによって、コントローラ7の移動方向を算出することができる。   In the above embodiment, the game apparatus 3 calculates the movement direction vector based on the difference vector indicating the transition of the value of the selected acceleration data group 631. Specifically, the game device 3 calculates a difference vector for the selected acceleration data group 631, calculates a moving direction vector by calculating a sum by adding a predetermined weight to the difference vector (steps S23 and S24). . The predetermined weight is set to a value corresponding to the magnitude of the difference vector (the above formula (2)). The portion where the difference vector is large means that a quick swing is performed, and is a characteristic portion of the swing motion. Therefore, the size of each difference vector calculated from the selected acceleration data group 631 is small. The movement direction of the controller 7 can be calculated by highly evaluating a large difference vector as a characteristic part.

なお、移動方向を算出する方法としては、(重みを付けずに)単に差分ベクトルの総和を算出する方法も考えられる。この方法では、差分ベクトルの総和は、上記移動期間の開始時点における加速度ベクトルのxy座標値を始点とし、終了時点における加速度ベクトルのxy座標値を終点とするベクトルとなる。図15に示す例で言えば、差分ベクトルの総和は、点p0を始点とし、点p19を終点とするベクトルとなる。上記移動期間の開始時点および終了時点の検出の仕方によっては、上記方法によってもコントローラ7の移動方向を算出することが可能である。   As a method of calculating the moving direction, a method of simply calculating the sum of the difference vectors (without weighting) is also conceivable. In this method, the sum of the difference vectors is a vector whose starting point is the xy coordinate value of the acceleration vector at the start point of the moving period and whose ending point is the xy coordinate value of the acceleration vector at the end point. In the example shown in FIG. 15, the sum of the difference vectors is a vector having the point p0 as the start point and the point p19 as the end point. Depending on how the start time and end time of the moving period are detected, the moving direction of the controller 7 can be calculated also by the above method.

なお、上記方法では、移動方向を正確に認識できないおそれがある点に留意する。例えば、上記移動期間の開始時点における加速度ベクトルと終了時点における加速度ベクトルとがほぼ同じ値となる場合には、移動方向を正確に認識できないおそれがある。開始時点における加速度ベクトルと終了時点における加速度ベクトルとが同じ値になれば、差分ベクトルの総和は「0」になるからである。図15に示した例では、開始時点における加速度ベクトル(点p1)と終了時点における加速度ベクトル(点p19)とが大きく離れている。しかし、第1および第2閾値の設定の仕方によっては、開始時点における加速度ベクトルと終了時点における加速度ベクトルとがほぼ同じ値となることがある。2つの加速度ベクトルがほぼ同じ値になれば、差分ベクトルの総和を示すベクトルの方向は、必ずしも移動方向に応じた方向とはならない。   Note that in the above method, the moving direction may not be accurately recognized. For example, when the acceleration vector at the start time of the movement period and the acceleration vector at the end time have substantially the same value, the movement direction may not be accurately recognized. This is because if the acceleration vector at the start time and the acceleration vector at the end time have the same value, the sum of the difference vectors becomes “0”. In the example shown in FIG. 15, the acceleration vector at the start point (point p1) and the acceleration vector at the end point (point p19) are greatly separated. However, depending on how the first and second threshold values are set, the acceleration vector at the start point and the acceleration vector at the end point may be substantially the same value. If the two acceleration vectors have substantially the same value, the direction of the vector indicating the sum of the difference vectors is not necessarily the direction corresponding to the moving direction.

そこで、上記実施形態では、差分ベクトルに所定の重みを付けて総和を算出している。これによって、仮に上記2つのベクトルが同じ値になっても、総和を示すベクトルは「0」にはならず、各差分ベクトルのうち、特徴的な部分である大きさが大きい差分ベクトルの成分が大きく反映されるように当該総和によって表される。すなわち、当該総和を示すベクトルはコントローラ7の移動方向を表すものとなる。以上より、上記ステップS25においては、重みを付けずに単に差分ベクトルの総和を算出するようにしてもよいが、上記重みを付けて総和を算出することが好ましい。   Therefore, in the above embodiment, the sum is calculated by adding a predetermined weight to the difference vector. As a result, even if the above two vectors have the same value, the vector indicating the sum is not “0”, and among the difference vectors, the component of the difference vector having a large size that is a characteristic part is included. It is represented by the total sum to be largely reflected. That is, the vector indicating the sum represents the moving direction of the controller 7. As described above, in step S25, the sum of the difference vectors may be simply calculated without weighting, but it is preferable to calculate the sum with the weight.

(補助線に関する変形例)
なお、上記実施形態では、加速度データを補正するための補助線として、ベジェ曲線を用いることとした。ここで、他の実施形態においては、補助線はベジェ曲線に限らず、加速度データが限界値をとる間における実際の加速度値を推測するものであればよい。すなわち、補助線は、加速度センサ37の検出範囲外を通る線であればよい。なお、補助線は、その全てが当該検出範囲外を通る必要はなく、その少なくとも一部が当該検出範囲外を通るものであればよい。
(Modifications related to auxiliary lines)
In the above embodiment, a Bezier curve is used as an auxiliary line for correcting acceleration data. Here, in another embodiment, the auxiliary line is not limited to a Bezier curve, and may be any one that estimates an actual acceleration value while acceleration data takes a limit value. That is, the auxiliary line may be a line that passes outside the detection range of the acceleration sensor 37. Note that it is not necessary for all of the auxiliary lines to pass outside the detection range, and it is sufficient that at least a part thereof passes outside the detection range.

例えば、上記補助線として、ベジェ曲線に代えて、カージナルスプライン曲線やBスプライン曲線を用いてもよい。これらの曲線は、1以上の制御点を含む関数によって表される。このような関数によって表される曲線を用いる場合、制御点を決めることによって複雑な曲線の形状を決定することができるので、複雑な曲線によって加速度の推定を詳細に行うことができるとともに、曲線を容易に算出することができる。   For example, a cardinal spline curve or a B-spline curve may be used as the auxiliary line instead of the Bezier curve. These curves are represented by functions that include one or more control points. When a curve represented by such a function is used, the shape of a complicated curve can be determined by determining the control point, so that the acceleration can be estimated in detail by the complex curve, and the curve is It can be easily calculated.

また、上記補助線は、曲線に限らず、複数の線分からなる折れ線によって構成されてもよい。図22は、補助線の他の例を示す図である。図22においては、補助線L’は、線分L1および線分L2によって構成される。線分L1は、上記直前加速度データの点p4と当該直前加速度データの1つ前に取得された加速度データの点p3とを結ぶ線分を点p4の外側へ延ばした線分である。線分L2は、上記直後加速度データの点p8と当該直後加速度データの1つ後に取得された加速度データの点p9とを結ぶ線分を点p8の外側へ延ばした線分である。上記補助線L’を用いる場合には、上記のような制御点によって決められる曲線を用いる場合に比べて、補助線を算出する処理を簡易化することができる。なお、上記線分L1の傾きは、上記第1方向ベクトルV1によって決められても良いし、上記線分L2の傾きは、上記第2方向ベクトルV2によって決められても良い。   Further, the auxiliary line is not limited to a curved line, and may be constituted by a broken line composed of a plurality of line segments. FIG. 22 is a diagram illustrating another example of the auxiliary line. In FIG. 22, the auxiliary line L ′ is composed of a line segment L1 and a line segment L2. The line segment L1 is a line segment that extends a line segment connecting the point p4 of the immediately preceding acceleration data and the point p3 of the acceleration data acquired immediately before the immediately preceding acceleration data to the outside of the point p4. The line segment L2 is a line segment that extends the line segment connecting the point p8 of the immediately following acceleration data and the point p9 of the acceleration data acquired immediately after the immediately following acceleration data to the outside of the point p8. When the auxiliary line L ′ is used, the process of calculating the auxiliary line can be simplified as compared with the case where the curve determined by the control points as described above is used. The inclination of the line segment L1 may be determined by the first direction vector V1, and the inclination of the line segment L2 may be determined by the second direction vector V2.

(加速度データの次数に関する変形例)
上記実施形態においては、2次元の加速度ベクトルを用いる場合を例として詳細な処理を説明したが、他の実施形態においては、加速度データにより示される加速度は3次元の加速度値であってもよいし、1次元の加速度値に対しても適用可能である。3次元の加速度ベクトルを用いる場合には、上記2次元のxy座標系の場合に準じて、3次元のxyz座標系において補助線を算出することができる。
(Modified example of acceleration data order)
In the above embodiment, the detailed processing has been described by using a two-dimensional acceleration vector as an example. However, in another embodiment, the acceleration indicated by the acceleration data may be a three-dimensional acceleration value. The present invention can also be applied to a one-dimensional acceleration value. When a three-dimensional acceleration vector is used, an auxiliary line can be calculated in a three-dimensional xyz coordinate system in accordance with the case of the two-dimensional xy coordinate system.

また、1次元の加速度値を用いる場合には、加速度データにより示される加速度値と時間とを各軸とする2次元座標を用いることにより、上記2次元のxy座標系の場合と同様にして補助線を算出することができる。図23は、1次元の加速度値を用いる場合における座標系を示す図である。図23に示す座標系は、横軸が時間(t)を表し、縦軸が加速度値(s)を表す。点q1〜点q9は、加速度センサによって検出される加速度を示している。図23に示す点線Cは、加速度センサの検出可能な範囲の限界値を示している。   Further, when using a one-dimensional acceleration value, the two-dimensional coordinates having the acceleration value indicated by the acceleration data and time as axes are used to assist in the same manner as in the case of the two-dimensional xy coordinate system. A line can be calculated. FIG. 23 is a diagram illustrating a coordinate system when a one-dimensional acceleration value is used. In the coordinate system shown in FIG. 23, the horizontal axis represents time (t), and the vertical axis represents acceleration value (s). Points q1 to q9 indicate accelerations detected by the acceleration sensor. A dotted line C shown in FIG. 23 indicates a limit value of a range that can be detected by the acceleration sensor.

図23においては、点q3〜点q7が限界値を示している。このとき、ゲーム装置3は、上記実施形態と同様の方法で補助線Lを算出し、補助線L上の値となるように点q3〜点q7の加速度値を補正する。なお、上記実施形態における変数xを変数tに置き換え、変数yを変数sに置き換えれば、上記実施形態と同様の方法で補助線Lを算出することができる。なお、図23に示す点q3’〜点q7’は、補正後の加速度値を示している。以上のように補正した加速度データ群を用いてコントローラ7の状態を算出することによって、補正前の加速度データ群を用いてコントローラ7の状態を算出する場合に比べて、正確に算出を行うことができ、1軸に関する加速度に関しても、加速度の推移をより正確に算出することができる。   In FIG. 23, points q3 to q7 indicate limit values. At this time, the game apparatus 3 calculates the auxiliary line L by the same method as in the above embodiment, and corrects the acceleration values of the points q3 to q7 so as to be the values on the auxiliary line L. If the variable x in the above embodiment is replaced with the variable t and the variable y is replaced with the variable s, the auxiliary line L can be calculated by the same method as in the above embodiment. Note that the points q3 'to q7' shown in FIG. 23 indicate the corrected acceleration values. By calculating the state of the controller 7 using the acceleration data group corrected as described above, the calculation can be performed more accurately than when the state of the controller 7 is calculated using the acceleration data group before correction. Further, the acceleration transition can be calculated more accurately with respect to the acceleration related to one axis.

以上のように、本発明は、入力装置の移動方向を詳細に算出すること等を目的として、例えばゲーム装置またはゲームプログラムとして利用することが可能である。   As described above, the present invention can be used as, for example, a game device or a game program for the purpose of calculating the moving direction of the input device in detail.

本発明の一実施形態に係るゲーム装置を含むゲームシステムの外観図1 is an external view of a game system including a game device according to an embodiment of the present invention. ゲーム装置3の機能ブロック図Functional block diagram of game device 3 コントローラ7の斜視図Perspective view of controller 7 コントローラ7の斜視図Perspective view of controller 7 コントローラ7を前方から見た図The figure which looked at controller 7 from the front コントローラ7の内部構造を示す図Diagram showing the internal structure of the controller 7 コントローラ7の内部構造を示す図Diagram showing the internal structure of the controller 7 コントローラ7の構成を示すブロック図Block diagram showing the configuration of the controller 7 コントローラ7の傾きと加速度センサの出力との関係を示す図The figure which shows the relationship between the inclination of the controller 7, and the output of an acceleration sensor コントローラ7の傾きと加速度センサの出力との関係を示す図The figure which shows the relationship between the inclination of the controller 7, and the output of an acceleration sensor コントローラ7を用いてゲーム操作を行うときの状態を概説する図解図Illustrated diagram outlining the state when performing game operations using the controller 7 本実施形態においてモニタ2に表示されるゲーム画面の一例を示す図The figure which shows an example of the game screen displayed on the monitor 2 in this embodiment 本実施形態においてモニタ2に表示されるゲーム画面の一例を示す図The figure which shows an example of the game screen displayed on the monitor 2 in this embodiment ゲーム装置3のメインメモリ13に記憶される主なデータを示す図The figure which shows the main data memorize | stored in the main memory 13 of the game device 3 選出加速度データ群631の一例を示す図The figure which shows an example of the selection acceleration data group 631 ゲーム装置3において実行される処理の流れを示すメインフローチャートMain flowchart showing a flow of processing executed in the game apparatus 3 ある期間の間にステップS2で取得された加速度データの推移を示す図The figure which shows transition of the acceleration data acquired by step S2 during a certain period 図14に示す振り方向算出処理(ステップS8)の詳細を示すフローチャートThe flowchart which shows the detail of the swing direction calculation process (step S8) shown in FIG. 図16に示すデータ補正処理(ステップS22)の詳細を示すフローチャートThe flowchart which shows the detail of the data correction process (step S22) shown in FIG. 決定される各制御点および補助線の一例を示す図The figure which shows an example of each control point and auxiliary line to be determined 限界加速度データの補正方法の他の一例を示す図The figure which shows another example of the correction method of limit acceleration data xy座標系における移動方向ベクトルVmおよび重力方向ベクトルVgを示す図The figure which shows the moving direction vector Vm and the gravity direction vector Vg in xy coordinate system XY座標系における振り方向ベクトルVsを示す図The figure which shows the swing direction vector Vs in XY coordinate system 補助線の他の例を示す図The figure which shows the other example of an auxiliary line 1次元の加速度値を用いる場合における座標系を示す図The figure which shows a coordinate system in the case of using a one-dimensional acceleration value

符号の説明Explanation of symbols

1 ゲームシステム
2 モニタ
3 ゲーム装置
4 光ディスク
5 外部メモリカード
7 コントローラ
8a,8b マーカ
10 CPU
13 メインメモリ
32 操作部
35 撮像情報演算部
36 通信部
37 加速度センサ
40 撮像素子
51 丸太オブジェクト
52 剣オブジェクト
61 ゲームプログラム

DESCRIPTION OF SYMBOLS 1 Game system 2 Monitor 3 Game apparatus 4 Optical disk 5 External memory card 7 Controller 8a, 8b Marker 10 CPU
13 Main Memory 32 Operation Unit 35 Imaging Information Calculation Unit 36 Communication Unit 37 Acceleration Sensor 40 Image Sensor 51 Log Object 52 Sword Object 61 Game Program

Claims (8)

入力装置の移動方向を算出する移動方向算出装置であって、
前記入力装置に搭載される多軸加速度センサから出力される加速度データを逐次取得する取得手段と、
取得される前記加速度データに基づいて、前記入力装置が動き始めてから動きが終了するまでの期間を移動期間として検出する期間検出手段と、
前記加速度データにより示される各軸に関する加速度値のうちの複数の軸に関する加速度値を各成分とするベクトルを加速度ベクトルとするとき、前記移動期間内に取得される複数の加速度データ毎に、加速度データに対応する加速度ベクトルと当該加速度データの次に取得された加速度データに対応する加速度ベクトルとの差分ベクトルを算出する差分算出手段と、
前記移動期間内に取得される各加速度データについて算出された各差分ベクトルに対して差分ベクトルの大きさに応じた重み付けを行って当該各差分ベクトルの総和を算出し、当該総和が示すベクトルによって決められる方向を前記移動方向とする移動方向算出手段と、を備える、移動方向算出装置。
A moving direction calculating device for calculating a moving direction of an input device,
Acquisition means for sequentially acquiring acceleration data output from a multi-axis acceleration sensor mounted on the input device;
Period detecting means for detecting, as a movement period, a period from the start of movement of the input device to the end of movement based on the acquired acceleration data;
Acceleration data is obtained for each of a plurality of acceleration data acquired during the movement period, when an acceleration vector is a vector whose components are acceleration values related to a plurality of axes among the acceleration values related to each axis indicated by the acceleration data. Difference calculation means for calculating a difference vector between the acceleration vector corresponding to the acceleration vector and the acceleration vector corresponding to the acceleration data acquired next to the acceleration data;
The difference vector calculated for each acceleration data acquired within the movement period is weighted according to the magnitude of the difference vector to calculate the sum of the difference vectors, and is determined by the vector indicated by the sum. A moving direction calculating device comprising: a moving direction calculating unit that sets the moving direction as the moving direction.
前記期間検出手段は、
前記取得される加速度データにより示される各軸に関する加速度値のうちの所定の1軸に関する加速度値が第1閾値を上回った時点を前記移動期間の開始時点に設定する開始設定手段と、
前記取得される加速度データにより示される各軸に関する加速度値のうちの所定の1軸に関する加速度値が第2閾値を下回った時点を前記移動期間の終了時点に設定する終了設定手段とを含む、請求項1に記載の移動方向算出装置。
The period detecting means includes
Start setting means for setting, as a start time of the movement period, a time point at which an acceleration value related to a predetermined one of the acceleration values related to each axis indicated by the acquired acceleration data exceeds a first threshold value;
End setting means for setting, as an end point of the movement period, a point in time at which an acceleration value related to a predetermined one of the acceleration values related to each axis indicated by the acquired acceleration data falls below a second threshold value. Item 2. The moving direction calculation device according to Item 1.
前記多軸加速度センサは3軸加速度センサであって、
前記差分算出手段は、前記加速度データにより示される各軸に関する加速度値のうちの、前記所定の1軸以外の2軸に関する加速度値を各成分とするベクトルを前記加速度ベクトルとして用いる、請求項2に記載の移動方向算出装置。
The multi-axis acceleration sensor is a three-axis acceleration sensor,
The difference calculation means uses, as the acceleration vector, a vector whose components are acceleration values related to two axes other than the predetermined one axis among the acceleration values related to each axis indicated by the acceleration data. The moving direction calculation device described.
前記移動期間内に取得される複数の加速度データに対応する各加速度ベクトルの総和を示すベクトルを、前記入力装置に加わる重力方向として算出する重力方向算出手段と、
前記移動方向と前記重力方向とに基づいて所定のゲーム処理を実行するゲーム処理手段と、をさらに備える請求項1に記載の移動方向算出装置。
A gravity direction calculating means for calculating a vector indicating a sum of acceleration vectors corresponding to a plurality of acceleration data acquired during the movement period as a gravity direction applied to the input device;
The movement direction calculation device according to claim 1, further comprising game processing means for executing a predetermined game process based on the movement direction and the gravity direction.
入力装置の移動方向を算出する移動方向算出装置のコンピュータに実行させる移動方向算出プログラムであって、
前記入力装置に搭載される多軸加速度センサから出力される加速度データを逐次取得する取得ステップと、
取得される前記加速度データに基づいて、前記入力装置が動き始めてから動きが終了するまでの期間を移動期間として検出する期間検出ステップと、
前記加速度データにより示される各軸に関する加速度値のうちの複数の軸に関する加速度値を各成分とするベクトルを加速度ベクトルとするとき、前記移動期間内に取得される複数の加速度データ毎に、加速度データに対応する加速度ベクトルと当該加速度データの次に取得された加速度データに対応する加速度ベクトルとの差分ベクトルを算出する差分算出ステップと、
前記移動期間内に取得される各加速度データについて算出された各差分ベクトルに対して差分ベクトルの大きさに応じた重み付けを行って当該各差分ベクトルの総和を算出し、当該総和が示すベクトルによって決められる方向を前記移動方向とする移動方向算出ステップと、を前記コンピュータに実行させる、移動方向算出プログラム。
A moving direction calculation program to be executed by a computer of a moving direction calculation device that calculates a moving direction of an input device,
An acquisition step of sequentially acquiring acceleration data output from a multi-axis acceleration sensor mounted on the input device;
A period detection step of detecting, as a movement period, a period from the start of movement of the input device to the end of movement based on the acquired acceleration data;
Acceleration data is obtained for each of a plurality of acceleration data acquired during the movement period, when an acceleration vector is a vector having acceleration values related to a plurality of axes among the acceleration values related to each axis indicated by the acceleration data. A difference calculating step of calculating a difference vector between an acceleration vector corresponding to the acceleration vector and an acceleration vector corresponding to the acceleration data acquired next to the acceleration data;
The difference vector calculated for each acceleration data acquired within the movement period is weighted according to the magnitude of the difference vector to calculate the sum of the difference vectors, and is determined by the vector indicated by the sum. A moving direction calculation program for causing the computer to execute a moving direction calculating step in which a moving direction is the moving direction.
前記期間検出ステップは、
前記取得される加速度データにより示される各軸に関する加速度値のうちの所定の1軸に関する加速度値が第1閾値を上回った時点を前記移動期間の開始時点に設定する開始設定ステップと、
前記取得される加速度データにより示される各軸に関する加速度値のうちの所定の1軸に関する加速度値が第2閾値を下回った時点を前記移動期間の終了時点に設定する終了設定ステップとを含む、請求項5に記載の移動方向算出プログラム。
The period detection step includes
A start setting step of setting a time point at which an acceleration value related to a predetermined one of the acceleration values related to each axis indicated by the acquired acceleration data exceeds a first threshold as a start time of the movement period;
An end setting step of setting, as an end point of the movement period, a time point at which an acceleration value related to a predetermined one axis among acceleration values related to each axis indicated by the acquired acceleration data falls below a second threshold value. Item 6. The moving direction calculation program according to Item 5.
前記多軸加速度センサは3軸加速度センサであって、
前記差分算出ステップにおいて、前記コンピュータは、前記加速度データにより示される各軸に関する加速度値のうちの、前記所定の1軸以外の2軸に関する加速度値を各成分とするベクトルを前記加速度ベクトルとして用いる、請求項6に記載の移動方向算出プログラム。
The multi-axis acceleration sensor is a three-axis acceleration sensor,
In the difference calculating step, the computer uses, as the acceleration vector, a vector having acceleration components related to two axes other than the predetermined one axis among the acceleration values related to the axes indicated by the acceleration data. The moving direction calculation program according to claim 6.
前記移動期間内に取得される複数の加速度データに対応する各加速度ベクトルの総和を示すベクトルを、前記入力装置に加わる重力方向として算出する重力方向算出ステップと、
前記移動方向と前記重力方向とに基づいて所定のゲーム処理を実行するゲーム処理ステップと、をさらに備える請求項5に記載の移動方向算出プログラム。

A gravity direction calculating step of calculating a vector indicating a sum of acceleration vectors corresponding to a plurality of acceleration data acquired during the movement period as a gravity direction applied to the input device;
The moving direction calculation program according to claim 5, further comprising a game processing step of executing a predetermined game processing based on the moving direction and the gravity direction.

JP2006124289A 2006-04-27 2006-04-27 Moving direction calculation device and moving direction calculation program Active JP4151983B2 (en)

Priority Applications (5)

Application Number Priority Date Filing Date Title
JP2006124289A JP4151983B2 (en) 2006-04-27 2006-04-27 Moving direction calculation device and moving direction calculation program
US11/520,813 US7988558B2 (en) 2006-04-27 2006-09-14 Game apparatus and storage medium storing game program
US12/957,910 US9002676B2 (en) 2006-04-27 2010-12-01 Game apparatus and storage medium storing game program
US12/958,003 US8287377B2 (en) 2006-04-27 2010-12-01 Movement direction calculator and method for calculating movement direction
US12/969,586 US8672760B2 (en) 2006-04-27 2010-12-16 Game apparatus and storage medium storing game program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2006124289A JP4151983B2 (en) 2006-04-27 2006-04-27 Moving direction calculation device and moving direction calculation program

Publications (2)

Publication Number Publication Date
JP2007295990A JP2007295990A (en) 2007-11-15
JP4151983B2 true JP4151983B2 (en) 2008-09-17

Family

ID=38766026

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2006124289A Active JP4151983B2 (en) 2006-04-27 2006-04-27 Moving direction calculation device and moving direction calculation program

Country Status (1)

Country Link
JP (1) JP4151983B2 (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5131908B2 (en) * 2007-11-30 2013-01-30 任天堂株式会社 Step count calculation program, step count calculation device, step count calculation system, and step count calculation method
JP5358168B2 (en) * 2008-12-08 2013-12-04 任天堂株式会社 GAME DEVICE AND GAME PROGRAM
JP5525177B2 (en) 2009-04-16 2014-06-18 任天堂株式会社 Information processing program and information processing apparatus
JP5430246B2 (en) 2009-06-23 2014-02-26 任天堂株式会社 GAME DEVICE AND GAME PROGRAM

Also Published As

Publication number Publication date
JP2007295990A (en) 2007-11-15

Similar Documents

Publication Publication Date Title
US8672760B2 (en) Game apparatus and storage medium storing game program
US7596466B2 (en) Inclination calculation apparatus and inclination calculation program, and game apparatus and game program
EP2016984B1 (en) Computer-readable storage medium having stored therein information processing program and information processing apparatus
JP4795087B2 (en) GAME DEVICE AND GAME PROGRAM
US8917236B2 (en) Storage medium having information processing program stored therein, information processing apparatus, and information processing system
JP4918376B2 (en) Information processing program and information processing apparatus
US20110025596A1 (en) Storage medium having game program stored therein, game apparatus, and tilt angle correction method
EP2241961B1 (en) Computer-readable storage medium storing an information processing program, information processing apparatus, and method for causing an object displayed in a virtual three-dimensional space to move to a predetermined target, based on motion of an input device
JP4151983B2 (en) Moving direction calculation device and moving direction calculation program
JP4290709B2 (en) GAME DEVICE AND GAME PROGRAM
JP5576721B2 (en) GAME PROGRAM, GAME DEVICE, GAME SYSTEM, AND GAME METHOD
JP4220531B2 (en) Gravity direction calculation device and gravity direction calculation program
JP2007295989A (en) Game device and game program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20080410

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20080627

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20080630

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

Ref document number: 4151983

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110711

Year of fee payment: 3

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110711

Year of fee payment: 3

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110711

Year of fee payment: 3

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110711

Year of fee payment: 3

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120711

Year of fee payment: 4

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120711

Year of fee payment: 4

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120711

Year of fee payment: 4

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20130711

Year of fee payment: 5

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20130711

Year of fee payment: 5

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250