JP5669294B2 - Coordinate calculation apparatus and coordinate calculation program - Google Patents
Coordinate calculation apparatus and coordinate calculation program Download PDFInfo
- Publication number
- JP5669294B2 JP5669294B2 JP2009226048A JP2009226048A JP5669294B2 JP 5669294 B2 JP5669294 B2 JP 5669294B2 JP 2009226048 A JP2009226048 A JP 2009226048A JP 2009226048 A JP2009226048 A JP 2009226048A JP 5669294 B2 JP5669294 B2 JP 5669294B2
- Authority
- JP
- Japan
- Prior art keywords
- input device
- coordinate
- posture
- predetermined
- coordinates
- 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
Links
- 238000004364 calculation method Methods 0.000 title claims description 147
- 238000012937 correction Methods 0.000 claims description 305
- 238000000034 method Methods 0.000 claims description 300
- 230000001133 acceleration Effects 0.000 claims description 237
- 230000008569 process Effects 0.000 claims description 215
- 238000012545 processing Methods 0.000 claims description 76
- 238000003384 imaging method Methods 0.000 claims description 61
- 230000008859 change Effects 0.000 claims description 33
- 230000005484 gravity Effects 0.000 claims description 33
- 238000001514 detection method Methods 0.000 claims description 20
- 230000010365 information processing Effects 0.000 claims description 15
- 230000004044 response Effects 0.000 claims description 4
- 230000036544 posture Effects 0.000 description 361
- 239000003550 marker Substances 0.000 description 119
- 239000011159 matrix material Substances 0.000 description 71
- 238000010586 diagram Methods 0.000 description 22
- 238000004891 communication Methods 0.000 description 18
- 230000003287 optical effect Effects 0.000 description 12
- 230000033001 locomotion Effects 0.000 description 10
- 239000000758 substrate Substances 0.000 description 9
- 230000006870 function Effects 0.000 description 8
- 238000006243 chemical reaction Methods 0.000 description 7
- 238000012986 modification Methods 0.000 description 7
- 230000004048 modification Effects 0.000 description 7
- 238000013459 approach Methods 0.000 description 6
- 230000005540 biological transmission Effects 0.000 description 6
- 238000003825 pressing Methods 0.000 description 6
- CZZAPCPWFCGOCC-GHXNOFRVSA-N (5z)-2-amino-5-[[5-(2-nitrophenyl)furan-2-yl]methylidene]-1,3-thiazol-4-one Chemical compound S1C(N)=NC(=O)\C1=C\C1=CC=C(C=2C(=CC=CC=2)[N+]([O-])=O)O1 CZZAPCPWFCGOCC-GHXNOFRVSA-N 0.000 description 3
- 230000006399 behavior Effects 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 238000003780 insertion Methods 0.000 description 2
- 230000037431 insertion Effects 0.000 description 2
- 238000009434 installation Methods 0.000 description 2
- 206010034719 Personality change Diseases 0.000 description 1
- 230000015572 biosynthetic process Effects 0.000 description 1
- 239000013078 crystal Substances 0.000 description 1
- 230000003247 decreasing effect Effects 0.000 description 1
- 238000006073 displacement reaction Methods 0.000 description 1
- 230000010354 integration Effects 0.000 description 1
- 239000000463 material Substances 0.000 description 1
- 238000004377 microelectronic Methods 0.000 description 1
- 238000010137 moulding (plastic) Methods 0.000 description 1
- 238000010606 normalization Methods 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 230000002265 prevention Effects 0.000 description 1
- 238000005070 sampling Methods 0.000 description 1
- 230000035945 sensitivity Effects 0.000 description 1
- 230000005236 sound signal Effects 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 238000003786 synthesis reaction Methods 0.000 description 1
- 230000002194 synthesizing effect Effects 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
Images
Description
本発明は、座標算出装置または座標算出プログラムに関し、より特定的には、2次元の座標を算出する座標算出装置または座標算出プログラムに関する。 The present invention relates to a coordinate calculation device or a coordinate calculation program, and more specifically to a coordinate calculation device or a coordinate calculation program for calculating two-dimensional coordinates.
従来、入力装置の姿勢を入力として用いるゲーム装置が考えられている。例えば、特許文献1には、加速度センサおよびジャイロセンサを備えた入力装置を使用するゲーム装置が記載されている。このゲーム装置は、ゲームキャラクタが持つ刀を入力装置の動きに応じて制御するものである。具体的には、加速度センサの出力に基づいて刀を振る動作のデータが作成され、ジャイロセンサの出力に基づいて刀の姿勢のデータが作成される。
Conventionally, game devices that use the attitude of an input device as an input have been considered. For example,
入力装置の姿勢を入力として用いる例として、画面上に表示するカーソルの位置を当該姿勢から算出することが考えられる。このように、入力装置の姿勢によって画面上の位置座標を指定することができればユーザにとって便利である。しかし、上記特許文献1では、刀を振るような大まかな操作による入力にしか姿勢のデータが用いられておらず、座標入力のような精度を要する入力を姿勢のデータを用いて行うことができない。
As an example of using the posture of the input device as an input, it is conceivable to calculate the position of the cursor displayed on the screen from the posture. In this way, it is convenient for the user if the position coordinates on the screen can be designated by the attitude of the input device. However, in
ここで、入力装置の姿勢から画面上の位置座標を算出する場合を想定する。この場合、算出すべき位置座標は、入力装置が指し示す(画面上の)位置を示すことが好ましい。しかし、入力装置の姿勢が同じであっても入力装置の位置が異なれば、入力装置が指し示す位置も異なる。したがって、入力装置の姿勢のみから位置座標を算出するとすれば、入力装置が指し示す位置を算出することができず、適切な位置座標を算出することができない。算出される位置座標と、入力装置が指し示す位置との間にずれが生じる場合には、ユーザが操作に違和感を抱き、操作性が悪いと感じるおそれがある。以上のように、入力装置の姿勢を単純に用いて画面上の位置座標を算出する方法では、適切な位置座標を算出することができないおそれがある。 Here, it is assumed that the position coordinates on the screen are calculated from the attitude of the input device. In this case, it is preferable that the position coordinates to be calculated indicate a position (on the screen) indicated by the input device. However, even if the posture of the input device is the same, if the position of the input device is different, the position indicated by the input device is also different. Therefore, if the position coordinates are calculated only from the attitude of the input device, the position indicated by the input device cannot be calculated, and appropriate position coordinates cannot be calculated. If a deviation occurs between the calculated position coordinates and the position indicated by the input device, the user may feel uncomfortable with the operation and may feel that the operability is poor. As described above, there is a possibility that appropriate position coordinates cannot be calculated by a method of calculating position coordinates on the screen by simply using the attitude of the input device.
それ故、本発明の目的は、入力装置の姿勢を用いて画面上の位置を適切に算出することができる座標算出装置または座標算出プログラムを提供することである。 Therefore, an object of the present invention is to provide a coordinate calculation device or a coordinate calculation program that can appropriately calculate the position on the screen using the attitude of the input device.
本発明は、上記の課題を解決するために、以下の(1)〜(20)の構成を採用した。 The present invention employs the following configurations (1) to (20) in order to solve the above problems.
(1)
本発明は、入力装置の姿勢に基づいて表示画面上の位置を表す座標を算出する座標算出装置である。座標算出装置は、方向取得手段と、姿勢算出手段と、第1座標算出手段と、補正手段を備えている。方向取得手段は、所定空間内の所定位置から見たときの入力装置の方向を表す情報を取得する。姿勢算出手段は、所定空間における入力装置の姿勢を算出する。第1座標算出手段は、入力装置の姿勢に基づいて、表示画面上の位置を決定するための第1の座標を算出する。補正手段は、方向取得手段で取得された入力装置の方向が所定の方向となる時点で算出された第1の座標が所定の基準値となるように、第1の座標を補正する。
(1)
The present invention is a coordinate calculation device that calculates coordinates representing a position on a display screen based on an attitude of an input device. The coordinate calculation apparatus includes a direction acquisition unit, a posture calculation unit, a first coordinate calculation unit, and a correction unit. The direction acquisition means acquires information indicating the direction of the input device when viewed from a predetermined position in the predetermined space. The posture calculation means calculates the posture of the input device in the predetermined space. The first coordinate calculation means calculates first coordinates for determining a position on the display screen based on the attitude of the input device. The correcting unit corrects the first coordinate so that the first coordinate calculated when the direction of the input device acquired by the direction acquiring unit becomes a predetermined direction becomes a predetermined reference value.
上記において「入力装置」は、後述する実施形態においては、コントローラ5およびジャイロセンサユニット7からなる入力装置8であるが、ユーザが把持して動かす種類の入力装置であればどのようなものであってもよい。例えば、入力装置はコントローラ5のみであってもよい。
上記「座標算出装置」とは、後述する実施形態においては、ゲーム処理を実行するためのゲーム装置であるが、入力装置の姿勢を入力として表示画面上の位置を算出する任意の情報処理装置を含む概念である。
上記「所定空間内の所定位置から見たときの入力装置の方向を表す情報」とは、後述する実施形態においてはマーカ座標の情報であるが、入力装置が指し示す表示画面上の位置を算出することが可能な情報であればどのような情報であってもよい。また、「方向取得手段」は、座標算出装置の外部(入力装置)から上記情報を受信することによって取得する(後述する実施形態におけるステップS3およびS51)ものであってもよいし、座標算出装置の外部から受信したデータに基づいて上記情報を算出することによって取得するものであってもよい。
上記「姿勢算出手段」は、入力装置の姿勢を算出するものであればよく、姿勢の算出方法は問わない。例えば、後述する実施形態では、ジャイロセンサ、加速度センサ、および撮像手段の各出力を用いて姿勢を算出するが、「姿勢算出手段」は、ジャイロセンサのみを用いて姿勢を算出してもよいし、加速度センサのみを用いて姿勢を算出してもよい。
「第1の座標」は、表示画面上の位置を決定することが可能な座標であればよく、例えば、後述する実施形態のように表示画面とは異なる平面上の位置を表す座標であってもよいし、算出すべき表示画面上の位置自身を表す座標であってもよい。すなわち、上記「第1座標算出手段」は、後述する実施形態においては仮想平面上の座標を算出する処理(ステップS7およびS56)を実行するCPU10であるが、入力装置の姿勢に基づいて表示画面上の座標を直接算出するものであってもよい。
上記「所定の方向」は、後述する実施形態においては、入力装置が画面中心を指し示す方向であるが、これに限らず、例えば入力装置が画面の左下を指し示す方向等であってもよい。また、上記「所定の基準値」とは、入力装置が上記所定の方向となる姿勢において算出されるべき画面上の位置に対応する値であり、具体的な値はいくらであってもよい。例えば、後述する実施形態においては、入力装置が所定の方向(画面中心を指し示す方向)となる姿勢において算出されるべき画面上の位置(画面の中心位置)に対応する値(原点(0,0))である。なお、上記「補正手段」における処理は、後述する実施形態においてはステップS42に相当するが、第1の座標の算出とその補正とを1回の計算で実行する場合(後述する式(16))には、当該計算を実行する処理がこれに相当する。
In the above description, the “input device” is the input device 8 including the
The above-mentioned “coordinate calculation device” is a game device for executing game processing in the embodiments described later. However, an arbitrary information processing device that calculates the position on the display screen by using the attitude of the input device as an input. It is a concept that includes.
The above-mentioned “information indicating the direction of the input device when viewed from a predetermined position in a predetermined space” is marker coordinate information in the embodiment described later, but calculates the position on the display screen pointed to by the input device. Any information can be used as long as it is possible. Further, the “direction acquisition means” may be one that is acquired by receiving the above information from the outside (input device) of the coordinate calculation device (steps S3 and S51 in the embodiments described later), or the coordinate calculation device. It may be obtained by calculating the above information based on data received from outside.
The “attitude calculation means” may be any means for calculating the attitude of the input device, and the attitude calculation method is not limited. For example, in the embodiment described later, the posture is calculated using outputs of the gyro sensor, the acceleration sensor, and the imaging unit, but the “posture calculating unit” may calculate the posture using only the gyro sensor. Alternatively, the posture may be calculated using only the acceleration sensor.
The “first coordinate” may be any coordinate that can determine the position on the display screen. For example, the first coordinate is a coordinate that represents a position on a plane different from the display screen as in an embodiment described later. Alternatively, it may be coordinates representing the position on the display screen to be calculated. That is, the “first coordinate calculation means” is the
In the embodiment described later, the “predetermined direction” is a direction in which the input device points to the center of the screen, but is not limited thereto, and may be a direction in which the input device points to the lower left of the screen, for example. The “predetermined reference value” is a value corresponding to the position on the screen to be calculated in the posture in which the input device is in the predetermined direction, and any specific value may be used. For example, in an embodiment to be described later, a value (origin (0, 0) corresponding to a position on the screen (center position of the screen) to be calculated in a posture in which the input device is in a predetermined direction (direction pointing to the screen center). )). Note that the processing in the “correction unit” corresponds to step S42 in the embodiment described later, but when the calculation of the first coordinate and the correction thereof are executed in one calculation (formula (16) described later). ) Corresponds to the process of executing the calculation.
上記(1)の構成によれば、入力装置の方向が所定の方向となる時点における入力装置の姿勢に対応する第1の座標が上記基準値となり、第1の座標から決められる画面上の位置は当該基準値に対応する位置となる。つまり、上記(1)の構成によれば、基準値を適宜設定することによって、入力装置が指し示す位置が特定のある位置となる場合における画面上の位置を適宜設定することができる。例えば、入力装置が画面の中心を指し示す場合に、入力装置の姿勢から算出される画面上の位置を、画面の中心位置として設定することも可能である。したがって、上記(1)の構成によれば、入力装置が指し示す位置と、姿勢から算出される画面上の位置とのずれを小さくすることができ、入力装置の姿勢を用いて画面上の位置を適切に算出することができる。また、当該ずれによってユーザが操作に違和感を抱くことを防止することができる。 According to the configuration of (1) above, the first coordinates corresponding to the attitude of the input device at the time when the direction of the input device becomes the predetermined direction is the reference value, and the position on the screen determined from the first coordinates Is a position corresponding to the reference value. That is, according to the configuration of (1) above, by appropriately setting the reference value, it is possible to appropriately set the position on the screen when the position pointed to by the input device is a specific position. For example, when the input device points to the center of the screen, the position on the screen calculated from the attitude of the input device can be set as the center position of the screen. Therefore, according to the configuration of (1) above, the deviation between the position pointed to by the input device and the position on the screen calculated from the posture can be reduced, and the position on the screen can be determined using the posture of the input device. It can be calculated appropriately. In addition, the user can be prevented from feeling uncomfortable due to the deviation.
(2)
座標算出装置は、入力装置の方向に基づいて表示画面上における第2の座標を算出する第2座標算出手段をさらに備えていてもよい。このとき、補正手段は、補正後の第1の座標により決められる表示画面上の位置が、入力装置の方向が所定の方向となる時点で算出された第2の座標が表す位置となるように補正を行う。
(2)
The coordinate calculation apparatus may further include second coordinate calculation means for calculating second coordinates on the display screen based on the direction of the input device. At this time, the correcting means causes the position on the display screen determined by the corrected first coordinates to be a position represented by the second coordinates calculated when the direction of the input device becomes a predetermined direction. Make corrections.
上記「第2の座標」は、表示画面上の位置を表し、後述する実施形態においてはマーカ座標に基づいて算出される(ステップS52)が、入力装置の方向に基づいて算出されるものであればよい。 The “second coordinate” represents a position on the display screen, and is calculated based on the marker coordinate in the embodiment described later (step S52), but is calculated based on the direction of the input device. That's fine.
上記(2)の構成によれば、入力装置の方向が所定の方向となる状態において、補正後の第1の座標により決められる表示画面上の位置と、第2の座標が表す位置とを一致させることができる。したがって、上記の状態において、入力装置の姿勢に基づいて算出される画面上の位置は、入力装置の方向に基づいて算出される位置と一致することになる。ここで、入力装置の方向に基づいて算出される位置としては、入力装置が指し示す位置を算出することができる。したがって、かかる位置と一致するように入力装置の姿勢に基づく位置を算出することによって、入力装置の姿勢に基づく位置と、入力装置が指し示す位置とのずれを小さくすることができ、画面上の位置を姿勢に基づいて適切に算出することができる。また、座標算出装置が、入力装置の姿勢に基づいて位置を算出する方法と、入力装置の方向に基づいて位置を算出する方法とを併用する場合も考えられる。このような場合であっても、上記(2)の構成によれば、上記の状態においてはいずれの方法で位置を算出した場合でも同じ位置が算出されるので、2つの方法を切り替える際にユーザが抱く違和感を軽減することができる。 According to the configuration of (2) above, in a state where the direction of the input device is a predetermined direction, the position on the display screen determined by the corrected first coordinate matches the position represented by the second coordinate. Can be made. Therefore, in the above state, the position on the screen calculated based on the attitude of the input device matches the position calculated based on the direction of the input device. Here, as the position calculated based on the direction of the input device, the position indicated by the input device can be calculated. Therefore, by calculating the position based on the attitude of the input device so as to match the position, the deviation between the position based on the attitude of the input device and the position pointed to by the input device can be reduced. Can be appropriately calculated based on the posture. It is also conceivable that the coordinate calculation device uses both a method for calculating the position based on the attitude of the input device and a method for calculating the position based on the direction of the input device. Even in such a case, according to the configuration of (2) above, the same position is calculated regardless of which method is used in the above state, so the user can switch between the two methods. Can reduce the sense of incongruity.
(3)
座標算出装置は、入力装置の方向が所定の方向となる時点で算出された第1の座標によって決められる位置と、当該時点で算出された第2の座標が表す位置との差に応じた補正量を決定する補正量決定手段をさらに備えていてもよい。このとき、補正手段は、補正量の分だけ第1の座標を補正する。
(3)
The coordinate calculation device corrects according to the difference between the position determined by the first coordinate calculated when the direction of the input device becomes a predetermined direction and the position represented by the second coordinate calculated at the time. A correction amount determining means for determining the amount may be further provided. At this time, the correction means corrects the first coordinate by the correction amount.
上記「補正量」とは、上記差に応じた量となるように決定されればよく、当該差自体を用いて算出される必要はない。上記「補正量」は、例えば、後述する実施形態におけるオフセット量のように、入力装置の方向が所定の方向となる時点(入力装置が画面の中心を指し示す時点)で算出された第1の座標と、その時点で算出された第2の座標が表す位置(画面の中心位置)に対応する第1の座標(X’Y’座標の原点)との差に基づいて算出されてもよい。 The “correction amount” only needs to be determined so as to be an amount corresponding to the difference, and need not be calculated using the difference itself. The “correction amount” is, for example, the first coordinates calculated at the time when the direction of the input device becomes a predetermined direction (the time when the input device points to the center of the screen) like an offset amount in an embodiment described later. And the difference between the first coordinate (the origin of the X′Y ′ coordinate) corresponding to the position represented by the second coordinate calculated at that time (the center position of the screen).
上記(3)の構成によれば、上記差に応じた補正量を算出することによって、第1の座標によって決められる位置と、第2の座標が表す位置とを一致させる補正を容易に行うことができる。 According to the configuration of (3) above, by calculating the correction amount according to the difference, it is possible to easily perform correction to match the position determined by the first coordinates with the position represented by the second coordinates. Can do.
(4)
座標算出装置は、表示画面上の位置が入力として用いられる所定の情報処理を実行する処理実行手段をさらに備えていてもよい。このとき、補正量決定手段は、所定の情報処理が実行される前に、入力装置の方向が所定の方向となったことに応じて補正量を決定する。第1座標算出手段は、所定の情報処理が繰り返し実行される間に第1の座標を算出する。補正手段は、第1座標算出手段が第1の座標を算出する度に当該第1の座標を補正量に従って補正する。
(4)
The coordinate calculation apparatus may further include a process execution unit that executes predetermined information processing using a position on the display screen as an input. At this time, the correction amount determining means determines the correction amount in accordance with the direction of the input device becoming the predetermined direction before the predetermined information processing is executed. The first coordinate calculation means calculates the first coordinate while predetermined information processing is repeatedly executed. The correction unit corrects the first coordinate according to the correction amount every time the first coordinate calculation unit calculates the first coordinate.
上記「所定の情報処理」とは、例えば、画面座標の位置にカーソルやゲームのオブジェクトを表示させる処理でもよいし、オブジェクトの位置と画面座標との位置関係に応じてオブジェクトを移動させる処理でもよい。 The “predetermined information processing” may be, for example, a process of displaying a cursor or a game object at the position of the screen coordinate, or a process of moving the object according to the positional relationship between the object position and the screen coordinate. .
上記(4)の構成によれば、座標算出装置は、所定の情報処理が実行される前に補正量を決定しておく。そして、所定の情報処理を実行する際には、予め決定しておいた補正量に従って第1の座標を補正する。これによれば、適切な値に補正された画面上の位置を用いて所定の情報処理が実行されるので、所定の情報処理の実行結果に対してユーザが違和感を抱くことがなく、所定の情報処理における操作性を向上することができる。 According to the configuration of (4) above, the coordinate calculation apparatus determines the correction amount before the predetermined information processing is executed. When executing predetermined information processing, the first coordinates are corrected according to a predetermined correction amount. According to this, since the predetermined information processing is executed using the position on the screen corrected to an appropriate value, the user does not feel uncomfortable with the execution result of the predetermined information processing. Usability in information processing can be improved.
(5)
座標算出装置は、表示画面上において第2の座標によって表される位置に所定の指示画像を表示させる指示画像表示手段をさらに備えていてもよい。このとき、補正量決定手段は、指示画像が画面上の所定範囲内に入った場合、指示画像が当該所定範囲内に入った時点で算出された第1の座標と、当該所定範囲内の所定位置に対応する第2の座標とに基づいて補正量を決定する。
(5)
The coordinate calculation apparatus may further include instruction image display means for displaying a predetermined instruction image at a position represented by the second coordinates on the display screen. At this time, when the instruction image falls within a predetermined range on the screen, the correction amount determination means determines the first coordinates calculated when the instruction image falls within the predetermined range, and a predetermined value within the predetermined range. The correction amount is determined based on the second coordinates corresponding to the position.
上記「指示画像」とは、後述する実施形態におけるカーソルの他、第2の座標の位置に表示される画像であればよく、例えばゲームにおいてユーザが操作するキャラクタの画像であってもよい。 The “instruction image” may be an image displayed at the position of the second coordinate in addition to the cursor in the embodiment described later, and may be an image of a character operated by the user in a game, for example.
上記(5)の構成によれば、指示画像の位置(入力装置が指し示す位置)が所定範囲内となった場合、補正量が決定される。したがって、上記(5)の構成によれば、例えば指示画像を用いてユーザが操作を行っている最中に補正量を決定することができるので、ユーザに特別な操作を行わせることなく、補正量を決定することができる。 According to the configuration of (5) above, when the position of the instruction image (the position indicated by the input device) is within a predetermined range, the correction amount is determined. Therefore, according to the configuration of (5) above, for example, the correction amount can be determined while the user is performing an operation using the instruction image. Therefore, the correction can be performed without causing the user to perform a special operation. The amount can be determined.
(6)
座標算出装置は、ユーザが所定の指示を行うためのボタン画像を所定範囲に表示させるボタン画像表示手段をさらに備えていてもよい。このとき、補正量決定手段は、ボタン画像が表示される場合にのみ、補正量を決定する処理を実行する。
(6)
The coordinate calculation apparatus may further include button image display means for displaying a button image for a user to give a predetermined instruction in a predetermined range. At this time, the correction amount determining means executes processing for determining the correction amount only when the button image is displayed.
上記「所定の指示」は、後述する実施形態においては、カーソルに関する調整の指示であるが、任意の指示でよく、例えば、上記所定の情報処理(例えば、画面上の位置を入力とするゲーム処理)の実行を開始するための指示等であってもよい。 In the embodiment described later, the “predetermined instruction” is an instruction for adjustment relating to the cursor, but may be any instruction, for example, the predetermined information processing (for example, a game process using a position on the screen as an input) ) May be an instruction for starting the execution.
上記(6)の構成によれば、上記指示画像がボタン画像の領域内に入った場合に、補正量を決定する処理が実行される。これによれば、ユーザが上記ボタン画像を用いて指示を行おうとして指示画像をボタン画像の領域内に合わせると、補正量が決定されることになる。したがって、補正量を決定するための操作をユーザに意識させることなく、自然に行わせることができる。 According to the configuration of (6) above, the processing for determining the correction amount is executed when the instruction image enters the button image area. According to this, when the user tries to give an instruction using the button image and the instruction image is matched with the button image area, the correction amount is determined. Therefore, the operation for determining the correction amount can be performed naturally without making the user aware of the operation.
(7)
第1座標算出手段は、所定の姿勢から、姿勢算出手段が算出した姿勢までの変化の向きおよび変化量に応じた座標値を第1の座標として算出してもよい。
(7)
The first coordinate calculating unit may calculate a coordinate value corresponding to the direction and amount of change from a predetermined posture to the posture calculated by the posture calculating unit as the first coordinate.
上記「所定の姿勢」とは、後述する実施形態においては、入力装置(のZ軸)が水平方向を向く姿勢であるが、任意の姿勢でよい。 The “predetermined posture” is a posture in which the input device (the Z axis) faces in the horizontal direction in the embodiment described later, but may be an arbitrary posture.
上記(7)の構成によれば、画面上の位置は、所定の姿勢から入力装置を回転させた方向に応じた方向へ、回転量に応じた距離だけ移動する。したがって、ユーザは、入力装置の姿勢を変化させることで画面上の位置を容易に操作することができる According to the configuration of (7) above, the position on the screen moves from a predetermined posture in a direction corresponding to the direction in which the input device is rotated by a distance corresponding to the rotation amount. Therefore, the user can easily operate the position on the screen by changing the attitude of the input device.
(8)
第1座標算出手段は、所定の基準点から入力装置の姿勢を示すベクトルの方向へ延ばした線分と、所定平面との交点の位置を表す座標を第1の座標として算出してもよい。このとき、補正手段は、入力装置の方向が所定の方向となる時点で算出された第1の座標が所定の基準値となるように第1の座標の座標系を移動することで第1の座標を補正する。また、座標算出装置は、補正手段によって補正された後の第1の座標に基づいて表示画面上の位置を表す座標を算出する位置算出手段をさらに備える。
(8)
The first coordinate calculation means may calculate, as the first coordinate, a coordinate representing a position of an intersection between a line segment extending from a predetermined reference point in a vector direction indicating the attitude of the input device and a predetermined plane. At this time, the correction means moves the coordinate system of the first coordinate so that the first coordinate calculated when the direction of the input device becomes the predetermined direction becomes the predetermined reference value. Correct the coordinates. The coordinate calculation device further includes position calculation means for calculating coordinates representing a position on the display screen based on the first coordinates corrected by the correction means.
上記「所定の基準点」、「入力装置の姿勢を示すベクトル」、および「所定平面」は、第1の座標を算出するための仮想的な空間に設定されるものである(図18)。「所定の基準点」は例えば入力装置の位置を表し、「所定平面」は例えば画面に対応するように設定される。
上記「位置算出手段」が行う処理は、後述する実施形態においては、仮想空間における平面上の位置を表す第1の座標から画面上の位置を算出する処理(ステップS43)に相当する。
The “predetermined reference point”, “vector indicating the attitude of the input device”, and “predetermined plane” are set in a virtual space for calculating the first coordinates (FIG. 18). The “predetermined reference point” represents the position of the input device, for example, and the “predetermined plane” is set to correspond to the screen, for example.
The process performed by the “position calculation unit” corresponds to a process (step S43) of calculating a position on the screen from first coordinates representing a position on a plane in the virtual space in the embodiment described later.
上記(8)の構成によれば、入力装置の姿勢に応じて変化する平面上の座標(第1の座標)を容易に算出することができる。また、座標系の原点を変更(移動)することによって、一定量の補正を容易に行うことができる。 With configuration (8) above, it is possible to easily calculate the coordinates on the plane (first coordinates) that change according to the attitude of the input device. Further, a fixed amount of correction can be easily performed by changing (moving) the origin of the coordinate system.
(9)
補正手段は、所定平面上において第1の座標の座標系を移動することで補正を行ってもよい。
(9)
The correcting means may perform correction by moving the coordinate system of the first coordinates on a predetermined plane.
上記(9)の構成によれば、補正の計算は、第1算出手段が算出した第1の座標に所定値を加算(減算)するのみでよく、補正処理を簡単かつ高速に行うことができる。 According to the configuration of (9) above, the correction calculation only needs to add (subtract) a predetermined value to the first coordinates calculated by the first calculation means, and the correction process can be performed easily and at high speed. .
(10)
補正手段は、所定の基準点を中心に第1の座標の座標系を回転させることで補正を行ってもよい。
(10)
The correcting means may perform the correction by rotating the coordinate system of the first coordinates around a predetermined reference point.
上記(10)の構成によれば、基準点から座標系の平面までの距離を補正量によらず一定にすることができる(図26)。したがって、画面上の位置をより正確に算出することができる。 According to the configuration of (10) above, the distance from the reference point to the plane of the coordinate system can be made constant regardless of the correction amount (FIG. 26). Therefore, the position on the screen can be calculated more accurately.
(11)
第1座標算出手段は、第1の座標として2次元の座標を算出してもよい。このとき、補正手段は、第1の座標の一方の成分についてのみ補正を行う。
(11)
The first coordinate calculation means may calculate a two-dimensional coordinate as the first coordinate. At this time, the correction means corrects only one component of the first coordinate.
「第1の座標の一方の成分」とは、後述する実施形態においては画面の縦方向に対応する成分(Y’成分)であるが、画面の横方向に対応する成分であってもよい。 “One component of the first coordinate” is a component (Y ′ component) corresponding to the vertical direction of the screen in the embodiment described later, but may be a component corresponding to the horizontal direction of the screen.
上記(11)の構成によれば、姿勢に基づく画面上の位置を、一方向についてのみ補正することができる。したがって、例えば後述する実施形態のように、画面の縦方向のみ補正を行う場合にも本発明を適用することができる。 According to the configuration of (11) above, the position on the screen based on the posture can be corrected only in one direction. Therefore, the present invention can also be applied to the case where correction is performed only in the vertical direction of the screen, for example, as in an embodiment described later.
(12)
入力装置は撮像手段を有していてもよい。このとき、方向取得手段は、入力装置の方向を示す情報として、撮像手段が撮像する画像内における所定の撮像対象の位置を示す情報を取得する。
(12)
The input device may have an imaging unit. At this time, the direction acquisition unit acquires information indicating the position of a predetermined imaging target in the image captured by the imaging unit as information indicating the direction of the input device.
上記「所定の撮像対象」とは、後述する実施形態ではマーカ部6であるが、座標算出装置が画像によって認識可能な物であれば何でもよい。また、上記「撮像手段が撮像する画像内における所定の撮像対象の位置」は、後述する実施形態ではマーカ座標によって表される。
The “predetermined imaging target” is the
上記(12)の構成によれば、入力装置が有する撮像手段による画像を用いることによって、上記入力装置の方向を容易に特定することができる。 According to the configuration of (12) above, the direction of the input device can be easily specified by using the image obtained by the imaging means of the input device.
(13)
入力装置は、加速度センサおよび/または角速度センサを備えていてもよい。このとき、姿勢算出手段は、加速度センサおよび/または角速度センサの検出結果に基づいて入力装置の姿勢を算出する。
(13)
The input device may include an acceleration sensor and / or an angular velocity sensor. At this time, the posture calculation means calculates the posture of the input device based on the detection result of the acceleration sensor and / or the angular velocity sensor.
上記(13)の構成によれば、加速度センサおよび/または角速度センサの検出結果を用いることによって、入力装置の姿勢を容易に算出することができる。 With configuration (13) above, the attitude of the input device can be easily calculated by using the detection results of the acceleration sensor and / or angular velocity sensor.
(14)
姿勢算出手段は、角速度センサが検出する角速度に基づいて入力装置の姿勢を算出するとともに、加速度センサが検出する加速度に基づいて当該姿勢を補正してもよい。
(14)
The posture calculation means may calculate the posture of the input device based on the angular velocity detected by the angular velocity sensor and correct the posture based on the acceleration detected by the acceleration sensor.
上記(14)の構成によれば、角速度に基づく入力装置の姿勢を、加速度に基づいて補正することによって、姿勢をより正確に算出することができる。 According to the configuration of (14) above, the posture can be calculated more accurately by correcting the posture of the input device based on the angular velocity based on the acceleration.
(15)
入力装置は撮像手段を有していてもよい。このとき、姿勢算出手段は、角速度センサが検出する角速度に基づいて入力装置の姿勢を算出するとともに、撮像手段が撮像する画像内における所定の撮像対象の位置に基づいて、少なくとも重力方向を軸とした回転に関して当該姿勢を補正する。
(15)
The input device may have an imaging unit. At this time, the attitude calculation means calculates the attitude of the input device based on the angular velocity detected by the angular velocity sensor, and based on the position of a predetermined imaging target in the image captured by the imaging means, with at least the gravity direction as an axis. The posture is corrected with respect to the rotation performed.
上記(15)の構成によれば、角速度に基づく入力装置の姿勢を、撮像手段によって撮像された画像の情報を用いて補正することによって、姿勢をより正確に算出することができる。 According to the configuration of (15) above, the attitude can be calculated more accurately by correcting the attitude of the input device based on the angular velocity using information on the image captured by the imaging means.
(16)
また、入力装置の姿勢に基づいて表示画面上の位置を表す座標を算出する座標算出装置は、次のように構成されてもよい。すなわち、座標算出装置は、方向取得手段と、姿勢算出手段と、基準決定手段と、第1座標算出手段とを備えていてもよい。方向取得手段は、所定空間内の所定位置から見たときの入力装置の方向を取得する。姿勢算出手段は、所定空間における入力装置の姿勢を算出する。基準決定手段は、方向取得手段で取得された入力装置の方向が所定の方向となる時点の入力装置の姿勢を基準姿勢として決定する。第1座標算出手段は、表示画面上の位置を決定するための第1の座標を、入力装置が基準姿勢となる場合に所定の基準値となるように、かつ、基準姿勢から、姿勢算出手段が算出した姿勢までの変化の向きおよび変化量に応じた値となるように算出する。
(16)
In addition, a coordinate calculation device that calculates coordinates representing a position on the display screen based on the attitude of the input device may be configured as follows. That is, the coordinate calculation apparatus may include a direction acquisition unit, a posture calculation unit, a reference determination unit, and a first coordinate calculation unit. The direction acquisition means acquires the direction of the input device when viewed from a predetermined position in the predetermined space. The posture calculation means calculates the posture of the input device in the predetermined space. The reference determining unit determines the posture of the input device at the time when the direction of the input device acquired by the direction acquiring unit becomes a predetermined direction as the reference posture. The first coordinate calculation means sets the first coordinates for determining the position on the display screen to a predetermined reference value when the input device is in the reference attitude, and from the reference attitude, the attitude calculation means Is calculated to be a value corresponding to the direction and amount of change up to the calculated posture.
上記「基準決定手段」が行う処理は、後述する実施形態では、オフセット量を決定(記憶)する処理(ステップS57)に相当するが、基準姿勢自体を記憶しておいてもよい。
上記「第1の座標算出手段」が行う処理は、後述する実施形態では、後述する第1の方法で第1の座標を算出する処理(ステップS7)と、算出された第1の座標を補正する処理(ステップS42)とに相当する。ただし、他の実施形態においては、上記「第1の座標算出手段」が行う処理は、後述する実施形態のように第1の方法で第1の座標を算出する処理を含む必要はなく、基準姿勢と、姿勢算出手段が算出した姿勢との差に基づいて第1の座標を算出するものであってもよい。
The process performed by the “reference determination unit” corresponds to the process of determining (storing) the offset amount (step S57) in the embodiment described later, but the reference posture itself may be stored.
In the embodiment described later, the process performed by the “first coordinate calculation unit” is a process of calculating the first coordinate by the first method described later (step S7) and the calculated first coordinate is corrected. This corresponds to the processing (step S42). However, in another embodiment, the process performed by the “first coordinate calculation unit” does not need to include the process of calculating the first coordinate by the first method as in the embodiment described later. The first coordinate may be calculated based on the difference between the posture and the posture calculated by the posture calculation means.
上記(16)の構成によれば、入力装置の方向が所定の方向となる時点で基準姿勢が決定され、基準姿勢における画面上の位置が特定の値となるように第1の座標が算出される。したがって、上記基準値を適宜設定することで、入力装置が基準姿勢となる場合において、入力装置が指し示す画面上の位置と、算出される位置とを一致させる(または、両者のずれを小さくする)ことができる。したがって、上記(1)の構成と同様、入力装置の姿勢を用いて画面上の位置を適切に算出することができる。また、当該ずれによってユーザが操作に違和感を抱くことを防止することができる。 According to the configuration of (16) above, the reference posture is determined when the direction of the input device becomes a predetermined direction, and the first coordinates are calculated so that the position on the screen in the reference posture becomes a specific value. The Therefore, by appropriately setting the reference value, when the input device is in the reference posture, the position on the screen pointed to by the input device is matched with the calculated position (or the deviation between the two is reduced). be able to. Therefore, the position on the screen can be appropriately calculated using the attitude of the input device, as in the configuration (1). In addition, the user can be prevented from feeling uncomfortable due to the deviation.
(17)
座標算出装置は、表示画面上における第2の座標を入力装置の方向に基づいて算出する第2座標算出手段をさらに備えていてもよい。このとき、基準決定手段は、基準値に対応する表示画面上の位置が、入力装置の方向が所定の方向となる時点で算出される第2の座標が表す位置となるように、基準姿勢を算出する。
(17)
The coordinate calculation device may further include second coordinate calculation means for calculating the second coordinates on the display screen based on the direction of the input device. At this time, the reference determining means sets the reference posture so that the position on the display screen corresponding to the reference value is a position represented by the second coordinates calculated when the direction of the input device becomes a predetermined direction. calculate.
上記(17)の構成によれば、上記(2)の構成と同様、入力装置の方向が所定の方向となる状態において、第1の座標により決められる表示画面上の位置と、第2の座標が表す位置とを一致させることができる。したがって、上記(2)の構成と同様、画面上の位置を姿勢に基づいて適切に算出することができる。また、入力装置の姿勢に基づいて位置を算出する方法と、入力装置の方向に基づいて位置を算出する方法とを併用する場合においても、2つの方法を切り替える際にユーザが抱く違和感を軽減することができる。 According to the configuration of (17), as in the configuration of (2), the position on the display screen determined by the first coordinates and the second coordinates in a state where the direction of the input device is a predetermined direction. The position represented by can be matched. Accordingly, the position on the screen can be appropriately calculated based on the posture, as in the configuration (2). Further, even when the method for calculating the position based on the attitude of the input device and the method for calculating the position based on the direction of the input device are used in combination, the user feels uncomfortable when switching between the two methods. be able to.
(18)
第1の座標は、所定の基準点から入力装置の姿勢を示すベクトルの方向へ延ばした線分と、所定平面との交点の位置を表す座標であってもよい。このとき、基準決定手段は、基準姿勢となる場合に第1の座標が基準値となるように所定平面上で座標系を設定する。第1座標算出手段は、基準決定手段が設定した座標系を用いて表される第1の座標を算出する。また、座標算出装置は、第1座標算出手段が算出した第1の座標に基づいて表示画面上の位置を算出する位置算出手段をさらに備える。
(18)
The first coordinate may be a coordinate representing a position of an intersection of a line segment extending from a predetermined reference point in a vector direction indicating the attitude of the input device and a predetermined plane. At this time, the reference determining means sets the coordinate system on a predetermined plane so that the first coordinate becomes the reference value when the reference posture is set. The first coordinate calculation means calculates the first coordinates expressed using the coordinate system set by the reference determination means. The coordinate calculation device further includes position calculation means for calculating a position on the display screen based on the first coordinates calculated by the first coordinate calculation means.
上記18の構成によれば、上記(8)の構成と同様、入力装置の姿勢に応じて変化する平面上の座標(第1の座標)を容易に算出することができる。
According to the
(19)
基準決定手段は、所定の基準点に対して固定的に設定される平面上において所定平面を設定してもよい。
(19)
The reference determining means may set a predetermined plane on a plane fixedly set with respect to the predetermined reference point.
上記(19)の構成によれば、基準姿勢がどのような値であっても、1つの平面上において第1の座標の座標系が設定されるので、座標系を容易に設定することができる。 According to the configuration of (19) above, the coordinate system of the first coordinate is set on one plane regardless of the value of the reference posture, so that the coordinate system can be easily set. .
(20)
基準決定手段は、所定の基準点からの距離が一定となるように所定平面を設定してもよい。
(20)
The reference determining means may set the predetermined plane so that the distance from the predetermined reference point is constant.
上記(20)の構成によれば、基準姿勢の値にかかわらず、基準点から座標系の平面までの距離が一定となるので、画面上の位置をより正確に算出することができる。 According to the configuration of (20) above, the distance from the reference point to the plane of the coordinate system is constant regardless of the value of the reference posture, so that the position on the screen can be calculated more accurately.
また、本発明は、情報処理装置のコンピュータを上記各手段として機能させる座標算出プログラムの形態で実施されてもよい。 The present invention may also be implemented in the form of a coordinate calculation program that causes a computer of an information processing apparatus to function as each of the above means.
本発明によれば、入力装置の方向が所定の方向となる場合において、入力装置の姿勢に基づく画面上の位置を、入力装置が指し示す位置に合った適切な位置となるように算出することができる。これによって、入力装置が指し示す位置と、姿勢から算出される画面上の位置とのずれを小さくすることができ、当該ずれによってユーザが操作に違和感を抱くことを防止することができる。 According to the present invention, when the direction of the input device is a predetermined direction, the position on the screen based on the attitude of the input device can be calculated to be an appropriate position that matches the position indicated by the input device. it can. Thereby, the deviation between the position indicated by the input device and the position on the screen calculated from the posture can be reduced, and the user can be prevented from feeling uncomfortable due to the deviation.
[ゲームシステムの全体構成]
図1を参照して、本発明の一実施形態に係る座標算出装置の一例であるゲーム装置を含むゲームシステム1について説明する。図1は、ゲームシステム1の外観図である。以下、据置型のゲーム装置を一例にして、本実施形態のゲーム装置およびゲームプログラムについて説明する。図1において、ゲームシステム1は、テレビジョン受像器(以下、単に「テレビ」と記載する)2、ゲーム装置3、光ディスク4、入力装置8、およびマーカ部6を含む。本システムは、入力装置8を用いたゲーム操作に基づいてゲーム装置3でゲーム処理を実行するものである。
[Overall configuration of game system]
With reference to FIG. 1, a
ゲーム装置3には、当該ゲーム装置3に対して交換可能に用いられる情報記憶媒体の一例である光ディスク4が脱着可能に挿入される。光ディスク4には、ゲーム装置3において実行されるためのゲームプログラムが記憶されている。ゲーム装置3の前面には光ディスク4の挿入口が設けられている。ゲーム装置3は、挿入口に挿入された光ディスク4に記憶されているゲームプログラムを読み出して実行することによってゲーム処理を実行する。
An optical disk 4 that is an example of an information storage medium that can be used interchangeably with the
ゲーム装置3には、表示装置の一例であるテレビ2が接続コードを介して接続される。テレビ2は、ゲーム装置3において実行されるゲーム処理の結果得られるゲーム画像を表示する。また、テレビ2の画面の周辺(図1では画面の上側)には、マーカ部6が設置される。マーカ部6は、その両端に2つのマーカ6Rおよび6Lを備えている。マーカ6R(マーカ6Lも同様)は、具体的には1以上の赤外LEDであり、テレビ2の前方に向かって赤外光を出力する。マーカ部6はゲーム装置3に接続されており、ゲーム装置3はマーカ部6が備える各赤外LEDの点灯を制御することが可能である。
A
入力装置8は、自機に対して行われた操作の内容を示す操作データをゲーム装置3に与えるものである。本実施形態では、入力装置8はコントローラ5とジャイロセンサユニット7とを含む。詳細は後述するが、入力装置8は、コントローラ5に対してジャイロセンサユニット7が着脱可能に接続されている構成である。コントローラ5とゲーム装置3とは無線通信によって接続される。本実施形態では、コントローラ5とゲーム装置3との間の無線通信には例えばBluetooth(ブルートゥース)(登録商標)の技術が用いられる。なお、他の実施形態においてはコントローラ5とゲーム装置3とは有線で接続されてもよい。
The input device 8 gives operation data indicating the content of the operation performed on the own device to the
[ゲーム装置3の内部構成]
次に、図2を参照して、ゲーム装置3の内部構成について説明する。図2は、ゲーム装置3の構成を示すブロック図である。ゲーム装置3は、CPU10、システムLSI11、外部メインメモリ12、ROM/RTC13、ディスクドライブ14、およびAV−IC15等を有する。
[Internal configuration of game device 3]
Next, the internal configuration of the
CPU10は、光ディスク4に記憶されたゲームプログラムを実行することによってゲーム処理を実行するものであり、ゲームプロセッサとして機能する。CPU10は、システムLSI11に接続される。システムLSI11には、CPU10の他、外部メインメモリ12、ROM/RTC13、ディスクドライブ14およびAV−IC15が接続される。システムLSI11は、それに接続される各構成要素間のデータ転送の制御、表示すべき画像の生成、外部装置からのデータの取得等の処理を行う。システムLSIの内部構成について後述する。揮発性の外部メインメモリ12は、光ディスク4から読み出されたゲームプログラムや、フラッシュメモリ17から読み出されたゲームプログラム等のプログラムを記憶したり、各種データを記憶したりするものであり、CPU10のワーク領域やバッファ領域として用いられる。ROM/RTC13は、ゲーム装置3の起動用のプログラムが組み込まれるROM(いわゆるブートROM)と、時間をカウントするクロック回路(RTC:Real Time Clock)とを有する。ディスクドライブ14は、光ディスク4からプログラムデータやテクスチャデータ等を読み出し、後述する内部メインメモリ11eまたは外部メインメモリ12に読み出したデータを書き込む。
The
また、システムLSI11には、入出力プロセッサ(I/Oプロセッサ)11a、GPU(Graphics Processor Unit)11b、DSP(Digital Signal Processor)11c、VRA 1d、および内部メインメモリ11eが設けられる。図示は省略するが、これらの構成要素11a〜11eは内部バスによって互いに接続される。
The
GPU11bは、描画手段の一部を形成し、CPU10からのグラフィクスコマンド(作画命令)に従って画像を生成する。VRAM11dは、GPU11bがグラフィクスコマンドを実行するために必要なデータ(ポリゴンデータやテクスチャデータ等のデータ)を記憶する。画像が生成される際には、GPU11bは、VRAM11dに記憶されたデータを用いて画像データを作成する。
The
DSP11cは、オーディオプロセッサとして機能し、内部メインメモリ11eや外部メインメモリ12に記憶されるサウンドデータや音波形(音色)データを用いて、音声データを生成する。
The
上述のように生成された画像データおよび音声データは、AV−IC15によって読み出される。AV−IC15は、読み出した画像データをAVコネクタ16を介してテレビ2に出力するとともに、読み出した音声データを、テレビ2に内蔵されるスピーカ2aに出力する。これによって、画像がテレビ2に表示されるとともに音がスピーカ2aから出力される。
The image data and audio data generated as described above are read out by the AV-
入出力プロセッサ11aは、それに接続される構成要素との間でデータの送受信を実行したり、外部装置からのデータのダウンロードを実行したりする。入出力プロセッサ11aは、フラッシュメモリ17、無線通信モジュール18、無線コントローラモジュール19、拡張コネクタ20、およびメモリカード用コネクタ21に接続される。無線通信モジュール18にはアンテナ22が接続され、無線コントローラモジュール19にはアンテナ23が接続される。
The input / output processor 11a performs transmission / reception of data to / from components connected to the input / output processor 11a and downloads data from an external device. The input / output processor 11a is connected to the
入出力プロセッサ11aは、無線通信モジュール18およびアンテナ22を介してネットワークに接続し、ネットワークに接続される他のゲーム装置や各種サーバと通信することができる。入出力プロセッサ11aは、定期的にフラッシュメモリ17にアクセスし、ネットワークへ送信する必要があるデータの有無を検出し、当該データが有る場合には、無線通信モジュール18およびアンテナ22を介してネットワークに送信する。また、入出力プロセッサ11aは、他のゲーム装置から送信されてくるデータやダウンロードサーバからダウンロードしたデータを、ネットワーク、アンテナ22および無線通信モジュール18を介して受信し、受信したデータをフラッシュメモリ17に記憶する。CPU10はゲームプログラムを実行することにより、フラッシュメモリ17に記憶されたデータを読み出してゲームプログラムで利用する。フラッシュメモリ17には、ゲーム装置3と他のゲーム装置や各種サーバとの間で送受信されるデータの他、ゲーム装置3を利用してプレイしたゲームのセーブデータ(ゲームの結果データまたは途中データ)が記憶されてもよい。
The input / output processor 11a is connected to the network via the
また、入出力プロセッサ11aは、コントローラ5から送信される操作データをアンテナ23および無線コントローラモジュール19を介して受信し、内部メインメモリ11eまたは外部メインメモリ12のバッファ領域に記憶(一時記憶)する。
The input / output processor 11a receives operation data transmitted from the
さらに、入出力プロセッサ11aには、拡張コネクタ20およびメモリカード用コネクタ21が接続される。拡張コネクタ20は、USBやSCSIのようなインターフェースのためのコネクタであり、外部記憶媒体のようなメディアを接続したり、他のコントローラのような周辺機器を接続したり、有線の通信用コネクタを接続することによって無線通信モジュール18に替えてネットワークとの通信を行ったりすることができる。メモリカード用コネクタ21は、メモリカードのような外部記憶媒体を接続するためのコネクタである。例えば、入出力プロセッサ11aは、拡張コネクタ20やメモリカード用コネクタ21を介して外部記憶媒体にアクセスし、外部記憶媒体にデータを保存したり、外部記憶媒体からデータを読み出したりすることができる。
Further, an
ゲーム装置3には、電源ボタン24、リセットボタン25、およびイジェクトボタン26が設けられる。電源ボタン24およびリセットボタン25は、システムLSI11に接続される。電源ボタン24がオンされると、ゲーム装置3の各構成要素に対して、図示しないACアダプタを経て電源が供給される。リセットボタン25が押されると、システムLSI11は、ゲーム装置3の起動プログラムを再起動する。イジェクトボタン26は、ディスクドライブ14に接続される。イジェクトボタン26が押されると、ディスクドライブ14から光ディスク4が排出される。
The
[入力装置8の構成]
次に、図3〜図6を参照して、入力装置8について説明する。図3は、入力装置8の外観構成を示す斜視図である。図4は、コントローラ5の外観構成を示す斜視図である。図3は、コントローラ5の上側後方から見た斜視図であり、図4は、コントローラ5を下側前方から見た斜視図である。
[Configuration of Input Device 8]
Next, the input device 8 will be described with reference to FIGS. FIG. 3 is a perspective view showing an external configuration of the input device 8. FIG. 4 is a perspective view showing an external configuration of the
図3および図4において、コントローラ5は、例えばプラスチック成型によって形成されたハウジング31を有している。ハウジング31は、その前後方向(図3に示すZ軸方向)を長手方向とした略直方体形状を有しており、全体として大人や子供の片手で把持可能な大きさである。プレイヤは、コントローラ5に設けられたボタンを押下すること、および、コントローラ5自体を動かしてその位置や姿勢を変えることによってゲーム操作を行うことができる。
3 and 4, the
ハウジング31には、複数の操作ボタンが設けられる。図3に示すように、ハウジング31の上面には、十字ボタン32a、1番ボタン32b、2番ボタン32c、Aボタン32d、マイナスボタン32e、ホームボタン32f、プラスボタン32g、および電源ボタン32hが設けられる。本明細書では、これらのボタン32a〜32hが設けられるハウジング31の上面を「ボタン面」と呼ぶことがある。一方、図4に示すように、ハウジング31の下面には凹部が形成されており、当該凹部の後面側傾斜面にはBボタン32iが設けられる。これらの各操作ボタン32a〜32iには、ゲーム装置3が実行するゲームプログラムに応じた機能が適宜割り当てられる。また、電源ボタン32hは遠隔からゲーム装置3本体の電源をオン/オフするためのものである。ホームボタン32fおよび電源ボタン32hは、その上面がハウジング31の上面に埋没している。これによって、プレイヤがホームボタン32fまたは電源ボタン32hを誤って押下することを防止することができる。
The
ハウジング31の後面にはコネクタ33が設けられている。コネクタ33は、コントローラ5に他の機器(例えば、ジャイロセンサユニット7や他のコントローラ)を接続するために利用される。また、ハウジング31の後面におけるコネクタ33の両側には、上記他の機器が容易に離脱することを防止するために係止穴33aが設けられている。
A
ハウジング31上面の後方には複数(図3では4つ)のLED34a〜34dが設けられる。ここで、コントローラ5には、他のメインコントローラと区別するためにコントローラ種別(番号)が付与される。各LED34a〜34dは、コントローラ5に現在設定されている上記コントローラ種別をプレイヤに通知したり、コントローラ5の電池残量をプレイヤに通知したりする等の目的で用いられる。具体的には、コントローラ5を用いてゲーム操作が行われる際、上記コントローラ種別に応じて複数のLED34a〜34dのいずれか1つが点灯する。
A plurality (four in FIG. 3) of
また、コントローラ5は撮像情報演算部35(図6)を有しており、図4に示すように、ハウジング31前面には撮像情報演算部35の光入射面35aが設けられる。光入射面35aは、マーカ6Rおよび6Lからの赤外光を少なくとも透過する材質で構成される。
Further, the
ハウジング31上面における1番ボタン32bとホームボタン32fとの間には、コントローラ5に内蔵されるスピーカ49(図5)からの音を外部に放出するための音抜き孔31aが形成されている。
Between the
次に、図5および図6を参照して、コントローラ5の内部構造について説明する。図5および図6は、コントローラ5の内部構造を示す図である。なお、図5は、コントローラ5の上筐体(ハウジング31の一部)を外した状態を示す斜視図である。図6は、コントローラ5の下筐体(ハウジング31の一部)を外した状態を示す斜視図である。図6に示す斜視図は、図5に示す基板30を裏面から見た斜視図となっている。
Next, the internal structure of the
図5において、ハウジング31の内部には基板30が固設されており、当該基板30の上主面上に各操作ボタン32a〜32h、各LED34a〜34d、加速度センサ37、アンテナ45、およびスピーカ49等が設けられる。これらは、基板30等に形成された配線(図示せず)によってマイクロコンピュータ(Micro Computer:マイコン)42(図6参照)に接続される。本実施形態では、加速度センサ37は、X軸方向に関してコントローラ5の中心からずれた位置に配置されている。これによって、コントローラ5をZ軸回りに回転させたときのコントローラ5の動きが算出しやすくなる。また、加速度センサ37は、長手方向(Z軸方向)に関してコントローラ5の中心よりも前方に配置されている。また、無線モジュール44(図6)およびアンテナ45によって、コントローラ5がワイヤレスコントローラとして機能する。
In FIG. 5, a
一方、図6において、基板30の下主面上の前端縁に撮像情報演算部35が設けられる。撮像情報演算部35は、コントローラ5の前方から順に赤外線フィルタ38、レンズ39、撮像素子40、および画像処理回路41を備えている。これらの部材38〜41はそれぞれ基板30の下主面に取り付けられる。
On the other hand, in FIG. 6, an imaging
さらに、基板30の下主面上には、上記マイコン42およびバイブレータ48が設けられている。バイブレータ48は、例えば振動モータやソレノイドであり、基板30等に形成された配線によってマイコン42と接続される。マイコン42の指示によりバイブレータ48が作動することによってコントローラ5に振動が発生する。これによって、コントローラ5を把持しているプレイヤの手にその振動が伝達される、いわゆる振動対応ゲームを実現することができる。本実施形態では、バイブレータ48は、ハウジング31のやや前方寄りに配置される。つまり、バイブレータ48がコントローラ5の中心よりも端側に配置することによって、バイブレータ48の振動によりコントローラ5全体を大きく振動させることができる。また、コネクタ33は、基板30の下主面上の後端縁に取り付けられる。なお、図5および図6に示す他、コントローラ5は、マイコン42の基本クロックを生成する水晶振動子、スピーカ49に音声信号を出力するアンプ等を備えている。
Further, the
また、ジャイロセンサユニット7は、3軸回りの角速度を検知するジャイロセンサ(図7に示すジャイロセンサ55および56)を有する。ジャイロセンサユニット7は、コントローラ5のコネクタ33に着脱可能に装着される。ジャイロセンサユニット7の前端(図3に示すZ軸正方向側の端部)には、コネクタ33に接続可能なプラグ(図7に示すプラグ53)が設けられる。さらに、プラグ53の両側にはフック(図示せず)が設けられる。ジャイロセンサユニット7がコントローラ5に対して装着される状態では、プラグ53がコネクタ33に接続されるとともに、上記フックがコントローラ5の係止穴33aに係止する。これによって、コントローラ5とジャイロセンサユニット7とがしっかりと固定される。また、ジャイロセンサユニット7は側面(図3に示すX軸方向の面)にボタン51を有している。ボタン51は、それを押下すれば上記フックの係止穴33aに対する係止状態を解除することができるように構成されている。したがって、ボタン51を押下しながらプラグ53をコネクタ33から抜くことによって、ジャイロセンサユニット7をコントローラ5から離脱することができる。
Further, the
また、ジャイロセンサユニット7の後端には、上記コネクタ33と同形状のコネクタが設けられる。したがって、コントローラ5(のコネクタ33)に対して装着可能な他の機器は、ジャイロセンサユニット7のコネクタに対しても装着可能である。なお、図3においては、当該コネクタに対してカバー52が着脱可能に装着されている。
A connector having the same shape as the
なお、図3〜図6に示したコントローラ5およびジャイロセンサユニット7の形状や、各操作ボタンの形状、加速度センサやバイブレータの数および設置位置等は単なる一例に過ぎず、他の形状、数、および設置位置であっても、本発明を実現することができる。また、本実施形態では、撮像手段による撮像方向はZ軸正方向であるが、撮像方向はいずれの方向であってもよい。すなわち、コントローラ5における撮像情報演算部35の位置(撮像情報演算部35の光入射面35a)は、ハウジング31の前面でなくてもよく、ハウジング31の外部から光を取り入れることができれば他の面に設けられてもかまわない。
The shapes of the
図7は、入力装置8(コントローラ5およびジャイロセンサユニット7)の構成を示すブロック図である。コントローラ5は、操作部32(各操作ボタン32a〜32i)、コネクタ33、撮像情報演算部35、通信部36、および加速度センサ37を備えている。コントローラ5は、自機に対して行われた操作内容を示すデータを操作データとしてゲーム装置3へ送信するものである。
FIG. 7 is a block diagram showing a configuration of the input device 8 (the
操作部32は、上述した各操作ボタン32a〜32iを含み、各操作ボタン32a〜32iに対する入力状態(各操作ボタン32a〜32iが押下されたか否か)を示す操作ボタンデータを通信部36のマイコン42へ出力する。
The
撮像情報演算部35は、撮像手段が撮像した画像データを解析してその中で輝度が高い領域を判別してその領域の重心位置やサイズなどを算出するためのシステムである。撮像情報演算部35は、例えば最大200フレーム/秒程度のサンプリング周期を有するので、比較的高速なコントローラ5の動きでも追跡して解析することができる。
The imaging
撮像情報演算部35は、赤外線フィルタ38、レンズ39、撮像素子40、および画像処理回路41を含んでいる。赤外線フィルタ38は、コントローラ5の前方から入射する光から赤外線のみを通過させる。レンズ39は、赤外線フィルタ38を透過した赤外線を集光して撮像素子40へ入射させる。撮像素子40は、例えばCMOSセンサやあるいはCCDセンサのような固体撮像素子であり、レンズ39が集光した赤外線を受光して画像信号を出力する。ここで、テレビ2の表示画面近傍に配置されるマーカ部6のマーカ6Rおよび6Lは、テレビ2の前方に向かって赤外光を出力する赤外LEDで構成される。したがって、赤外線フィルタ38を設けることによって、撮像素子40は、赤外線フィルタ38を通過した赤外線だけを受光して画像データを生成するので、マーカ6Rおよび6Lの画像をより正確に撮像することができる。以下では、撮像素子40によって撮像された画像を撮像画像と呼ぶ。撮像素子40によって生成された画像データは、画像処理回路41で処理される。画像処理回路41は、撮像画像内における撮像対象(マーカ6Rおよび6L)の位置を算出する。画像処理回路41は、算出された位置を示す座標を通信部36のマイコン42へ出力する。この座標のデータは、マイコン42によって操作データとしてゲーム装置3に送信される。以下では、上記座標を「マーカ座標」と呼ぶ。マーカ座標はコントローラ5自体の向き(傾斜角度)や位置に対応して変化するので、ゲーム装置3はこのマーカ座標を用いてコントローラ5の向きや位置を算出することができる。
The imaging
なお、他の実施形態においては、コントローラ5は画像処理回路41を備えていない構成であってもよく、撮像画像自体がコントローラ5からゲーム装置3へ送信されてもよい。このとき、ゲーム装置3は、画像処理回路41と同様の機能を有する回路あるいはプログラムを有しており、上記マーカ座標を算出するようにしてもよい。
In other embodiments, the
加速度センサ37は、コントローラ5の加速度(重力加速度を含む)を検出する、すなわち、コントローラ5に加わる力(重力を含む)を検出する。加速度センサ37は、当該加速度センサ37の検出部に加わっている加速度のうち、センシング軸方向に沿った直線方向の加速度(直線加速度)の値を検出する。例えば、2軸以上の多軸加速度センサの場合には、加速度センサの検出部に加わっている加速度として、各軸に沿った成分の加速度をそれぞれ検出する。例えば、3軸または2軸の加速度センサは、アナログ・デバイセズ株式会社(Analog Devices, Inc.)またはSTマイクロエレクトロニクス社(STMicroelectronics N.V.)から入手可能である種類のものでもよい。なお、加速度センサ37は、例えば静電容量式の加速度センサであるとするが、他の方式の加速度センサを用いるようにしてもよい。
The
本実施形態では、加速度センサ37は、コントローラ5を基準とした上下方向(図3に示すY軸方向)、左右方向(図3に示すX軸方向)および前後方向(図3に示すZ軸方向)の3軸方向に関してそれぞれ直線加速度を検出する。加速度センサ37は、各軸に沿った直線方向に関する加速度を検出するものであるため、加速度センサ37からの出力は3軸それぞれの直線加速度の値を表すものとなる。すなわち、検出された加速度は、入力装置8(コントローラ5)を基準に設定されるXYZ座標系(コントローラ座標系)における3次元のベクトル(ax,ay,az)として表される。以下では、加速度センサ37によって検出される3軸に関する各加速度値を各成分とするベクトルを加速度ベクトルと呼ぶ。
In the present embodiment, the
加速度センサ37が検出した加速度を示すデータ(加速度データ)は、通信部36へ出力される。なお、加速度センサ37が検出した加速度は、コントローラ5自体の向き(傾斜角度)や動きに対応して変化するので、ゲーム装置3は加速度データを用いてコントローラ5の向きや動きを算出することができる。本実施形態では、ゲーム装置3は、加速度データに基づいてコントローラ5の姿勢を判断する。
Data indicating the acceleration detected by the acceleration sensor 37 (acceleration data) is output to the
加速度センサ37が検出した加速度(加速度ベクトル)を示すデータ(加速度データ)は、通信部36へ出力される。本実施形態において、加速度センサ37は、コントローラ5の傾斜角度を判断するためのデータを出力するセンサとして用いられる。
Data (acceleration data) indicating the acceleration (acceleration vector) detected by the
なお、加速度センサ37から出力される加速度の信号に基づいて、ゲーム装置3のプロセッサ(例えばCPU10)またはコントローラ5のプロセッサ(例えばマイコン42)等のコンピュータが処理を行うことによって、コントローラ5に関するさらなる情報を推測または算出(判定)することができることは、当業者であれば本明細書の説明から容易に理解できるであろう。例えば、加速度センサ37を搭載するコントローラ5が静止状態であることを前提としてコンピュータ側の処理が実行される場合(すなわち、加速度センサによって検出される加速度が重力加速度のみであるとして処理が実行される場合)、コントローラ5が現実に静止状態であれば、検出された加速度に基づいてコントローラ5の姿勢が重力方向に対して傾いているか否かまたはどの程度傾いているかを知ることができる。具体的には、加速度センサ37の検出軸が鉛直下方向を向いている状態を基準としたとき、1G(重力加速度)がかかっているか否かによって、コントローラ5が基準に対して傾いているか否かを知ることができるし、その大きさによって基準に対してどの程度傾いているかも知ることができる。また、多軸の加速度センサ37の場合には、さらに各軸の加速度の信号に対して処理を施すことによって、重力方向に対してコントローラ5がどの程度傾いているかをより詳細に知ることができる。この場合において、プロセッサは、加速度センサ37からの出力に基づいてコントローラ5の傾斜角度を算出してもよいし、当該傾斜角度を算出せずに、コントローラ5の傾斜方向を算出するようにしてもよい。このように、加速度センサ37をプロセッサと組み合わせて用いることによって、コントローラ5の傾斜角度または姿勢を判定することができる。
In addition, based on the acceleration signal output from the
一方、コントローラ5が動的な状態(コントローラ5が動かされている状態)であることを前提とする場合には、加速度センサ37は重力加速度に加えてコントローラ5の動きに応じた加速度を検出するので、検出された加速度から重力加速度の成分を所定の処理により除去することによってコントローラ5の動き方向を知ることができる。また、コントローラ5が動的な状態であることを前提とする場合であっても、検出された加速度から、加速度センサの動きに応じた加速度の成分を所定の処理により除去することによって、重力方向に対するコントローラ5の傾きを知ることが可能である。なお、他の実施例では、加速度センサ37は、内蔵の加速度検出手段で検出された加速度信号をマイコン42に出力する前に当該加速度信号に対して所定の処理を行うための、組込み式の処理装置または他の種類の専用の処理装置を備えていてもよい。組込み式または専用の処理装置は、例えば、加速度センサ37が静的な加速度(例えば、重力加速度)を検出するために用いられる場合、加速度信号を傾斜角(あるいは、他の好ましいパラメータ)に変換するものであってもよい。
On the other hand, when it is assumed that the
通信部36は、マイコン42、メモリ43、無線モジュール44、およびアンテナ45を含んでいる。マイコン42は、処理を行う際にメモリ43を記憶領域として用いながら、マイコン42が取得したデータをゲーム装置3へ無線送信する無線モジュール44を制御する。また、マイコン42はコネクタ33に接続されている。ジャイロセンサユニット7から送信されてくるデータは、コネクタ33を介してマイコン42に入力される。以下、ジャイロセンサユニット7の構成について説明する。
The
ジャイロセンサユニット7は、プラグ53、マイコン54、2軸ジャイロセンサ55、および1軸ジャイロセンサ56を備えている。上述のように、ジャイロセンサユニット7は、3軸(本実施形態では、XYZ軸)周りの角速度を検出し、検出した角速度を示すデータ(角速度データ)をコントローラ5へ送信する。
The
2軸ジャイロセンサ55は、X軸周りの角速度およびY軸周りの(単位時間あたりの)角速度を検出する。また、1軸ジャイロセンサ56は、Z軸周りの(単位時間あたりの)角速度を検出する。なお、本明細書では、コントローラ5の撮像方向(Z軸正方向)を基準として、XYZ軸周りの回転方向を、それぞれ、ロール方向、ピッチ方向、ヨー方向と呼ぶ。すなわち、2軸ジャイロセンサ55は、ロール方向(X軸周りの回転方向)およびピッチ方向(Y軸周りの回転方向)の角速度を検出し、1軸ジャイロセンサ56は、ヨー方向(Z軸周りの回転方向)の角速度を検出する。
The
なお、本実施形態では、3軸回りの角速度を検出するために、2軸ジャイロセンサ55と1軸ジャイロセンサ56とを用いる構成としたが、他の実施形態においては、3軸回りの角速度を検出することができればよく、用いるジャイロセンサの数および組み合わせはどのようなものであってもよい。
In this embodiment, the 2-
また、本実施形態では、後述する姿勢算出処理における計算を容易にする目的で、各ジャイロセンサ55および56が角速度を検出する3つの軸は、加速度センサ37が加速度を検出する3つの軸(XYZ軸)と一致するように設定される。ただし、他の実施形態においては、各ジャイロセンサ56および57が角速度を検出する3つの軸と、加速度センサ37が加速度を検出する3つの軸とは一致しなくてもよい。
Further, in the present embodiment, for the purpose of facilitating the calculation in the posture calculation process described later, the three axes where the
各ジャイロセンサ56および57で検出された角速度を示すデータは、マイコン54に出力される。したがって、マイコン54には、XYZ軸の3軸回りの角度速度を示すデータが入力されることになる。マイコン54は、上記3軸回りの角速度を示すデータを角速度データとしてプラグ53を介してコントローラ5へ送信する。なお、マイコン54からコントローラ5への送信は所定の周期毎に逐次行われるが、ゲームの処理は1/60秒を単位として(1フレーム時間として)行われることが一般的であるので、この時間以下の周期で送信を行うことが好ましい。
Data indicating the angular velocity detected by each of the
コントローラ5の説明に戻り、操作部32、撮像情報演算部35、および加速度センサ37からマイコン42へ出力されたデータ、ならびに、ジャイロセンサユニット7からマイコン42へ送信されてきたデータは、一時的にメモリ43に格納される。これらのデータは、上記操作データとしてゲーム装置3へ送信される。すなわち、マイコン42は、ゲーム装置3の無線コントローラモジュール19への送信タイミングが到来すると、メモリ43に格納されている操作データを無線モジュール44へ出力する。無線モジュール44は、例えばBluetooth(ブルートゥース)(登録商標)の技術を用いて、所定周波数の搬送波を操作データで変調し、その微弱電波信号をアンテナ45から放射する。つまり、操作データは、無線モジュール44で微弱電波信号に変調されてコントローラ5から送信される。微弱電波信号はゲーム装置3側の無線コントローラモジュール19で受信される。受信された微弱電波信号について復調や復号を行うことによって、ゲーム装置3は操作データを取得することができる。そして、ゲーム装置3のCPU10は、取得した操作データとゲームプログラムとに基づいて、ゲーム処理を行う。なお、通信部36から無線コントローラモジュール19への無線送信は所定の周期毎に逐次行われるが、ゲームの処理は1/60秒を単位として(1フレーム時間として)行われることが一般的であるので、この時間以下の周期で送信を行うことが好ましい。コントローラ5の通信部36は、例えば1/200秒に1回の割合で各操作データをゲーム装置3の無線コントローラモジュール19へ出力する。
Returning to the description of the
上記コントローラ5を用いることによって、プレイヤは、各操作ボタンを押下する従来の一般的なゲーム操作に加えて、コントローラ5を任意の傾斜角度に傾ける操作を行うことができる。その他、上記コントローラ5によれば、プレイヤは、コントローラ5によって画面上の任意の位置を指示する操作、および、コントローラ5自体を動かす操作を行うこともできる。
By using the
[姿勢算出処理の概要]
次に、図8〜図12を参照して、ゲーム装置3において実行される、入力装置8の姿勢を算出する姿勢算出処理の概要を説明する。本実施形態では、ゲーム装置3は、ジャイロセンサ55および56と、加速度センサ37と、撮像手段(撮像素子40)とを備えた入力装置8からデータ(操作データ)を取得し、入力装置8の姿勢を算出する。なお、本実施形態では、入力装置8は、加速度センサ37と撮像素子40とを両方備える構成とするが、他の実施形態においては、加速度センサ37と撮像素子40とのいずれか一方のみを備える構成であってもよい。
[Outline of posture calculation processing]
Next, with reference to FIGS. 8 to 12, an outline of a posture calculation process for calculating the posture of the input device 8 executed in the
ゲーム装置3は、(1)姿勢算出手段と、(2)第1補正手段と、(3)第2補正手段とを備えている。本実施形態においては、これら各手段は、ゲーム装置3のコンピュータ(CPU10)によって実行されるゲームプログラム(座標算出プログラム)が、当該コンピュータを当該各手段として機能させることによって実現される。なお、他の実施形態においては、上記各手段の一部または全部は、ゲーム装置3が備える専用回路として実現されてもよい。
The
(1)姿勢算出手段
姿勢算出手段は、ジャイロセンサ55および56が検出する角速度に基づいて入力装置8の姿勢を算出する(後述するステップS4)。角速度から姿勢を算出する方法はどのような方法であってもよいが、例えば、初期姿勢に(単位時間あたりの)角速度を逐次加算する方法がある。すなわち、ジャイロセンサ55および56から逐次出力される角速度を積分し、初期状態からの姿勢の変化量を積分結果から算出することによって、現在の姿勢を算出することができる。なお、以下では、姿勢算出手段によって角速度から算出される入力装置8の姿勢を「第1の姿勢」と呼ぶ。ただし、第1の姿勢に補正が加えられた後の姿勢も第1の姿勢と呼ぶ。
(1) Attitude calculation means The attitude calculation means calculates the attitude of the input device 8 based on the angular velocity detected by the
ここで、ジャイロセンサ55および56が検出する角速度を用いて算出される上記第1の姿勢には、ジャイロセンサ55および56の誤検知が原因で、入力装置8の実際の姿勢との間に誤差が生じることがある。そこで、本実施形態では、ゲーム装置3は、加速度センサ37によって検出される加速度を用いて上記第1の姿勢を補正する。また、撮像素子40によって撮像される画像(撮像画像)を用いて上記第1の姿勢を補正する。
Here, the first posture calculated using the angular velocities detected by the
(2)第1補正手段
第1補正手段は、加速度センサ37が検出する加速度データに基づいて上記第1の姿勢を補正する(後述するステップS5)。本実施形態では、第1補正手段は、上記第1の姿勢を第2の姿勢へと近づける補正を行う。ここで、第2の姿勢とは、加速度データから決まる姿勢、具体的には、加速度データが示す加速度の向きが鉛直下向きであると想定する場合における入力装置8の姿勢を指す。すなわち、加速度データが示す加速度が重力加速度であると仮定して算出された姿勢である。以下、図8〜図10を参照して、第1補正手段による補正処理(第1補正処理)を説明する。
(2) First Correction Unit The first correction unit corrects the first posture based on acceleration data detected by the acceleration sensor 37 (step S5 described later). In the present embodiment, the first correction unit performs correction to bring the first posture closer to the second posture. Here, the second posture refers to a posture determined from the acceleration data, specifically, a posture of the input device 8 when it is assumed that the direction of acceleration indicated by the acceleration data is vertically downward. That is, the posture is calculated on the assumption that the acceleration indicated by the acceleration data is gravitational acceleration. Hereinafter, a correction process (first correction process) by the first correction unit will be described with reference to FIGS.
図8は、第2の姿勢を用いた第1の姿勢の補正を示す図である。なお、本実施形態では、実際には3次元空間における姿勢を処理しているが、図8〜図10では、図面をわかりやすくするために2次元平面における姿勢を用いて説明する。図8(a)に示すベクトルGは、入力装置8が存在する空間の所定位置を基準とした空間座標系に定義された鉛直下方向、すなわち重力方向を示す。また、図8(a)に示すベクトルv1は、コントローラ5が第1の姿勢であるときの、入力装置8の下向きのベクトル(すなわち図3−図5に示されるY軸負方向)の空間座標系での向きを示したものである。なお、入力装置8の姿勢が基本状態にあるときには、姿勢を示すベクトルはベクトルGと一致することになる。したがって、ベクトルv1は、空間座標系における第1の姿勢に対応する。上記第1の姿勢は、ベクトルGに対してベクトルv1がなす回転としても表すことができ、2次元の図8においては角度θ1として示している。第1の姿勢は角速度によって算出されるので、ベクトルv1は、前回の姿勢に角速度を加えて回転させることによって算出されるものである。第2の姿勢は加速度データに基づいて算出される。図8(a)に示すベクトルv2は、加速度データが示す加速度の向き(ビュー座標系における加速度の向き)を示している。ただし、加速度データは入力装置8に加えられる加速度であって、取得できるのは入力装置8を基準とした座標系におけるベクトルである。図8(b)に、加速度センサの軸と加速度ベクトルとの関係を示す。図8(b)のように、加速度センサから取得される加速度ベクトルv0と、センサのY軸負方向とのなす角度がθ2であるとき、図8(a)の空間座標系においては、ベクトルv1に回転θ2を加えたベクトルv2が空間座標系における加速度ベクトルとなる。そして、第2の姿勢は、上述したように「加速度データが示す加速度の向きが鉛直下向きとみなした場合における入力装置8の姿勢」であるので、ベクトルv2からベクトルv1へ向いた角度θ2の回転が第2の姿勢となる。第2の姿勢を、ベクトルv1のように空間座標系における入力装置8の下向きのベクトルで表すと、ベクトルGをθ2だけ回転させたベクトルv2’として示すことができる。また、3次元の姿勢の場合には、3次元の回転行列等で表現することもできる。なお、角速度から第1の姿勢が正しく算出され、かつ、加速度データが重力方向を正確に示している場合には、加速度の向きを示すベクトルv2の方向は空間座標系の鉛直下方向、つまり重力方向と一致する。つまり、角速度から第1の姿勢が正しく算出されていない場合や、加速度データが正確な重力方向を示していない場合には、図8(a)のように、加速度の向きを示すベクトルv2と重力方向のベクトルGとが異なる。そして、例えば静止状態等のように、加速度データにより示される方向が重力方向と一致すると想定される状況においては、ベクトルv1よりもベクトルv2の方が入力装置8の姿勢に対応するデータとして正確なものと考えられる。また、入力装置が静止していない場合であっても、ある程度の期間内における平均的な姿勢の精度を考慮すると、加速度ベクトルは平均的には重力方向に近いものとなるので、時間とともに誤差の蓄積する角速度から算出される姿勢よりも信頼できるものと考えられる。一方で、前回の算出タイミングで正しい姿勢が算出されている状態であった場合には、次の算出タイミングにおける姿勢の算出には、加速度よりも角速度を用いた方が正確な姿勢が算出されると考えられる。すなわち、角速度による姿勢算出は、タイミングごとの誤差は加速度による算出よりも小さいが、時間と共に誤差が増大する一方、加速度による姿勢算出は、タイミングごとの誤差は場合よっては大きい可能性もあるが、タイミングごとに算出可能であるので誤差が蓄積しないという特徴を持つ。したがって、第1補正手段では、第1の姿勢と第2の姿勢の両方を考慮した補正を行う。
FIG. 8 is a diagram illustrating correction of the first posture using the second posture. In this embodiment, the posture in the three-dimensional space is actually processed. However, in FIGS. 8 to 10, the posture in the two-dimensional plane will be described for easy understanding of the drawings. A vector G shown in FIG. 8A indicates a vertically downward direction defined in a spatial coordinate system based on a predetermined position in a space where the input device 8 exists, that is, a gravity direction. Also, the vector v1 shown in FIG. 8A is a spatial coordinate of the downward vector of the input device 8 when the
第1補正手段による補正は、上記第1の姿勢を第2の姿勢へと近づける補正である。つまり、第1補正手段は、上記角度θ1を上記角度θ2に近づける補正を行う。これは、ベクトルv1をベクトルv2’に近づける補正と表現してもよい。ただし、演算の過程上は、ベクトルv2がわかっていれば、ベクトルv2’自体は算出されなくとも補正は可能である。本実施形態では、上記補正は、補正量を示すベクトルv3を用いて行われる。図9は、補正量を示すベクトルv3を示す図である。図9に示すベクトルv3は、第1の姿勢を補正する補正量を示すベクトルである。具体的には、ベクトルv2に対してベクトルv3がなす角度Δθが、補正量となる。詳細は後述するが、ベクトルv3は、ベクトルGとベクトルv2との間に設定される(図9参照)。ベクトルv1をΔθだけ回転させることで、ベクトルv1が上述のベクトルv2’に近づくことになる。 The correction by the first correction means is correction that brings the first posture closer to the second posture. That is, the first correction unit performs correction to bring the angle θ1 close to the angle θ2. This may be expressed as a correction that brings the vector v1 closer to the vector v2 '. However, in the calculation process, if the vector v2 is known, the correction is possible even if the vector v2 'itself is not calculated. In the present embodiment, the correction is performed using a vector v3 indicating the correction amount. FIG. 9 is a diagram illustrating a vector v3 indicating the correction amount. A vector v3 illustrated in FIG. 9 is a vector indicating a correction amount for correcting the first posture. Specifically, an angle Δθ formed by the vector v3 with respect to the vector v2 is a correction amount. Although details will be described later, the vector v3 is set between the vector G and the vector v2 (see FIG. 9). By rotating the vector v1 by Δθ, the vector v1 approaches the vector v2 ′ described above.
第1補正処理は、第1の姿勢(ベクトルv1)を上記補正量だけ回転させることによって行われる。図10は、第1補正処理による補正後の第1の姿勢を示すベクトルを示す図である。図10に示すように、補正後の第1の姿勢(ベクトルv1’)は、補正前の第1の姿勢(ベクトルv1)を角度Δθだけ回転させることによって得られる。これによって、補正後の第1の姿勢を表す角度θ1’は、角度θ1と角度θ2との間となっており、上記角度θ1を上記角度θ2に近づける補正が行われたことがわかる。 The first correction process is performed by rotating the first posture (vector v1) by the correction amount. FIG. 10 is a diagram illustrating a vector indicating the first posture after the correction by the first correction process. As shown in FIG. 10, the corrected first posture (vector v1 ') is obtained by rotating the first posture before correction (vector v1) by an angle Δθ. As a result, the angle θ1 ′ representing the first posture after correction is between the angle θ1 and the angle θ2, and it can be seen that the correction for bringing the angle θ1 closer to the angle θ2 was performed.
なお、本実施形態においては、第1補正手段は、第1の姿勢を第2の姿勢へと近づける補正を行い、補正後の第1の姿勢を第2の姿勢と一致させていない。これは、加速度データが誤検出や激しい操作等の原因で急激に変化する場合であっても補正後の第1の姿勢が急激に変化しないようにするためである。ただし、他の実施形態においては、第1補正手段は、補正後の第1の姿勢を第2の姿勢と一致させるように補正を行ってもよい。また、詳細は後述するが、本実施形態においては、第1補正手段が第1の姿勢を第2の姿勢へと近づける割合は、加速度データにより示される加速度の大きさ(より具体的には、当該大きさと重力加速度の大きさとの差分)に応じて変化するように決められる。ただし、他の実施形態においては、上記割合を予め定められた固定値としてもよい。 In the present embodiment, the first correction unit performs correction to bring the first posture closer to the second posture, and does not match the corrected first posture with the second posture. This is to prevent the corrected first posture from changing suddenly even when the acceleration data changes suddenly due to erroneous detection or intense operation. However, in other embodiments, the first correction unit may perform correction so that the corrected first posture matches the second posture. Although details will be described later, in the present embodiment, the rate at which the first correction unit brings the first posture closer to the second posture is the magnitude of the acceleration indicated by the acceleration data (more specifically, It is determined so as to change according to the difference between the magnitude and the gravitational acceleration. However, in other embodiments, the ratio may be a predetermined fixed value.
(3)第2補正手段
第2補正手段は、撮像手段が撮像する所定の撮像対象の画像に基づいて第1の姿勢を補正する(後述するステップS6)。ここで、本実施形態においては、所定の撮像対象とは上記マーカ部6(の赤外LED)である。本実施形態では、第2補正手段は、上記第1の姿勢を第3の姿勢へと近づける補正を行う。第3の姿勢は、上記撮像対象の画像から算出される姿勢であり、具体的には、当該画像内での撮像対象の向きおよび/または位置から算出される入力装置8の姿勢である。以下、図11および図12を参照して、第2補正手段による補正処理(第2補正処理)を説明する。
(3) Second Correction Unit The second correction unit corrects the first posture based on a predetermined image to be captured that is captured by the imaging unit (step S6 described later). Here, in the present embodiment, the predetermined imaging target is the marker unit 6 (infrared LED). In the present embodiment, the second correction unit performs correction to bring the first posture closer to the third posture. The third posture is a posture calculated from the image to be imaged, and specifically, the posture of the input device 8 calculated from the orientation and / or position of the imaged object in the image. Hereinafter, the correction processing (second correction processing) by the second correction means will be described with reference to FIGS. 11 and 12.
図11は、第3の姿勢を用いた第1の姿勢の補正を示す図である。なお、本実施形態では、実際には3次元空間における姿勢を処理しているが、図11および図12では、図面をわかりやすくするために2次元平面における姿勢を用いて説明する。図11に示すベクトルv1は、空間座標系における第1の姿勢を示す。図11に示すベクトルv4は、空間座標系における第3の姿勢を示す。マーカ部6の位置や姿勢は予め定められているので、画像内での当該マーカの姿勢や位置によって、相対的に入力装置8の姿勢を算出することができる。第3の姿勢が正しい姿勢を表していることを前提とすれば、角速度から第1の姿勢が正しく算出されている場合には、第1の姿勢を示すベクトルv1は、第3の姿勢を示すベクトルv4と一致する。つまり、角速度から第1の姿勢が正しく算出されていない場合には、図11のように、第1の姿勢を示すベクトルv1と第3の姿勢を示すベクトルv4とが異なる。
FIG. 11 is a diagram illustrating the correction of the first posture using the third posture. In this embodiment, the posture in the three-dimensional space is actually processed. However, in FIG. 11 and FIG. 12, the posture in the two-dimensional plane will be described for easy understanding of the drawings. A vector v1 shown in FIG. 11 indicates the first posture in the spatial coordinate system. A vector v4 shown in FIG. 11 indicates the third posture in the spatial coordinate system. Since the position and orientation of the
第2補正処理は、第1の姿勢(ベクトルv1)を、第3の姿勢(ベクトルv4)に所定の割合で近づけることによって行われる。図12は、第2補正処理による補正後の第1の姿勢を示す図である。図12に示されるように、補正後の第1の姿勢(ベクトルv1’)は、補正前の第1の姿勢(ベクトルv1)を、第3の姿勢(ベクトルv4)に所定の割合で近づけることによって得られる。 The second correction process is performed by bringing the first posture (vector v1) closer to the third posture (vector v4) at a predetermined rate. FIG. 12 is a diagram illustrating the first posture after correction by the second correction processing. As shown in FIG. 12, the first posture after correction (vector v1 ′) brings the first posture before correction (vector v1) closer to the third posture (vector v4) at a predetermined rate. Obtained by.
ここで、入力装置8の姿勢や位置によっては撮像手段がマーカ部6を撮像することができない場合があり、この場合、第2補正手段は第2補正処理を行うことができない。したがって、仮に、第2補正手段が補正後の第1の姿勢を第3の姿勢と一致させるように補正を行うとすれば、第2補正処理を行うことができない状態から第2補正処理を行うことができる状態へと移行した際に、第1の姿勢が急激に変化してしまうおそれがある。このように第1の姿勢がプレイヤの意図に沿わずに急激に変化してしまうと、(たとえ補正後の姿勢が正確なものであったとしても)プレイヤは操作に違和感を抱いてしまう。このような急激な変化を防止するために、本実施形態では、第1の姿勢を第3の姿勢に所定の割合で近づけるように補正を行っている。これによって、第1の姿勢が急激に変化することを防止することができるので、プレイヤが操作に違和感を抱くことを防止することができる。ただし、撮像手段が常にマーカ部6を撮像することが可能な姿勢で入力装置8が使用されることが想定できる場合等、他の実施形態においては、第2補正手段は、補正後の第1の姿勢を第3の姿勢と一致させるように補正を行ってもよい。
Here, depending on the orientation and position of the input device 8, the imaging unit may not be able to capture the
なお、本実施形態では、ゲーム装置3は、第1補正処理と第2補正処理との両方を実行するが、他の実施形態においては、第1補正処理と第2補正処理とのいずれか一方のみを実行するようにしてもよい。また、本実施形態においては、ゲーム装置3は、第1補正処理を先に行い、第2補正処理を後に行うこととするが、第1補正処理と第2補正処理とのいずれを先に行うようにしてもよい。
In the present embodiment, the
以上のように、本実施形態によれば、ジャイロセンサ55および56によって検知された角速度から算出される入力装置8の姿勢を、加速度センサ37によって検知された加速度を用いて補正し、また、撮像手段による撮像画像を用いて補正する。これによって、ジャイロセンサから算出される姿勢の誤差を減少することができ、入力装置8の姿勢をより正確に算出することができる。
As described above, according to the present embodiment, the attitude of the input device 8 calculated from the angular velocities detected by the
なお、加速度センサ37の検出結果からは、重力方向を軸とした回転(ヨー方向の回転)を検知することはできないので、第1補正手段による補正は、ヨー方向に関しては行うことができない。しかし、加速度センサ37の検出結果を用いた補正は、入力装置8の姿勢がどのような姿勢であっても(常に加速度を検出することができるので)可能であるという特長を有する。一方、入力装置8の撮像方向にマーカ部6がなければマーカ座標が検出されないので、第2補正手段による補正は、入力装置8の姿勢によっては行うことができない。しかし、撮像画像を用いた補正は、姿勢(特にロール方向の姿勢)を正確に算出することができるという特長を有する。本実施形態においては、このように特長の異なる2種類の補正を行うことによって、入力装置8の姿勢をより正確に算出することができる。
In addition, from the detection result of the
[ゲーム装置3における処理の詳細]
次に、ゲーム装置3において実行される処理の詳細について説明する。まず、ゲーム装置3における処理において用いられる主なデータについて図13を用いて説明する。図13は、ゲーム装置3のメインメモリ(外部メインメモリ12または内部メインメモリ11e)に記憶される主なデータを示す図である。図13に示すように、ゲーム装置3のメインメモリには、ゲームプログラム60、操作データ62、およびゲーム処理用データ67が記憶される。なお、メインメモリには、図13に示すデータの他、ゲームに登場する各種オブジェクトの画像データや、オブジェクトの各種パラメータを示すデータ等、ゲーム処理に必要なデータが記憶される。
[Details of processing in game device 3]
Next, details of processing executed in the
ゲームプログラム60は、ゲーム装置3に電源が投入された後の適宜のタイミングで光ディスク4からその一部または全部が読み込まれてメインメモリに記憶される。ゲームプログラム60には、座標算出プログラム61が含まれる。座標算出プログラム61は、入力装置8の姿勢を算出し、算出された姿勢に基づいて(テレビ2の画面上における)2次元座標を算出する処理を実行するためのプログラムである。
A part or all of the
操作データ62は、コントローラ5からゲーム装置3へ送信されてくる操作データである。上述したように、コントローラ5からゲーム装置3へ1/200秒に1回の割合で操作データが送信されるので、メインメモリに記憶される操作データ62はこの割合で更新される。本実施形態においては、メインメモリには、最新の(最後に取得された)操作データのみが記憶されればよい。
The
操作データ62には、角速度データ63、加速度データ64、マーカ座標データ65、および操作ボタンデータ66が含まれる。角速度データ63は、ジャイロセンサユニット7のジャイロセンサ55および56によって検出された角速度を示すデータである。ここでは、角速度データ63は、図3に示すXYZの3軸回りのそれぞれの角速度を示す。また、加速度データ64は、加速度センサ37によって検出された加速度(加速度ベクトル)を示すデータである。ここでは、加速度データ64は、図3に示すXYZの3軸の方向に関する加速度を各成分とする3次元の加速度ベクトルVa1を示す。また、本実施形態においては、コントローラ5が静止している状態で加速度センサ37が検出する加速度ベクトルVa1の大きさを“1”とする。つまり、加速度センサ37によって検出される重力加速度の大きさは“1”である。
The
マーカ座標データ65は、撮像情報演算部35の画像処理回路41によって算出される座標、すなわち上記マーカ座標を示すデータである。マーカ座標は、撮像画像に対応する平面上の位置を表すための2次元座標系(図17に示すx’y’座標系)で表現される。なお、撮像素子40によって2つのマーカ6Rおよび6Lが撮像される場合には、2つのマーカ座標が算出される。一方、撮像素子40の撮像可能な範囲内にマーカ6Rおよび6Lのいずれか一方が位置しない場合には、撮像素子40によって1つのマーカのみが撮像され、1つのマーカ座標のみが算出される。また、撮像素子40の撮像可能な範囲内にマーカ6Rおよび6Lの両方が位置しない場合には、撮像素子40によってマーカが撮像されず、マーカ座標は算出されない。したがって、マーカ座標データ65は、2つのマーカ座標を示す場合もあるし、1つのマーカ座標を示す場合もあるし、マーカ座標がないことを示す場合もある。
The marker coordinate
操作ボタンデータ66は、各操作ボタン32a〜32iに対する入力状態を示すデータである。
The
ゲーム処理用データ67は、後述するゲーム処理(図14)において用いられるデータである。ゲーム処理用データ67は、第1姿勢データ68、加速度大きさデータ69、補正度データ70、補正量ベクトルデータ71、補正行列データ72、ロール姿勢成分データ73、ヨー姿勢成分データ74、ピッチ姿勢成分データ75、および第3姿勢データ76を含む。なお、図13に示すデータの他、ゲーム処理用データ67は、ゲーム処理において用いられる各種データ(ゲームパラメータを示すデータ等)を含む。
The
第1姿勢データ68は、角速度データ63を用いて算出される上記第1の姿勢を示すデータである。本実施形態では、第1の姿勢は、以下の式(1)に示す3×3の行列M1で表現される。
加速度大きさデータ69は、加速度データ64により示される加速度ベクトルVa1の大きさ(長さ)Lを示すデータである。
The
補正度データ70は、第2の姿勢を用いて第1の姿勢を補正する度合(補正度A)を示すデータである。補正度Aは、0≦A≦C1(C1は、0<C1≦1の所定の定数)の範囲を取り得る値である。詳細は後述するが、補正後の第1の姿勢は、補正度Aの値が大きいほど第2の姿勢に近くなる。
The
補正量ベクトルデータ71は、第1の姿勢を補正する補正量を示すベクトル(図9に示すベクトルv3。以下、補正量ベクトルと呼ぶ。)を示すデータである。補正量ベクトルVgは、上記加速度ベクトルVa1を上記xyz座標系で表したベクトルVa2と、上記補正度Aとに基づいて算出される。
The correction
補正行列データ72は、第1の姿勢を補正するために用いる回転行列(補正行列と呼ぶ)Maを示すデータである。つまり、第1補正処理においては、第1の姿勢を表す第1姿勢行列M1に補正行列Maを掛けることで第1の姿勢が補正される。補正行列Maは、上記ベクトルVa2と上記補正量ベクトルVgとに基づいて算出される。
The
ロール姿勢成分データ73は、上記撮像対象の画像から算出される第3の姿勢に含まれる姿勢成分のうち、ロール方向に関する姿勢成分(ロール姿勢成分)M3rを示すデータである。また、ヨー姿勢成分データ74は、上記第3の姿勢に含まれる姿勢成分のうち、ヨー方向に関する姿勢成分(ヨー姿勢成分)M3yを示すデータであり、ピッチ姿勢成分データ75は、上記第3の姿勢に含まれる姿勢成分のうち、ピッチ方向に関する姿勢成分(ピッチ姿勢成分)M3pを示すデータである。なお、ここで言うロール方向、ヨー方向、およびピッチ方向とは、入力装置8の撮像方向(Z軸正方向)を基準とした場合の回転方向である。本実施形態においては、各姿勢成分M3r、M3y、およびM3pは、第1の姿勢と同様、3×3の行列で表現される。
The roll
第3姿勢データ76は、上記撮像対象の画像から算出される第3の姿勢を示すデータである。本実施形態では、第3の姿勢は、第1の姿勢と同様、3×3の行列M3で表現される。以下では、第3の姿勢を示す行列M3を「第3姿勢行列M3」と呼ぶ。本実施形態では、入力装置8から操作データとしてマーカ座標データが送信されてくるので、第3姿勢行列M3は、マーカ座標データ65に基づいて算出される。具体的には、第3姿勢行列M3は、上記各姿勢成分M3r、M3y、およびM3pを合成することによって得られる。
The
次に、ゲーム装置3において行われる処理の詳細を、図14〜図17を用いて説明する。図14は、ゲーム装置3において実行される処理の流れを示すメインフローチャートである。ゲーム装置3の電源が投入されると、ゲーム装置3のCPU10は、図示しないブートROMに記憶されている起動プログラムを実行し、これによってメインメモリ等の各ユニットが初期化される。そして、光ディスク4に記憶されたゲームプログラムがメインメモリに読み込まれ、CPU10によって当該ゲームプログラムの実行が開始される。図14に示すフローチャートは、以上の処理が完了した後に行われる処理を示すフローチャートである。
Next, details of processing performed in the
まず、ステップS1において、CPU10は、ゲームに関する初期化処理を実行する。この初期化処理においては、ゲーム処理に用いられる各種パラメータの値が初期化されたり、仮想のゲーム空間が構築されたり、プレイヤオブジェクトや他のオブジェクトがゲーム空間の初期位置に配置されたりする。以上のステップS1の次にステップS2の処理が実行される。
First, in step S1, the
ステップS2において、CPU10は、初期姿勢設定処理が実行される。具体的には、プレイヤが所定の操作(例えば、Aボタン32dを押下する操作)を行ったことに応じて、入力装置8の第1の姿勢の初期姿勢として所定の値が設定される。ここでは、基準となる姿勢は、Z軸が鉛直方向と平行となり、かつ、入力装置8の撮像方向がマーカ部6の中央(マーカ6Rおよび6Lの中央)を向く姿勢としているので、プレイヤは、初期姿勢が上記基準となる姿勢となるように入力装置8を把持した状態で、上記所定の操作を行うことが望ましいが、入力装置が静止状態に近く、かつマーカ部を撮像可能であれば、初期姿勢を算出することが可能である。CPU10は、所定の操作が行われると、上記初期姿勢を表す行列を示すデータを第1姿勢データとしてメインメモリに記憶する。以上のステップS2の後、ステップS3〜S9の処理ループが、ゲームが実行される間繰り返し実行される。なお、1回の当該処理ループは、1フレーム時間(例えば1/60秒)に1回の割合で実行される。
In step S2, the
なお、本実施形態では、初期姿勢設定処理(ステップS2)は、ゲーム開始前(ステップS3〜S9の処理ループが実行される前)に1回実行されるのみであるとしたが、他の実施形態においては、ゲーム中における任意のタイミングで初期姿勢設定処理が実行されるようにしてもよい。すなわち、CPU10は、ゲーム中においてプレイヤが上記所定の操作を行ったことに応じて初期姿勢設定処理を実行するようにしてもよい。
In this embodiment, the initial posture setting process (step S2) is executed only once before the game starts (before the processing loop of steps S3 to S9 is executed). In the embodiment, the initial posture setting process may be executed at an arbitrary timing during the game. That is, the
ステップS3において、CPU10は操作データを取得する。すなわち、コントローラ5から送信されてくる操作データが無線コントローラモジュール19を介して受信される。そして、受信された操作データに含まれる角速度データ、加速度データ、マーカ座標データ、操作ボタンデータがそれぞれメインメモリに記憶される。ステップS3の次にステップS4の処理が実行される。
In step S3, the
ステップS4において、CPU10は、メインメモリに記憶されている角速度データ63に基づいて第1の姿勢を算出する。入力装置8の姿勢を角速度から算出する方法はどのような方法であってもよいが、本実施形態においては、第1の姿勢は、前回の第1の姿勢(前回の処理ループにおいて算出された第1の姿勢)と、今回の角速度(今回の処理ループにおいて取得された角速度)とを用いて算出される。具体的には、CPU10は、前回の第1の姿勢を今回の角速度で単位時間分回転させた姿勢を、第1の姿勢とする。なお、前回の第1の姿勢は、メインメモリに記憶されている第1姿勢データ68により示され、今回の角速度は、メインメモリに記憶されている角速度データ63により示されている。ステップS4で算出された姿勢(3×3の行列)を示すデータが、第1姿勢データ68としてメインメモリに新たに記憶される。上記ステップS4の次にステップS5の処理が実行される。
In step S4, the
ステップS5において、CPU10は前述した第1補正処理を実行する。第1補正処理は、加速度データを用いて第1の姿勢を補正する処理である。以下、図15を参照して、第1補正処理の詳細を説明する。
In step S5, the
図15は、図14に示す第1補正処理(ステップS5)の流れを示すフローチャートである。第1補正処理においては、まずステップS11において、CPU10は、加速度センサ37によって検出された加速度の大きさLを算出する。すなわち、メインメモリに記憶されている加速度データ64を読み出し、当該加速度データ64により示される加速度ベクトルVa1について大きさLを算出する。算出された大きさLを示すデータは加速度大きさデータ69としてメインメモリに記憶される。ステップS11の次にステップS12の処理が実行される。
FIG. 15 is a flowchart showing the flow of the first correction process (step S5) shown in FIG. In the first correction process, first, in step S <b> 11, the
ステップS12において、CPU10は、加速度センサ37によって検出された加速度の大きさが0であるか否かを判定する。すなわち、メインメモリに記憶されている加速度大きさデータ69を読み出し、当該加速度大きさデータ69により示される大きさLが0であるか否かを判定する。ステップS12の判定結果が否定である場合、ステップS13の処理が実行される。一方、ステップS12の判定結果が肯定である場合、以降のステップS13〜S21の処理がスキップされて、CPU10は第1補正処理を終了する。このように、本実施形態においては、加速度センサ37によって検出された加速度の大きさが0である場合には、当該加速度を用いた補正が行われない。これは、加速度の大きさが0である場合には加速度センサ37の検出結果から重力方向を算出できないということ、および、加速度ベクトルの大きさが0であれば以降のステップS13〜S21の処理が困難であることが理由である。
In step S12, the
ステップS13において、CPU10は、加速度センサ37によって検出された加速度ベクトルVa1を正規化する。すなわち、メインメモリに記憶されている加速度データ64を読み出し、当該加速度データ64により示される加速度ベクトルVa1を、大きさが1となるように補正する。CPU10は、正規化された加速度ベクトルVa1を示すデータをメインメモリに記憶しておく。ステップS13の次にステップS14の処理が実行される。
In step S <b> 13, the
ステップS14において、CPU10は、第1補正処理において第1の姿勢を補正する度合を示す上記補正度Aを算出する。補正度Aは、正規化される前の加速度ベクトルVa1の大きさLに基づいて算出される。具体的には、CPU10は、メインメモリに記憶されている加速度大きさデータ69を読み出す。そして、当該加速度大きさデータ69により示される大きさLを用いて、次の式(2)に従って補正度Aを算出する。
A=|L−1| …(2)
上式(2)で算出された補正度Aを示すデータは、補正度データ70としてメインメモリに記憶される。なお、上式(2)で算出された補正度Aは、最終的な値ではない演算中の値であって、以降のステップS16で値が変換されることによって、最終的な補正度Aの値が得られる。ステップS14の次にステップS15の処理が実行される。
In step S <b> 14, the
A = | L−1 | (2)
Data indicating the correction degree A calculated by the above equation (2) is stored as
ステップS15において、CPU10は、ステップS14で算出された補正度Aが所定値Rよりも小さいか否かを判定する。所定値Rは、予め定められており、例えば0.4に設定される。ここで、上述したように、本実施形態においては、加速度センサ37によって検出される重力加速度の大きさは“1”であり、また、補正度Aは加速度ベクトルVa1の大きさLと“1”との差の絶対値である(上式(2))。したがって、補正度Aが所定値R以上である場合とは、加速度ベクトルVa1の大きさLが重力加速度の大きさから所定値R以上離れている場合である。ステップS15の判定結果が肯定である場合、ステップS16の処理が実行される。一方、ステップS15の判定結果が否定である場合、以降のステップS16〜S21の処理がスキップされて、CPU10は第1補正処理を終了する。
In step S15, the
上記のように、本実施形態では、加速度センサ37によって検出される加速度の大きさLと重力加速度の大きさ(=1)との差が所定の基準(所定値R)よりも小さい場合にのみ補正が行われ、当該大きさLと重力加速度の大きさとの差が所定の基準以上である場合には補正が行われない。ここで、入力装置8が動かされている状態では、重力加速度以外に、入力装置8が動かされることによって生じる慣性による加速度が加速度センサ37によって検出されるので、検出される加速度ベクトルVa1の大きさLが“1”とは異なる値となり、入力装置8が激しく動かされている場合には、大きさLが“1”から大きく離れた値となる。したがって、上記大きさLと重力加速度の大きさとの差が所定の基準以上である場合とは、入力装置8が激しく動かされている場合であると推測される。一方、入力装置8が激しく動かされている場合には、加速度センサ37によって検出される加速度ベクトルVa1に重力加速度以外の成分(上記慣性による加速度の成分)が多く含まれているため、加速度ベクトルVa1の値は、重力方向を示す値としては信頼できないものと推測される。したがって、上記ステップS15の判定処理は、入力装置8が激しく動かされているか否か、換言すれば、加速度ベクトルVa1の値が重力方向を示す値としては信頼できるものであるか否かを判定する処理である。本実施形態においては、上記ステップS15の判定処理によって、加速度ベクトルVa1の値が重力方向を示す値としては信頼できない場合には補正を行わず、加速度ベクトルVa1の値が重力方向を示す値としては信頼できる場合にのみ補正を行うようにしている。これによって、重力方向を示す値としては信頼できない加速度ベクトルVa1を用いて第1の姿勢に対する補正が行われた結果、第1の姿勢が正しく補正されなくなることを防止することができる。
As described above, in the present embodiment, only when the difference between the acceleration magnitude L detected by the
ステップS16において、CPU10は、補正度Aの値を変換する。本実施形態では、補正度Aを、検出された加速度ベクトルVa1の大きさLが重力加速度の大きさに近いほど1に近くなるように、補正度Aを変換する。具体的には、CPU10は、メインメモリに記憶されている補正度データ70を読み出し、当該補正度データ70により示される補正度Aを、以下の式(3)〜(5)に従って変換する。
A2=1−(A1/R) …(3)
A3=A2×A2 …(4)
A4=A3×C1 …(5)
上式(3)〜(5)において、変数A1は変換前の補正度(メインメモリに現在記憶されている補正度データ70により示される値)であり、変数A4がステップS16において最終的に変換される補正度である。上式(3)は、変換前の補正度A1の大きさが重力加速度の大きさ(=1)に近いほど1に近くなるように変換後の補正度A2を得るための式である。上式(4)は、変換前の補正度A2が1に近いほど大きい重みが付されるように変換後の補正度A3を得るための式である。上式(5)は、補正量の大きさを調整するための式である。すなわち、定数C1は、定数C1の値が大きいほど補正量は大きくなる。定数C1は、予め定められ、0<C1≦1の範囲(例えば0.03)で設定される。以上の式(3)〜(5)による変換によって得られた補正度A4を示すデータが、新たな補正度データ70としてメインメモリに記憶される。上記ステップS16の次にステップS17の処理が実行される。
In step S16, the
A2 = 1- (A1 / R) (3)
A3 = A2 × A2 (4)
A4 = A3 × C1 (5)
In the above formulas (3) to (5), the variable A1 is the correction degree before conversion (value indicated by the
なお、本実施形態においては、上式(3)〜(5)による変換を行ったが、他の実施形態においては、上式(3)〜(5)のうち一部または全部の変換を省略してもよい。ただし、式の省略等によって、加速度ベクトルの値が信頼できるほど補正度の値が0に近くなるような演算となる場合には、後述するステップS18で用いる式(7)において、加速度ベクトルVa2と重力方向ベクトル(0,−1,0)とを入れ替える必要がある。 In the present embodiment, the conversions according to the above formulas (3) to (5) are performed. However, in other embodiments, some or all of the conversions in the above formulas (3) to (5) are omitted. May be. However, when the calculation is such that the value of the correction degree is close to 0 so that the value of the acceleration vector is reliable due to omission of the equation or the like, in the equation (7) used in step S18 described later, the acceleration vector Va2 It is necessary to replace the gravity direction vector (0, -1, 0).
ステップS17において、CPU10は、XYZ座標系で表現される加速度ベクトルVa1をxyz座標系の値Va2へと変換する。xyz座標系における加速度ベクトルVa2は、正規化された加速度ベクトルVa1を、前回のフレームにおいて得られた第1の姿勢を表す第1姿勢行列M1を用いて変換することによって算出される。すなわち、CPU10は、ステップS13においてメインメモリに記憶された(正規化された)加速度ベクトルVa1のデータと、第1姿勢データ68とを読み出す。そして、当該加速度ベクトルVa1と当該第1姿勢データ68により示される第1姿勢行列M1とを用いて、xyz座標系における加速度ベクトルVa2を算出する。より具体的には、正規化された加速度ベクトルVa1=(nx,ny,nz)とし、第1姿勢行列M1の各要素を上式(1)に示す変数とし、xyz座標系で表現される加速度ベクトルVa2=(vx,vy,vz)とすると、加速度ベクトルVa2は次の式(6)に従って算出される。
vx=Xx×nx+Yx×ny+Zx×nz
vy=Xy×nx+Yy×ny+Zy×nz
vz=Xz×nx+Yz×ny+Zz×nz …(6)
上式(6)に示されるように、加速度ベクトルVa2は、回転行列である第1姿勢行列M1によって加速度ベクトルVa1を回転させることによって得ることができる。ステップS17において算出された加速度ベクトルVa2はメインメモリに記憶される。上記ステップS17の次にステップS18の処理が実行される。
In step S17, the
vx = Xx * nx + Yx * ny + Zx * nz
vy = Xy * nx + Yy * ny + Zy * nz
vz = Xz * nx + Yz * ny + Zz * nz (6)
As shown in the above equation (6), the acceleration vector Va2 can be obtained by rotating the acceleration vector Va1 by the first posture matrix M1 that is a rotation matrix. The acceleration vector Va2 calculated in step S17 is stored in the main memory. Following step S17, the process of step S18 is executed.
ステップS18において、CPU10は、xyz座標系で表現される加速度ベクトルVa2と補正度Aとを用いて補正量ベクトルVgを算出する。補正量ベクトルVgは、上記ステップS16による変換後の補正度と、xyz座標系の鉛直下方向(重力方向)を示すベクトル(0,−1,0)とを用いて算出される。具体的には、CPU10は、メインメモリに記憶されている補正度データ70を読み出し、当該補正度データ70により示される補正度Aを用いて、以下の式(7)に従って補正量ベクトルVg=(gx,gy,gz)を算出する。
gx=(0−vx)×A+vx
gy=(−1−vy)×A+vy
gz=(0−vz)×A+vz …(7)
上式(7)に示されるように、補正量ベクトルVgは、加速度ベクトルVa2の終点から重力方向ベクトル(0,−1,0)の終点までを結ぶ線分をA:(1−A)に内分する点を終点とするベクトルである。したがって、補正量ベクトルVgは、補正度Aの値が大きいほど、重力方向ベクトルに近づくこととなる。CPU10は、上式(7)によって算出された補正量ベクトルVgを示すデータを、補正量ベクトルデータ71としてメインメモリに記憶する。上記ステップS18の次にステップS19の処理が実行される。
In step S18, the
gx = (0−vx) × A + vx
gy = (− 1−vy) × A + vy
gz = (0−vz) × A + vz (7)
As shown in the above equation (7), the correction amount vector Vg is a line segment connecting the end point of the acceleration vector Va2 to the end point of the gravity direction vector (0, -1, 0) as A: (1-A). It is a vector whose end point is a point to be internally divided. Accordingly, the correction amount vector Vg is closer to the gravity direction vector as the correction degree A is larger. The
ステップS19において、CPU10は、上記ステップS18で算出された補正量ベクトルVgを正規化する。すなわち、メインメモリに記憶されている補正量ベクトルデータ71を読み出し、当該補正量ベクトルデータ71により示されるベクトルを正規化する。そして、正規化されたベクトルを示すデータを新たな補正量ベクトルデータ71としてメインメモリに記憶する。なお、上記ステップS19で算出された補正量ベクトルVgが、図9に示すベクトルv3に相当する。上記ステップS19の次にステップS20の処理が実行される。
In step S19, the
ステップS20において、CPU10は、第1の姿勢を補正するための補正行列Maを算出する。補正行列Maは、xyz座標系で表現される加速度ベクトルVa2と、ステップS19において正規化された補正量ベクトルVgとに基づいて算出される。具体的には、CPU10は、ステップS17でメインメモリに記憶された加速度ベクトルVa2と、補正量ベクトルデータ71を読み出す。そして、上記加速度ベクトルVa2を補正量ベクトルVgと一致するように回転させる回転行列を算出し、算出された回転行列を補正行列Maとする。つまり、補正行列Maは、図9に示す角度Δθの回転を行う回転行列である。ステップS20で算出された補正行列Maを示すデータは、補正行列データ72としてメインメモリに記憶される。上記ステップS20の次にステップS21の処理が実行される。
In step S20, the
ステップS21において、CPU10は、第1の姿勢を示す第1姿勢行列M1を補正行列Maで補正する。具体的には、CPU10は、メインメモリに記憶されている第1姿勢データ68および補正行列データ72を読み出す。そして、当該第1姿勢データ68により示される第1姿勢行列M1を、当該補正行列データ72により示される補正行列Maによって変換する(第1姿勢行列M1と補正行列Maとの積を算出する)。変換後の第1姿勢行列M1が、補正された第1の姿勢を示すこととなる。つまり、ステップS21の処理は、図10に示すベクトルv1を角度Δθだけ回転させる処理に相当する。CPU10は、変換後の第1姿勢行列M1を示すデータを、新たな第1姿勢データ68としてメインメモリに記憶する。上記ステップS21の後、CPU10は第1補正処理を終了する。
In step S21, the
以上のように、第1補正処理においては、加速度センサ37によって検出された加速度ベクトルと、重力方向ベクトル(図8に示すベクトルG)との間に補正量ベクトルVgを算出し(ステップS18およびS19)、この補正量ベクトルVgにより表される補正量(補正行列Ma。図9に示す角度Δθ)だけ第1の姿勢を補正した(ステップS21)。これによって、ジャイロセンサ55および56から算出される第1の姿勢(図8に示すベクトルv1または角度θ1)を、加速度センサ37によって決められる第2の姿勢(図8に示す角度θ2)に近づける補正を行うことができる。かかる補正を行うことにより、より正確な値となるように第1の姿勢を補正することができる。
As described above, in the first correction process, the correction amount vector Vg is calculated between the acceleration vector detected by the
また、第1補正処理においては、加速度ベクトルVa1が信頼できる場合ほど(加速度ベクトルVa1の大きさLと重力加速度の大きさとの差が小さいほど)、補正度Aの値が大きくなり、その結果、第1の姿勢は第2の姿勢により近づくように補正される。つまり、加速度ベクトルVa1が信頼できる場合ほど、補正量が大きくなり、補正後の第1の姿勢に第2の姿勢が強く反映されることとなる。このように、本実施形態によれば、加速度センサベクトルVa1の信頼度に応じて第1補正処理における補正量が決まるので、補正量を当該信頼度に応じて適切に決定することができ、ひいては入力装置8の姿勢をより正確に算出することができる。 In the first correction process, as the acceleration vector Va1 is reliable (the smaller the difference between the magnitude L of the acceleration vector Va1 and the magnitude of gravitational acceleration), the value of the correction degree A increases. The first posture is corrected so as to be closer to the second posture. That is, the more reliable the acceleration vector Va1, the larger the correction amount, and the second posture is strongly reflected in the corrected first posture. As described above, according to the present embodiment, the correction amount in the first correction process is determined according to the reliability of the acceleration sensor vector Va1, and therefore the correction amount can be appropriately determined according to the reliability. The attitude of the input device 8 can be calculated more accurately.
なお、本実施形態においては、上記ステップS18で算出される補正量ベクトルVgは、加速度ベクトルVa2の終点から重力方向ベクトルの終点までを結ぶ線分をA:(1−A)に内分する点を終点とするベクトルであって、補正度Aの値が大きいほど重力方向ベクトルに近づくベクトルであった。ここで、他の実施形態において、補正度Aの算出方法によっては、補正量ベクトルVgは、重力方向ベクトルの終点と加速度ベクトルVa2の終点とを(1−A):Aに内分する点を終点とするベクトルであって、補正度Aの値が小さいほど重力方向ベクトルに近づくベクトルとしてもよい。このとき、上記ステップS20においては、上記補正量ベクトルVgを重力方向と一致するように回転させる回転行列を算出し、算出された回転行列を補正行列Maとすればよい。これによっても、本実施形態と同様に補正を行うことができる。 In the present embodiment, the correction amount vector Vg calculated in step S18 is a point that internally divides the line segment connecting the end point of the acceleration vector Va2 to the end point of the gravity direction vector into A: (1-A). Is the vector that approaches the gravity direction vector as the value of the correction degree A increases. In another embodiment, depending on the method of calculating the correction degree A, the correction amount vector Vg is a point that internally divides the end point of the gravity direction vector and the end point of the acceleration vector Va2 into (1-A): A. The end point vector may be a vector that approaches the gravity direction vector as the correction degree A is smaller. At this time, in step S20, a rotation matrix for rotating the correction amount vector Vg so as to coincide with the direction of gravity may be calculated, and the calculated rotation matrix may be used as the correction matrix Ma. This also makes it possible to perform correction as in the present embodiment.
図14の説明に戻り、ステップS5の次のステップS6において、CPU10は、前述した第2補正処理を実行する。第2補正処理は、マーカ座標データを用いて第1の姿勢を補正する処理である。以下、図16を参照して、第2補正処理の詳細を説明する。
Returning to the description of FIG. 14, in step S <b> 6 subsequent to step S <b> 5, the
図16は、図14に示す第2補正処理(ステップS6)の流れを示すフローチャートである。第1補正処理においては、まずステップS31において、CPU10は、入力装置8の撮像手段(撮像素子40)によってマーカ部6が撮像されているか否かを判定する。ステップS31の判定は、メインメモリに記憶されているマーカ座標データ65を参照することによって行うことができる。ここでは、マーカ座標データ65が2つのマーカ座標を示す場合、マーカ部6が撮像されていると判定し、マーカ座標データ65が1つのマーカ座標のみを示す場合、または、マーカ座標がないことを示す場合、マーカ部6が撮像されていないと判定する。ステップS31の判定結果が肯定である場合、以降のステップS32〜S37の処理が実行される。一方、ステップS31の判定結果が否定である場合、以降のステップS32〜S37の処理がスキップされ、CPU10は、第2補正処理を終了する。このように、撮像素子40によってマーカ部6が撮像されていない場合には、撮像素子40から得られるデータを用いて入力装置8の姿勢を算出することができないので、この場合には第2補正処理において補正は行われない。
FIG. 16 is a flowchart showing the flow of the second correction process (step S6) shown in FIG. In the first correction process, first, in step S <b> 31, the
ステップS32において、CPU10は、マーカ座標データに基づいてロール姿勢成分M3rを算出する。ロール姿勢成分M3rは、撮像画像内でのマーカ部6の向きに基づいて、すなわち、マーカ座標データ65により示される2つのマーカ座標を結ぶ線の傾きに基づいて算出される。以下、図17を参照して、ロール姿勢成分M3rの算出方法の例を説明する。
In step S32, the
図17は、撮像画像に対応する2次元座標を示す図である。図17に示されるように、本実施形態においては、撮像画像における位置を表すための2次元座標系(x’y’座標系)は、撮像画像の範囲を−1≦x’≦1、−1≦y’≦1で表すものとする。x’y’座標系は、入力装置8が基準姿勢(入力装置8の撮像方向がマーカ部6の中央を向き、かつ、コントローラ5のボタン面が鉛直上向きとなる姿勢)にある場合に、撮像画像において鉛直下向きがy’軸正方向となり、右向きがx’軸正方向となるように設定されるものとする。また、図17に示す点P1および点P2はマーカ座標の位置を示し、点P3は点P1と点P2との中点である。図17に示すベクトルv10は、点P1を始点とし、点P2を終点とするベクトルである。
FIG. 17 is a diagram illustrating two-dimensional coordinates corresponding to a captured image. As shown in FIG. 17, in the present embodiment, a two-dimensional coordinate system (x′y ′ coordinate system) for representing a position in a captured image has a range of the captured image of −1 ≦ x ′ ≦ 1, − 1 ≦ y ′ ≦ 1. The x′y ′ coordinate system captures images when the input device 8 is in a reference posture (an orientation in which the imaging direction of the input device 8 faces the center of the
ロール姿勢成分M3rを算出するために、CPU10はまず、マーカ座標データ65を読み出し、当該マーカ座標データ65により示される2つのマーカ座標から上記ベクトルv10を算出する。さらに、ベクトルv10を正規化したベクトル(hx,hy)を算出する。このベクトル(hx,hy)は、入力装置8が上記基準姿勢にある場合にx軸正方向を向き、入力装置8のロール方向の回転に応じて向きが変化する。ベクトル(hx,hy)がロール方向の姿勢に対応しているので、ロール姿勢成分M3rは、このベクトル(hx,hy)に基づいて算出することができる。具体的には、CPU10は、次の式(8)に従ってロール姿勢成分M3rを算出する。
ステップS33において、CPU10は、マーカ座標データに基づいてヨー姿勢成分M3yを算出する。ヨー姿勢成分M3yは、撮像画像内でのマーカ部6の向きおよび位置に基づいて算出される。以下、図17を参照して、ヨー姿勢成分M3yの算出方法の例を説明する。
In step S33, the
まず、CPU10は、マーカ座標データ65を読み出し、当該マーカ座標データ65により示される2つのマーカ座標の中点を算出する。本実施形態では、マーカ部6の位置として当該中点の位置を用いる。さらに、CPU10は、算出された中点の座標を、x’y’座標系の原点を中心として、入力装置8のロール方向に関する回転角度だけ(入力装置8の回転方向とは逆方向に)回転させた座標(px,py)を算出する。換言すれば、中点の座標は、原点を中心として、上記ベクトル(hx,hy)がx軸正方向を向くように回転される。入力装置8が水平方向(x軸方向)に関してマーカ部6と同じ位置(すなわち、マーカ部6の正面の位置)にあるとすれば、上記のようにして得られた回転後の座標(px,py)から、ヨー方向に関する姿勢を算出することができる。
First, the
次に、CPU10は、上記中点の回転後の座標(px,py)と、マーカ部6がx’軸方向の端に位置する場合のヨー方向の角度(限界角度)θy’とに基づいて、ヨー方向に関する回転角度θyを算出する。ここで、上記限界角度θy’と、上記限界角度θy1となる場合における上記中点の回転後のx座標値px’とは予め求めておくことができる。したがって、pxとpx’との比が、θyとθy’との比に等しくなることを用いて、ヨー方向に関する回転角度θyを算出することができる。具体的には、ヨー方向に関する回転角度θyは、次の式(9)によって算出することができる。
θy=px×θy’/px’ …(9)
なお、マーカ部6の水平方向の長さを無視する場合、上記限界角度θy’は、コントローラ5の画角の1/2とし、上記px’の値は“1”とすることができる。
Next, the
θy = px × θy ′ / px ′ (9)
When the horizontal length of the
最後に、CPU10は、上式(9)により算出された角度θyの回転を行う回転行列をヨー姿勢成分M3yとして算出する。具体的には、ヨー姿勢成分M3yは次の式(10)によって算出される。
ステップS34において、CPU10は、ロール姿勢成分M3rとヨー姿勢成分M3yとを合成する。すなわち、メインメモリからロール姿勢成分データ73およびヨー姿勢成分データ74を読み出し、各データ73および74により示されるロール姿勢成分M3rとヨー姿勢成分M3yとを積算する。ステップS34の次にステップS35の処理が実行される。
In step S34, the
ステップS35において、CPU10は、第1の姿勢に基づいてピッチ姿勢成分M3pを算出する。なお、本実施形態の処理とは異なるが、ピッチ姿勢成分M3pについても、ヨー姿勢成分M3yと同様の方法で、上記座標(px,py)のy座標値に基づいて算出することが可能である。ただし、上記座標(px,py)を用いてヨー方向(ピッチ方向)の姿勢を算出する方法は、入力装置8が水平方向(ピッチ方向の場合は鉛直方向)に関してマーカ部6と同じ位置にあることを前提として成り立つ方法である。本実施形態のゲームシステム1においては、プレイヤは、水平方向に関してマーカ部6(テレビ2)のほぼ正面の位置で入力装置8を操作すると考えられるので、「入力装置8が水平方向に関してマーカ部6と同じ位置にある」ことを前提して、上記ステップS33の方法によってヨー方向の姿勢を算出することが可能である。一方、プレイヤは、立って入力装置8を操作することも座って入力装置8を操作することも考えられ、また、マーカ部6の位置もテレビ2の画面の上側に配置されることも下側に配置されることも考えられる。そのため、本実施形態のゲームシステム1においては、「入力装置8が鉛直方向に関してマーカ部6と同じ位置にある」ことを必ずしも前提にできないため、上記座標(px,py)を用いてピッチ方向の姿勢を算出することを行わないようにしてもよい。
In step S35, the
そこで、本実施形態においては、ピッチ姿勢成分M3pについては、第1の姿勢をそのまま用いることとする(したがって、第2補正処理においては、ピッチ方向に関しては補正が行われない)。具体的には、CPU10は、メインメモリから第1姿勢データ68を読み出す。そして、第1姿勢データ68により示される第1姿勢行列M1の各要素を用いて、ピッチ方向に関する回転角度θpを、次の式(11)に従って算出する。
cos(θp)=(Zx×Zx+Zz×Zz)1/2
sin(θp)=Zy …(11)
上式(11)における変数Zx,Zy,Zzは、上式(1)において示した第1姿勢行列M1の要素である。なお、ここで用いられる第1姿勢行列M1は、今回の処理ループにおいて第1補正処理が行われた後の第1姿勢行列M1である。さらに、CPU10は、上式(11)で算出したcos(θp)およびsin(θp)を用いて、次の式(12)に従ってピッチ姿勢成分M3pの行列を算出する。
cos (θp) = (Zx × Zx + Zz × Zz) 1/2
sin (θp) = Zy (11)
Variables Zx, Zy, and Zz in the above equation (11) are elements of the first posture matrix M1 shown in the above equation (1). The first posture matrix M1 used here is the first posture matrix M1 after the first correction processing is performed in the current processing loop. Further, the
ステップS36において、CPU10は、ロール方向、ヨー方向、およびピッチ方向の各姿勢成分に基づいて第3の姿勢を算出する。第3の姿勢は、ロール姿勢成分M3rとヨー姿勢成分M3yとの合成結果に、ピッチ姿勢成分M3pをさらに合成することによって得られる。具体的には、CPU10は、メインメモリからピッチ姿勢成分データ75を読み出し、当該ピッチ姿勢成分データ75により示されるピッチ姿勢成分M3pを、ステップS34で算出された行列に積算する。算出された行列を示すデータは、第3姿勢データ76としてメインメモリに記憶される。ステップS36の次にステップS37の処理が実行される。
In step S36, the
ステップS37において、CPU10は、第3の姿勢を用いて第1の姿勢を補正する。ステップS37における補正は、第1姿勢行列M1を第3姿勢行列M3に所定の割合(下記の定数C2)で近づけることによって行われる。CPU10は、メインメモリから第1姿勢データ68および第3姿勢データ76を読み出す。そして、第1姿勢データ68により示される第1姿勢行列M1と、第3姿勢データ76により示される第3姿勢行列M3とを用いて、次の式(13)に従って補正を行う。
M1=(M3−M1’)×C2+M1’ …(13)
上式(13)において、変数M1’は補正前の第1姿勢行列である。また、定数C2は、0<C2≦1の範囲で予め設定され、例えば0.1に設定される。上式(13)によって算出された補正後の第1姿勢行列M1を示すデータが、新たな第1姿勢データ68としてメインメモリに記憶される。上記ステップS37の後、CPU10は第2補正処理を終了する。
In step S37, the
M1 = (M3-M1 ′) × C2 + M1 ′ (13)
In the above equation (13), the variable M1 ′ is the first posture matrix before correction. The constant C2 is preset in the range of 0 <C2 ≦ 1, and is set to 0.1, for example. Data indicating the corrected first posture matrix M1 calculated by the above equation (13) is stored in the main memory as new
以上のように、第2補正処理においては、撮像画像(マーカ座標)から第3の姿勢を算出し、第1の姿勢を第3の姿勢に近づけるように補正することとした。この補正によって、より正確な値となるように第1の姿勢を補正することができる。なお、本実施形態においては、ロール方向およびヨー方向の姿勢についてのみ撮像画像から第3の姿勢を算出したが、上述のように、ピッチ方向についても撮像画像から第3の姿勢を算出することは可能であり、他の実施形態においては、ロール方向、ヨー方向、およびピッチ方向について撮像画像から第3の姿勢を算出してもよい。また、第2補正処理においては、ロール方向、ヨー方向、およびピッチ方向のうち少なくとも1方向について第3の姿勢を算出すればよい。 As described above, in the second correction process, the third posture is calculated from the captured image (marker coordinates), and the first posture is corrected so as to approach the third posture. By this correction, the first posture can be corrected so as to have a more accurate value. In the present embodiment, the third posture is calculated from the captured image only for the posture in the roll direction and the yaw direction. However, as described above, the third posture is calculated from the captured image also in the pitch direction. In other embodiments, the third orientation may be calculated from the captured image in the roll direction, the yaw direction, and the pitch direction. In the second correction process, the third posture may be calculated in at least one of the roll direction, the yaw direction, and the pitch direction.
図14の説明に戻り、ステップS6の次のステップS7において、CPU10は、補正後の第1の姿勢に基づいて2次元座標を算出する。詳細は後述するが、本実施形態において上記2次元座標が、後述するゲーム処理(ステップS8)においてプレイヤによる入力として用いられる。以下、図18および図19を参照して、ステップS7の詳細を説明する。
Returning to the description of FIG. 14, in step S <b> 7 following step S <b> 6, the
図18は、所定の仮想空間に入力装置と所定の平面とを仮想的に配置した図である。本実施形態では、図18に示すように、CPU10は、3次元の仮想空間を定義し、入力装置8と所定の平面Qとが仮想的に配置されていると考えて座標の算出を行う。平面Qは、テレビ2の画面に対応するものである。CPU10は、仮想空間において入力装置8のZ軸(図18に示すZ軸ベクトルVZ)の方向が指し示す平面Q上の位置の座標を算出する。すなわち、仮想空間において入力装置8の姿勢を表すZ軸ベクトルVZを延ばした線分と、当該仮想空間における所定平面Qとの交点Rの座標を算出する。なお、「Z軸ベクトルVZを延ばした線分」とは、Z軸ベクトルVZに平行でかつZ軸ベクトルVZを通る線分を意味する。なお、詳細は後述するが、本実施形態では、算出された座標に対応する画面上の位置にカーソル等が表示される。これによって、入力装置8の姿勢に応じて画面上のカーソルの位置が制御され、プレイヤは入力装置8の姿勢を変化させる操作によってカーソルを動かすことが可能となる。
FIG. 18 is a diagram in which an input device and a predetermined plane are virtually arranged in a predetermined virtual space. In the present embodiment, as shown in FIG. 18, the
なお、図18に示すように、本実施形態では、上記仮想空間の位置を上述した空間座標系(xyz座標系)によって表現するものとする。これによって、入力装置8の姿勢を示すデータとして上記第1姿勢データ68をそのまま用いることができるので、仮想空間における計算を容易に行うことができる。また、平面Q上の位置をX’Y’座標系で表現するものとする。このとき、空間座標系のxy平面に平行となるように平面Qを設定し、空間座標系のx軸と平面QのX’軸が平行となり、空間座標系のy軸と平面QのY’軸が平行となるようにX’Y’座標系を設定する(図18)。
As shown in FIG. 18, in this embodiment, the position of the virtual space is expressed by the above-described spatial coordinate system (xyz coordinate system). As a result, the
また、本実施形態では、プレイヤは入力装置8をテレビ2の画面のほぼ正面の位置で使用する状況を想定し、上記仮想空間において入力装置8の位置は変化しないものとする。すなわち、CPU10は、上記仮想空間において入力装置8の姿勢のみが変化し、入力装置8の位置を変化させずに処理を行う。これによって、入力装置8の姿勢から平面Q上の位置(交点Rの位置)を一義的に決定することができる。
In the present embodiment, it is assumed that the player uses the input device 8 at a position substantially in front of the screen of the
次に、平面Q上の位置(交点Rの位置)を算出する方法について詳細に説明する。図19は、図18に示す仮想空間をy軸正方向側から負方向側へ見た図である。図19においては、入力装置8の位置を表す点Sから、当該点Sを平面Qに投影させた点(投影点)Tまでの長さを“L”とする。また、投影点Tから上記交点Rまでの、X’成分に関する長さを“Wx”とする。本実施形態では、上記長さLの値は、所定のタイミング(例えば、ゲーム処理が開始されるタイミング等)でプレイヤによって設定される。メインメモリには、プレイヤによって設定された長さLの値を示すデータ(長さデータと呼ぶ)が記憶される。 Next, a method for calculating the position on the plane Q (the position of the intersection R) will be described in detail. FIG. 19 is a view of the virtual space shown in FIG. 18 as viewed from the y-axis positive direction side to the negative direction side. In FIG. 19, the length from a point S representing the position of the input device 8 to a point (projection point) T obtained by projecting the point S onto the plane Q is “L”. The length from the projection point T to the intersection point R with respect to the X ′ component is “Wx”. In the present embodiment, the value of the length L is set by the player at a predetermined timing (for example, timing when game processing is started). The main memory stores data indicating the value of the length L set by the player (referred to as length data).
上記Z軸ベクトルVZは、入力装置8の姿勢(第1の姿勢)を表す第1姿勢行列M1により決められている。すなわち、上記Z軸ベクトルVZは、第1姿勢行列M1の第3行の各要素を順にx成分、y成分、およびz成分とするベクトル(=(Zx,Zy,Zz)である。また、図19から明らかなように、上記長さWxと上記長さLとの比は、Z軸ベクトルVZのx成分(Zx)とZ軸ベクトルVZのz成分(Zz)との比に等しくなるという関係がある。したがって、この関係に基づいて、既知のベクトルVZのx成分Zx、z成分Zz、および既知の長さLから、長さWxを算出することができる。具体的には、次の式(14)によって長さWxを算出することができる。
Wx=L×Zx/Zz …(14)
また、X’成分の長さWxと同様に、投影点Tから交点RまでのY’成分の長さWyは、次の式(15)によって算出することができる。
Wy=L×Zy/Zz …(15)
The Z-axis vector VZ is determined by a first posture matrix M1 that represents the posture of the input device 8 (first posture). That is, the Z-axis vector VZ is a vector (= (Zx, Zy, Zz)) in which each element of the third row of the first posture matrix M1 is in turn an x component, a y component, and a z component. As is clear from FIG. 19, the ratio between the length Wx and the length L is equal to the ratio between the x component (Zx) of the Z-axis vector VZ and the z component (Zz) of the Z-axis vector VZ. Therefore, based on this relationship, the length Wx can be calculated from the x component Zx, the z component Zz, and the known length L of the known vector VZ. The length Wx can be calculated by (14).
Wx = L × Zx / Zz (14)
Similarly to the length Wx of the X ′ component, the length Wy of the Y ′ component from the projection point T to the intersection R can be calculated by the following equation (15).
Wy = L × Zy / Zz (15)
上記長さWxおよびWyが得られれば、平面Q上における交点Rの位置を示す2次元座標を算出することができる。本実施形態では、上記投影点Tの位置をX’Y’座標系の原点とする。このとき、交点Rの2次元座標は(Wx,Wy)となる。 If the lengths Wx and Wy are obtained, two-dimensional coordinates indicating the position of the intersection point R on the plane Q can be calculated. In the present embodiment, the position of the projection point T is the origin of the X′Y ′ coordinate system. At this time, the two-dimensional coordinates of the intersection R are (Wx, Wy).
ステップS7における具体的な処理を説明すると、CPU10は、まずメインメモリから第1姿勢データ68および長さデータを読み出す。そして、第1姿勢データ68により示される第1姿勢行列M1に含まれるZx、Zy、およびZzと、長さデータにより示される長さLとを上式(14)および(15)に代入することによって上記長さWxおよびWyを算出する。これによって、平面Q上における交点Rの2次元座標(Wx,Wy)が得られたこととなる。CPU10は、2次元座標を示すデータをメインメモリ32に記憶する。ステップS7の次にステップS8の処理が実行される。
The specific processing in step S7 will be described. First, the
以上のように、上記ステップS7によれば、入力装置8と所定の平面Qとを配置する仮想空間を設定し、仮想空間において入力装置8の所定軸(Z軸)の方向が指し示す平面Q上の位置の座標を算出することによって、入力装置8の姿勢から2次元座標を得ることができる。 As described above, according to step S7 described above, a virtual space in which the input device 8 and the predetermined plane Q are arranged is set, and on the plane Q indicated by the direction of the predetermined axis (Z axis) of the input device 8 in the virtual space. 2D coordinates can be obtained from the attitude of the input device 8.
なお、上記実施形態においては、長さLをプレイヤが設定することができるようにした。ここで、上式(14)および(15)から明らかなように、長さLの大きさを調整することによって、算出される2次元座標(Wx,Wy)の値を変化させることができる。つまり、長さLの大きさを調整することによって、Z軸ベクトルVZの向きの変化(すなわち、入力装置8の姿勢の変化)に対する2次元座標(Wx,Wy)の変化量を調整することができる。具体的には、長さLの値が大きくなると上記変化量は大きくなる。その結果、入力装置8の姿勢を少し変化させるだけで、カーソルが大きく移動することになる。一方、長さLの値が小さくなると上記変化量は小さくなる。その結果、入力装置8の姿勢を大きく変化させても、カーソルは少ししか移動しないことになる。以上より、上記実施形態においては、長さLをプレイヤに設定させることによって、入力装置8の操作感をプレイヤ自身が調整することができるようになる。例えば、プレイヤは、カーソルを細かく操作することを必要とする場合には長さLを相対的に小さく設定すればよく、カーソルを大きく移動させる操作を必要とする場合には長さLを相対的に大きく設定すればよい。なお、他の実施形態においては、上記Lの長さは、予め定められた定数であってもよい。 In the above embodiment, the player can set the length L. Here, as is apparent from the above equations (14) and (15), the value of the calculated two-dimensional coordinates (Wx, Wy) can be changed by adjusting the length L. That is, by adjusting the length L, the amount of change in the two-dimensional coordinates (Wx, Wy) with respect to the change in the direction of the Z-axis vector VZ (that is, the change in the attitude of the input device 8) can be adjusted. it can. Specifically, the amount of change increases as the value of the length L increases. As a result, the cursor moves greatly only by slightly changing the attitude of the input device 8. On the other hand, as the value of the length L becomes smaller, the change amount becomes smaller. As a result, even if the posture of the input device 8 is greatly changed, the cursor moves only slightly. As described above, in the above embodiment, the player himself / herself can adjust the operational feeling of the input device 8 by causing the player to set the length L. For example, the player may set the length L relatively small when it is necessary to finely operate the cursor, and the length L is relatively set when an operation to move the cursor greatly is required. Should be set larger. In another embodiment, the length of L may be a predetermined constant.
また、他の実施形態においては、上記Lの長さは、ゲーム装置10が所定の方法で算出するようにしてもよい。例えば、CPU10は、入力装置8からテレビ2の画面までの実際の距離を算出し、算出された距離を長さLとして設定してもよい。上記実際の距離は、例えば、撮像素子40によって撮像された撮像画像内における2つのマーカ6Rおよび6Lの間の長さ、または、マーカ6Rまたは6Lの大きさを用いて算出することができる。さらに、仮想空間における平面Qの位置および大きさと実空間におけるテレビ2の画面の位置および大きさとを対応させるように平面Qを設定すれば(例えば、プレイヤにテレビの画面の大きさを設定させるようにしてもよい)、2次元座標(Wx,Wy)に対応するテレビ2の画面上の位置にカーソルが表示されることとなる。これによれば、入力装置8が指し示す(画面上の)位置にカーソルを表示させることができる。
In another embodiment, the length L may be calculated by the
なお、入力装置8を用いて2次元座標を得る方法として、上述したマーカ座標(図13に示すマーカ座標データ65)を用いて2次元座標を得ることができる。すなわち、入力装置8が指し示す位置に応じてマーカ座標が変化するので、入力装置8が指し示す画面上の位置をマーカ座標に基づいて算出することが可能である。したがって、マーカ部6が存在している状況であればマーカ座標を用いて上記2次元座標を算出可能である。しかしながら、マーカ部6が使用できない場合や、撮像素子が備えられていない入力装置では、マーカ部6の撮影によって2次元座標を得ることができない。本実施形態における方法は、入力装置8の撮像素子40がマーカ部6を撮影していない場合でも2次元座標を得ることができるので、マーカ部や撮像素子が無い入力装置においても使うことができるものである。
As a method for obtaining the two-dimensional coordinates using the input device 8, the two-dimensional coordinates can be obtained using the marker coordinates (marker coordinate
また、本実施形態においては、上記第1および第2補正処理による補正が行われた第1の姿勢に基づいて2次元座標を算出した。ここで、他の実施形態においては、2次元座標は、任意の方法で算出された入力装置8の姿勢に基づいて算出されればよく、上記第1および第2補正処理は行われなくてもよい。 In the present embodiment, the two-dimensional coordinates are calculated based on the first posture corrected by the first and second correction processes. Here, in another embodiment, the two-dimensional coordinates may be calculated based on the attitude of the input device 8 calculated by an arbitrary method, and the first and second correction processes may not be performed. Good.
また、上記実施形態では、プレイヤが入力装置8のZ軸方向をテレビ2の画面に向けて使用する態様を想定し、入力装置8のZ軸方向がテレビ2の画面(マーカ部6)を向く場合における当該Z軸方向に平面Qを配置した。ただし、上述のように、撮像素子40がマーカ部6を撮影していなくても2次元座標を得ることが可能であるので、プレイヤは、入力装置8のZ軸方向を任意の方向に向けて使用することが可能である。例えば、CPU10は、プレイヤが所定の操作(例えば操作ボタンを押す操作)を行ったことに応じて、当該所定の操作の時点における入力装置8のZ軸方向に上記平面Qを設定してもよい。これによれば、仮想空間内において入力装置8の向きに応じた適切な位置に平面Qを配置することができるので、当該所定の操作の時点において入力装置8がどのような向きであっても2次元座標を算出することができる。すなわち、プレイヤは、入力装置8を任意の方向に向けて使用することができる。
Moreover, in the said embodiment, the aspect which the player uses the Z-axis direction of the input device 8 toward the screen of the
なお、本実施形態では、ゲーム装置3は、入力装置8のZ軸方向が水平方向を向く場合に原点(0,0)を取るように2次元座標を算出する方法(第1の方法と呼ぶ)を採用した。ここで、ゲーム装置3は、上記第1の方法に代えて、後述する第2の方法によって2次元座標を算出してもよい。
In the present embodiment, the
図14の説明に戻り、ステップS7の次のステップS8において、CPU10は、ステップS7で算出された2次元座標を用いたゲーム処理を実行する。本実施形態では、ゲーム処理として、2次元座標に対応するテレビ2の画面上の位置にカーソルを表示させる処理が実行される。これによって、入力装置8の姿勢に対応した位置にカーソルを表示させることができ、プレイヤは、入力装置8の姿勢を変化させることによってカーソルを動かす操作が可能となる。なお、ステップS8におけるゲーム処理は、上記2次元座標を入力値としてゲーム結果に反映させる処理であればどのような処理であってもよい。例えば、仮想のゲーム空間内のオブジェクトを2次元座標に対応するゲーム空間内の位置に移動させる処理であってもよいし、上記2次元座標により表される2次元ベクトルの大きさおよび方向に応じた速度で上記オブジェクトを移動させるように制御して表示する処理であってもよい。ステップS8の次にステップS9の処理が実行される。
Returning to the description of FIG. 14, in step S8 following step S7, the
ステップS9において、CPU10は、ゲームを終了するか否かを判定する。ステップS9の判定は、例えば、ゲームがクリアされたか否か、ゲームオーバーとなったか否か、プレイヤがゲームを中止する指示を行ったか否か等によって行われる。ステップS9の判定結果が否定である場合、ステップS3の処理が再度実行される。以降、ステップS9でゲームを終了すると判定されるまで、ステップS3〜S9の処理ループが繰り返し実行される。一方、ステップS9の判定結果が肯定である場合、CPU10は、図14に示すゲーム処理を終了する。以上で、ゲーム処理の説明を終了する。
In step S9, the
以上のように、本実施形態においては、ジャイロセンサ55および56によって検出された角速度から入力装置8の第1の姿勢を算出し(ステップS4)、第1の姿勢を第1補正処理(S5)および第2補正処理(S6)によって補正した。そして、補正後の第1の姿勢を用いてゲーム処理を実行する(ステップS7,S8)ので、CPU10は、入力装置8の正確な姿勢に基づいたゲーム処理を実行することができる。これによれば、例えば、入力装置8の姿勢を画面上のカーソルの位置に対して正確に反映させることができるので、ゲーム操作の操作性を向上することができる。
As described above, in the present embodiment, the first posture of the input device 8 is calculated from the angular velocities detected by the
[座標を算出する第2の方法]
以下、図20〜図25を参照して、入力装置8の姿勢から画面上における位置を算出する第2の方法について説明する。なお、上記実施形態においては、上述した第1の方法に代えて以下に示す第2の方法を用いてゲーム処理を実行してもよい。また、以下の説明では、上記仮想空間における平面Q上の座標を「第1の座標」と呼び、第1の座標から算出される画面上の位置を表す座標を「画面座標」と呼び、マーカ座標から算出される画面上の位置を表す座標(詳細は後述する)を「第2の座標」と呼ぶ。
[Second method for calculating coordinates]
Hereinafter, the second method for calculating the position on the screen from the attitude of the input device 8 will be described with reference to FIGS. In the above embodiment, the game process may be executed using the following second method instead of the first method described above. In the following description, the coordinates on the plane Q in the virtual space are referred to as “first coordinates”, the coordinates representing the position on the screen calculated from the first coordinates are referred to as “screen coordinates”, and the marker The coordinates (details will be described later) representing the position on the screen calculated from the coordinates are referred to as “second coordinates”.
図20は、第1の方法と第2の方法との比較を示す図である。図20においては、実空間において、テレビ2の画面の中心よりも下方に入力装置8が位置し、入力装置8のZ軸方向が指す画面上の位置(以下、「(入力装置の)指示位置」と呼ぶ。)が画面の中心となる場合を例として考える(図20の上行左欄参照)。
FIG. 20 is a diagram showing a comparison between the first method and the second method. 20, in the real space, the input device 8 is positioned below the center of the screen of the
上述した第1の方法では、第1の座標の座標系(仮想空間における平面Q上のX’Y’座標系)は、入力装置8の位置を平面Qに投影させた投影点Tを常に原点Oとするものであった。つまり、第1の座標は、入力装置8のZ軸方向が水平方向を向く場合(Z軸方向が投影点Tを指す場合)に原点(0,0)の値を取るように算出された。したがって、図20に示すように入力装置8のZ軸方向がやや上方を向く場合には、第1の座標の位置Rは原点Oよりも上方になる(図20の上行中央欄参照)。その結果、第1の座標から算出される画面座標の位置Uは、画面の中心よりも上方となる(図20の上行右欄参照)。 In the first method described above, the coordinate system of the first coordinate (the X′Y ′ coordinate system on the plane Q in the virtual space) always has the projection point T obtained by projecting the position of the input device 8 on the plane Q as the origin. O. That is, the first coordinates are calculated so as to take the value of the origin (0, 0) when the Z-axis direction of the input device 8 is in the horizontal direction (when the Z-axis direction indicates the projection point T). Therefore, as shown in FIG. 20, when the Z-axis direction of the input device 8 is slightly upward, the position R of the first coordinate is above the origin O (see the upper middle column in FIG. 20). As a result, the position U of the screen coordinates calculated from the first coordinates is above the center of the screen (see the upper right column in FIG. 20).
図20に示す場合、第1の方法では、実際には(実空間では)入力装置8のZ軸方向は画面の中心を指しているのに対して、算出される画面上の位置は中心よりも上方の位置となってしまう。このように、第1の方法では、ユーザが入力装置8を用いて指し示した位置(入力装置の指示位置)と、算出される画面座標の位置との間にずれが生じてしまい、ユーザが違和感を抱くおそれがあった。 In the case shown in FIG. 20, in the first method, the Z-axis direction of the input device 8 actually points to the center of the screen (in real space), whereas the calculated position on the screen is from the center. Will also be in an upper position. As described above, in the first method, a deviation occurs between the position indicated by the user using the input device 8 (indicated position of the input device) and the position of the calculated screen coordinates, and the user feels uncomfortable. There was a risk of holding.
なお、実際には、テレビ2が設置される状況(床に置かれるのか、台の上に置かれるのか等)や、入力装置8を使用するユーザの状態(入力装置8を立って使用するのか、座って使用するのか等)等によって、画面に対する入力装置8の高さは様々であると考えられる。この高さが変化すれば、入力装置8の指示位置と姿勢との関係は変化し、入力装置8の指示位置が画面の中心となる場合における入力装置8の姿勢も変化する。しかし、第1の方法では、入力装置8の指示位置が考慮されずにX’Y’座標系の原点の位置を固定するために、画面上の位置を適切に算出することができず、入力装置8を用いた操作にユーザが違和感を抱くおそれがあった。
Actually, the situation in which the
そこで、第2の方法では、ゲーム装置3は、第1の方法で算出された第1の座標を、入力装置8のZ軸方向が画面の中心を指す姿勢である場合(指示位置が画面の中心となる場合)に所定値(具体的には、(0,0))となるように補正する。具体的には、ゲーム装置3は、まず、入力装置8のZ軸方向が画面の中心を指す姿勢となったか否かを判定する。この判定は、上述したマーカ座標を参照することで行うことができる。すなわち、ゲーム装置3は、画面上における上記指示位置を示す座標(第2の座標)をマーカ座標に基づいて算出し、第2の座標が画面の中心(中心付近)を表すか否かを判定する。
Therefore, in the second method, the
上記の判定の結果、第2の座標が画面の中心となった場合、ゲーム装置3は、第1の座標を補正するための補正量(オフセット量)を決定する。オフセット量は、第2の座標が画面の中心となった時点において(第1の方法で)算出された第1の座標に対応する画面座標の位置と、第2の座標の位置とが一致するように決定される。具体的には、オフセット量は、当該時点における第1の座標が原点の値(0,0)となるような補正量に決定される。なお、上記オフセット量を決定することは、平面Q上のX’Y’座標系を移動することを意味する。図20の例においては、入力装置8が水平方向よりも上方を向いているので、X’Y’座標系は、平面Q上において、投影点Tが原点となる位置(図20に示す点線の位置)から上方へ移動するように移動される(図20の下行中央欄参照)。以上のように第1の座標を原点の値とする結果、第1の座標に対応する画面上の位置Uは、画面の中心位置となる(図20の上行右欄参照)。したがって、入力装置8の指示位置(第2の座標の位置)と、算出される画面上の位置とが画面の中心で一致することになる。このように、第2の方法によれば、ユーザが入力装置8を用いて指した位置と、算出される位置との間のずれが生じることを防止することができ、ユーザが違和感を抱くことを防止することができる。
As a result of the above determination, when the second coordinate is the center of the screen, the
また、本実施形態においては、ゲーム装置3は、X’Y’座標系のY’成分についてのみ第1の座標の補正を行う。つまり、第1の座標(および画面座標)は、画面の上下方向にのみ補正され、左右方向については補正されない。本実施形態では、画面に対する入力装置8の高さ(上下方向の位置)に関しては、入力装置8の姿勢のみからでは判別することができないのに対して、画面に対する入力装置8の左右方向の位置に関しては、入力装置8の姿勢のみからでも判別することができ、左右方向に関しては図20で説明したような「ずれ」は生じないからである。ただし、他の実施形態においては、左右方向に関しても上下方向と同じように第1の座標を補正するようにしてもよい。
In the present embodiment, the
次に、図21〜図25を参照して、第2の方法を採用する場合においてゲーム装置3が実行する処理の詳細について説明する。図21は、第2の方法を採用する場合においてゲーム装置3のメインメモリに記憶される主なデータを示す図である。なお、図21において、図13に示すデータと同じデータについては、図13と同じ参照符号を付し、詳細な説明を省略する。
Next, with reference to FIGS. 21 to 25, details of processing executed by the
図21に示すように、第2の方法においては、図13に示すデータに加えて、第1座標データ77、第2座標データ78、オフセット量データ79、および画面座標データ80がメインメモリに記憶される。
As shown in FIG. 21, in the second method, in addition to the data shown in FIG. 13, first coordinate
第1座標データ77は、入力装置8の姿勢に基づいて算出される上記第1の座標を示す。すなわち、第1座標データ77は、上記仮想空間における平面Q上の位置の座標を示す。
The first coordinate
第2座標データ78は、マーカ座標に基づいて算出される、画面上の位置を表す座標(第2の座標)を示す。第2の座標は、入力装置8のZ軸方向が指し示す画面上の位置を表すものである。第2の座標は、理想的には、入力装置8のZ軸を延ばした直線と画面との交点の位置を表すものであるが、当該交点の位置付近を表すものであればよい。
The second coordinate
オフセット量データ79は、第1の座標を補正するためのオフセット量を示す。本実施形態では、第1の方法で算出された第1の座標をオフセット量だけ移動した座標が、補正後の第1の座標となる。
The offset
画面座標データ80は、第1の座標に基づいて算出される、画面上の位置を表す座標(画面座標)を示す。第2の方法では、画面座標は、オフセット量に従って補正された後の第1の座標に基づいて算出される。
The screen coordinate
図22は、第2の方法を採る場合においてゲーム装置3が実行する処理の流れを示すメインフローチャートである。なお、図22において、図14に示す処理ステップと同じ処理ステップについては、図13と同じステップ番号を付し、詳細な説明を省略する。
FIG. 22 is a main flowchart showing a flow of processing executed by the
第2の方法を採用する場合には、ステップS2の初期姿勢設定処理の次に、ステップS41の処理が実行される。ステップS41において、CPU10は、オフセット決定処理を実行する。オフセット決定処理は、第1の座標を補正するためのオフセット量を決定する処理である。以下、図23を参照して、オフセット決定処理の詳細を説明する。
When the second method is adopted, the process of step S41 is executed after the initial posture setting process of step S2. In step S41, the
図23は、図22に示すオフセット決定処理(ステップS41)の流れを示すフローチャートである。オフセット決定処理においては、まずステップS51において、CPU10は操作データを取得する。ステップS51の処理は、上述したステップS3の処理と同じである。ステップS51の次にステップS52の処理が実行される。
FIG. 23 is a flowchart showing the flow of the offset determination process (step S41) shown in FIG. In the offset determination process, first, in step S51, the
ステップS52において、CPU10は、入力装置8の指示位置を表す第2の座標を算出する。第2の座標は、ステップS51で取得されたマーカ座標に基づいて算出される。すなわち、CPU10は、メインメモリからマーカ座標データ65を読み出し、マーカ座標に基づいて第2の座標を算出する。マーカ座標から第2の座標を算出する方法は、どのような方法であってもよい。例えば、上述したステップS33で算出する座標(px,py)をマーカ座標から算出し、当該座標(px,py)に基づいて第2の座標を算出することが可能である。具体的には、座標(px,py)のx成分の正負を反転させて所定の割合(例えば、撮像画像のx軸方向の長さを、テレビ2の画面の横方向の長さに一致させる割合)でスケーリングすることによって、画面の横方向に関する指示位置を得ることができる。また、座標(px,py)のy成分の正負を反転させて所定の割合(例えば、撮像画像のy軸方向の長さを、テレビ2の画面の縦方向の長さに一致させる割合)でスケーリングすることによって、画面の縦方向に関する指示位置を得ることができる。なお、縦方向に関しては、マーカ部6がテレビ2の上方に設置されるか下方に設置されるかに応じて、オフセット量を適宜設定することが好ましい。なお、CPU10は、算出した第2の座標を示すデータを第2座標データ78としてメインメモリに記憶させる。以上のステップS52の次にステップS53の処理が実行される。
In step S <b> 52, the
ステップS53において、CPU10は、入力装置8の第1の姿勢を算出する。ステップS53の処理は、上述したステップS4〜S6の処理と同様である。なお、本実施形態では、第1の姿勢を算出する処理を毎フレーム(ステップS51〜S58の処理ループ毎に)実行することとするが、当該処理は、ステップS54の判定結果が肯定となる時点でのみ実行されてもよい。ステップS53の次にステップS54の処理が実行される。
In step S <b> 53, the
ステップS54において、CPU10は、所定の設定画面とカーソルとをテレビ2の画面に表示させる。設定画面は、ユーザが所定の指示を行うためのボタン画像を含む画面である。図24は、設定画面の一例を示す図である。図24においては所定の指示は、カーソルの速度調整(感度調整)を行う指示であり、カーソルの速度を上げる指示を表すボタン画像81と、カーソルの速度を下げる指示を表すボタン画像82とが表示される。なお、ここで調整対象となるカーソルは、現在表示されているカーソル83ではなく、後のゲーム操作で用いる、第1の座標(画面座標)に基づいて位置が決定されるカーソルである。また、上記所定の指示の内容はどのようなものであってもよく、カーソルに関する他の調整(例えば、入力装置8の操作に対するカーソルの追従性の調整や、カーソルに設定される遊びの調整や、手ぶれ防止機能の調整等)を行うための指示であってもよいし、設定画面での設定操作を終了する指示であってもよいし、ゲームを開始する指示であってもよい。
In step S <b> 54, the
また、テレビ2の画面には、上記設定画面とともにカーソル83が表示される。すなわち、CPU10は、メインメモリから第2座標データ78を読み出し、第2の座標データ78が示す位置にカーソル83を表示させる。このように、ステップS54で表示されるカーソル83の位置は、マーカ座標に基づいて算出されるものであり、カーソル83はマーカ座標に基づく方法で制御されるものである。なお、図23では示していないが、CPU10は、上記ボタン画像81または82が指定された(カーソル83がボタン画像を指し示す状態で入力装置8の所定のボタンが押下された)場合に、指定されたボタン画像に応じた調整処理を行う。上記ステップS54の次に、ステップS55の処理が実行される。
A
図23の説明に戻り、ステップS55において、CPU10は、カーソル83が画面の上下方向に関して中央に位置しているか否かを判定する。この判定は、第2の座標を用いて行うことができる。具体的には、CPU10は、メインメモリから第2座標データ78を読み出し、第2座標データ78が示す位置が上記ボタン画像81または82の表示領域内であるか否かを判定する。つまり、CPU10は、上記ボタン画像81または82の表示領域内にカーソル83が位置しているか否かを判定する。ステップS55の判定結果が肯定である場合、ステップS56の処理が実行される。一方、ステップS55の判定結果が否定である場合、ステップS56およびS57の処理がスキップされて、後述するステップS58の処理が実行される。
Returning to the description of FIG. 23, in step S55, the
なお、上記ステップS55では、第2の座標(カーソル83)が厳密に画面の中心に位置しているか否かを判定するのではなく、中心付近に(ボタン画像の表示領域内に)第2の座標が位置しているか否かを判定している。これは、本発明では、ユーザに違和感を与えないようにすることが目的であり、入力装置の指示位置と画面座標の位置とを厳密に一致させる必要はないからである。また、ステップS55において第2の座標が画面の中心に位置するか否かを厳密に判定すると、ステップS55の判定結果が肯定となる可能性が低くなり、オフセット量が決定されなくなる可能性があるからである。 In step S55, it is not determined whether or not the second coordinate (cursor 83) is strictly located at the center of the screen, but the second coordinate is located near the center (within the button image display area). It is determined whether or not the coordinates are located. This is because the object of the present invention is to prevent the user from feeling uncomfortable, and it is not necessary to exactly match the indicated position of the input device and the position of the screen coordinates. Further, if it is strictly determined whether or not the second coordinate is located at the center of the screen in step S55, the determination result in step S55 is less likely to be affirmative, and the offset amount may not be determined. Because.
ステップS56において、CPU10は、第1の姿勢に基づいて第1の座標を算出する。ステップS56における算出処理は、上述したステップS7の算出処理と同じである。すなわち、CPU10は、ステップS53で算出された第1の姿勢に基づいて、上記第1の方法に従って第1の座標を算出する。算出された第1の座標は、第1座標データ77としてメインメモリ32に記憶される。ステップS56の次にステップS57の処理が実行される。
In step S56, the
ステップS57において、CPU10は、ステップS56で算出された第1の座標に基づいてオフセット量を決定する。図25は、オフセット量の決定方法を示す図である。なお、図25で示す入力装置8の姿勢は、入力装置8の指示位置が画面の上下方向に関して中央となった時点(ステップS55の判定結果がYesとなった時点)における姿勢である。また、原点Oは、第1の方法におけるX’Y’座標系の原点であり、上述した投影点Tの位置である。また、点Rは、ステップS56で算出された第1の座標の位置を示す。
In step S57, the
オフセット量は、上記時点における第1の座標のY’成分が原点の値(0)となるように決定される。すなわち、上下方向に関して、第1の座標の位置Rが原点の位置となるように決定される。したがって、オフセット量は、第1の座標のY’成分の値dの正負を反転した値“−d”に決定される(図25参照)。CPU10は、第1座標データ77をメインメモリから読み出し、第1座標データ77により示される第1の座標のY’成分の正負を反転した値をオフセット量として決定する。決定されたオフセット量を示すデータは、オフセット量データ79としてメインメモリに記憶される。なお、後述する第1の座標の補正処理(ステップS42)では、第1の方法で算出された第1の座標が上記オフセット量だけ移動した座標へと補正される。したがって、ステップS57のオフセット量を算出する処理は、X’Y’座標系をオフセット量だけ(オフセット量の符号を反転させた方向へ)移動させる処理と言うことができる。以上のステップS57の次にステップS58が実行される。
The offset amount is determined so that the Y ′ component of the first coordinate at the time point becomes the origin value (0). That is, with respect to the vertical direction, the position R of the first coordinate is determined to be the position of the origin. Therefore, the offset amount is determined to be a value “−d” obtained by inverting the sign of the value d of the Y ′ component of the first coordinate (see FIG. 25). The
ステップS58において、CPU10は、設定画面を終了するか否かを判定する。ステップS58の判定は、例えば、ユーザが設定画面を終了する指示を行ったか否かによって行われる。ステップS58の判定結果が否定である場合、ステップS51の処理が再度実行される。以降、ステップS58の判定結果が肯定であるまで、ステップS51〜S58の処理が繰り返し実行される。一方、ステップS58の判定結果が肯定である場合、CPU10はオフセット決定処理を終了する。
In step S58, the
以上のように、オフセット決定処理においては、入力装置8が画面の(上下方向に関して)中央を指し示す時点で算出される第1の座標のY’成分が原点の値(0)となるように、オフセット量が決定される。ここで、オフセット決定処理においてオフセット量を決定するためには、入力装置8が画面の(上下方向に関して)中央を指し示す状態が生じなければならない。本実施形態では、このような状態を生じさせるべく、所定の指示を行うためのボタン画像81および82を画面の(上下方向に関して)中央に表示させるようにしている(図24)。これによれば、ユーザは、所定の指示を行うために、上記状態となるように入力装置8を自然に操作するので、オフセット量の決定操作をユーザに意識させることなく自然に行わせることができる。なお、上記所定の指示は、どのような指示であってもよいが、オフセット量を決定する処理が確実に実行されるようにするため、ユーザが必ず1回は行う指示(例えば、設定画面を終了する指示や、ゲームを開始する指示等)であることが好ましい。また、本実施形態のように、上記所定の指示として、カーソルの調整に関する指示を行わせることによって、カーソルの調整と同時にオフセット量を決定することができる。これによれば、「(オフセット量を決定するために)余計な操作を行っている」という感覚をユーザに与えることなく、オフセット量を決定することができる。
As described above, in the offset determination process, the Y ′ component of the first coordinate calculated when the input device 8 points to the center of the screen (with respect to the vertical direction) is set to the origin value (0). An offset amount is determined. Here, in order to determine the offset amount in the offset determination process, a state in which the input device 8 points to the center (with respect to the vertical direction) of the screen must occur. In the present embodiment, in order to cause such a state,
図22の説明に戻り、ステップS41のオフセット決定処理の次に、上述した実施形態と同様のステップS3の処理が実行される。さらに、ステップS3の次に、上述した実施形態と同様のステップS4〜S7の処理が実行される。なお、ステップS7の処理は、第1の方法で第1の座標を算出する処理である。第2の方法では、ステップS7の処理の次にステップS42の処理が実行される。 Returning to the description of FIG. 22, after the offset determination process of step S <b> 41, the process of step S <b> 3 similar to the above-described embodiment is executed. Further, after step S3, the same processes of steps S4 to S7 as in the above-described embodiment are executed. Note that the process of step S7 is a process of calculating the first coordinates by the first method. In the second method, the process of step S42 is executed after the process of step S7.
ステップS42において、CPU10は、ステップS7で算出された第1の座標をオフセット量に従って補正する。すなわち、CPU10は、第1座標データ77およびオフセット量データ78をメインメモリから読み出し、第1の座標を、Y’成分にオフセット量Dを加算した値へと補正する。補正後の第1の座標を示すデータは、新たな第1座標データ77としてメインメモリに記憶される。
In step S42, the
なお、本実施形態では、第1の方法による第1の座標の算出処理(ステップS7)と、第1の座標の補正処理(ステップS42)とを別々の処理として記載したが、CPU10は、これら2つの処理をまとめて実行してもよい。すなわち、ステップS7において、CPU10は、上式(15)に代えて、以下の式(16)に従って第1の座標を算出してもよい。
Wy=L×Zy/Zz+D …(16)
上式(16)において、変数Dは、オフセット量を示し、上記ステップS56で算出された第1の座標のY’成分(d)の符号を反転させた値(−d)である。上式(16)を用いる場合、補正処理を含めた形で第1の座標を算出することができる。
In the present embodiment, the first coordinate calculation process (step S7) by the first method and the first coordinate correction process (step S42) are described as separate processes. However, the
Wy = L × Zy / Zz + D (16)
In the above equation (16), the variable D indicates an offset amount and is a value (−d) obtained by inverting the sign of the Y ′ component (d) of the first coordinate calculated in step S56. When the above equation (16) is used, the first coordinates can be calculated in a form including correction processing.
ステップS42の次にステップS43およびS44の処理が実行される。ステップS43およびS44の処理は、上述したステップS8の処理と同様であるが、図22ではステップS8の処理を2つに分けてステップS43およびS44として説明を行う。 Following step S42, the processes of steps S43 and S44 are executed. The process of steps S43 and S44 is the same as the process of step S8 described above, but in FIG. 22, the process of step S8 is divided into two and will be described as steps S43 and S44.
ステップS43において、CPU10は、テレビ2の画面上の位置を表す座標(画面座標)を算出する。画面座標は、ステップS42で補正された第1の座標に基づいて算出される。すなわち、CPU10は、第1座標データ77をメインメモリから読み出し、第1座標データ77により示される第1の座標に基づいて画面座標を算出する。画面座標は、第1の座標が原点の値(0,0)となる場合に画面の中心となるように算出される。また、画面座標は、画面の中心から画面座標への方向が、原点から第1の座標への方向に対応する方向となり、画面の中心から画面座標までの長さが、原点から第1の座標までの長さに対応する長さとなるように算出される。したがって、入力装置8のZ軸を画面の中心に向けた状態では、画面座標は画面の中心を表し(画面座標と指示位置とが一致し)、当該状態から入力装置8のZ軸の向きを変化させた方向に応じた方向へ画面座標が移動することになる。以上のようにして算出された画面座標を示すデータは、画面座標データ80としてメインメモリに記憶される。ステップS43の次にステップS44の処理が実行される。
In step S <b> 43, the
ステップS44において、CPU10は、ステップS43で算出された画面座標を用いたゲーム処理を行う。ステップS43におけるゲーム処理は、上記画面座標に基づく処理であればどのような処理であってもよい。例えば、画面座標の位置にカーソルやゲームのオブジェクトを表示させる処理でもよいし、オブジェクトの位置と画面座標との位置関係に応じてオブジェクトを移動させる処理でもよい。なお、画面座標に何らかの画像が表示される場合には、ユーザが画面座標の位置を視認することができるので、第1の方法では上述したような違和感を抱く可能性が高い。したがって、このような場合には第2の方法が特に有効である。ステップS44の次に、上記実施形態と同様のステップS9の処理が実行される。以上で、第2の方法の説明を終了する。
In step S44, the
以上のように、第2の方法においては、ゲーム装置3は、設定画面を表示する際に、入力装置8が画面の上下方向に関して中央を指し示している状態を検知し(ステップ54)、その状態における第1の座標を用いてオフセット量を決定する(ステップS57)。そして、その後のゲーム処理においては、第1の方法で算出された第1の座標を上記オフセット量に従って補正する(ステップS42)。したがって、入力装置8が画面の上下方向に関して中央を指し示している状態では、第1の座標のY’成分は0となり、その結果、画面座標は、上下方向に関して画面の中央の位置を表すことになる。したがって、第2の方法によれば、ユーザが入力装置8で画面の中心を指している場合には画面座標は画面の中心を表すことになるので、ユーザに違和感を与えることなく、画面座標を適切に算出することができる。
As described above, in the second method, when the
なお、上記実施形態においては、指示位置が画面の中心となる場合には、画面座標の位置と指示位置とが一致する。一方、指示位置がその他の位置となる場合には、上記長さL等によっては、必ずしも画面座標の位置と指示位置とは一致しない。これは、画面の中心において画面座標の位置と指示位置とが一致していれば、ユーザはほとんど違和感を感じないと考えられ、上記その他の位置で画面座標の位置と指示位置とが異なることによるデメリットはほとんどないからである。また、入力装置8の姿勢に応じて画面座標を決定するメリット(姿勢の変化に対する画面座標の変化の度合を適宜設定できるメリット)が上記デメリットよりも大きいと考えられるからである。 In the above embodiment, when the designated position is the center of the screen, the position of the screen coordinates matches the designated position. On the other hand, when the designated position is another position, the position of the screen coordinates does not necessarily match the designated position depending on the length L or the like. This is because if the position of the screen coordinates and the designated position coincide with each other at the center of the screen, the user will hardly feel any sense of incongruity, and the position of the screen coordinates differs from the designated position at the other positions. This is because there are almost no disadvantages. Further, it is considered that the merit of determining the screen coordinates in accordance with the attitude of the input device 8 (the merit that the degree of change of the screen coordinates with respect to the attitude change can be appropriately set) is larger than the above demerit.
なお、入力装置8が画面の中央を指し示す時点における姿勢を基準姿勢とした場合、当該時点における原点を決定する処理、換言すれば、第1の座標が原点を取るときの入力装置8の姿勢を決定する処理であるステップS57の処理は、「基準姿勢を決定する処理」であると言える。また、原点から補正後の第1の座標への方向は、上記基準姿勢から現在の姿勢までの変化の向き(回転方向)に対応し、原点から補正後の第1の座標までの距離は、上記基準姿勢から現在の姿勢までの変化量(回転量)に対応する。したがって、補正後の第1の座標を算出する処理(ステップS7およびステップS742)は、「上記基準姿勢から現在の姿勢までの変化の向きおよび変化量に応じた値となるように第1の座標を算出する処理」であると言える。以上より、第2の方法は、(a)入力装置8が画面の中央を指し示す時点における基準姿勢を決定する処理、および、(b)基準姿勢から現在の姿勢までの変化の向きおよび変化量に応じた第1の座標(ひいては画面座標)を算出する処理を実行するものである。したがって、第2の方法は、上記(a)および(b)の処理によって、基準姿勢においては常に特定の値(本実施形態では、画面中央の値)となるように画面座標を算出することを可能とし、これによってユーザが違和感を抱くことを防止するものである。 When the posture at the time when the input device 8 points to the center of the screen is set as the reference posture, the processing for determining the origin at the time, in other words, the posture of the input device 8 when the first coordinate takes the origin. It can be said that the process of step S57 which is a process to determine is a "process to determine the reference posture". The direction from the origin to the corrected first coordinate corresponds to the direction of change (rotation direction) from the reference posture to the current posture, and the distance from the origin to the corrected first coordinate is This corresponds to the amount of change (rotation amount) from the reference posture to the current posture. Therefore, the process of calculating the corrected first coordinate (step S7 and step S742) is “the first coordinate so as to be a value corresponding to the direction and amount of change from the reference posture to the current posture. It can be said that this is a process of calculating “. As described above, in the second method, (a) the process of determining the reference posture at the time when the input device 8 points to the center of the screen, and (b) the direction and amount of change from the reference posture to the current posture. A process of calculating the corresponding first coordinates (and thus the screen coordinates) is executed. Therefore, the second method calculates the screen coordinates so that the reference posture always has a specific value (in this embodiment, the value at the center of the screen) by the processes (a) and (b). This prevents the user from feeling uncomfortable.
[変形例]
(第2の方法に関する変形例)
上記実施形態では、ゲームの開始前の処理(ステップS2およびS3)では、入力装置8の姿勢に応じたカーソル(第1カーソル)ではなく、マーカ座標に基づく第2の座標の位置に表示されるカーソル(第2カーソル)が用いられる。このように、ゲーム装置3は、算出方法が異なる2種類のカーソルを用いてもよい。なお、仮に2種類のカーソルが画面上のいずれの位置でも一致しない(2種類のカーソルの位置が一致する場合における入力装置8の状態が一致しない)とすれば、一方のカーソルから他方のカーソルへ切り替わる際、ユーザは、カーソルの操作方法が全く変わってしまう感覚を受けるために、違和感を抱き、操作性が悪いと感じるおそれがある。これに対して、上記実施形態においては、2種類のカーソルは画面の中心において一致する(カーソルが画面の中心に位置する場合の入力装置8の状態が一致する)。そのため、2種類のカーソルを切り替える際に生じる違和感が少なく、カーソル操作に対してユーザが困惑することを防止することができる。
[Modification]
(Modification regarding the second method)
In the above-described embodiment, in the process before the start of the game (steps S2 and S3), the cursor is not displayed according to the attitude of the input device 8 (first cursor) but is displayed at the second coordinate position based on the marker coordinates. A cursor (second cursor) is used. Thus, the
また、上記実施形態においては、上記第2カーソルを用いてユーザが操作を行う際に第1カーソルに関するオフセット量を決定するので、表示されている第2カーソルの挙動はオフセット量の決定に応じて変化することがない。そのため、ゲーム装置3は、カーソルの挙動が急に変化することによる違和感をユーザに抱かせることなく、オフセット量を決定することができる。
Moreover, in the said embodiment, since the offset amount regarding a 1st cursor is determined when a user performs operation using the said 2nd cursor, the behavior of the 2nd cursor currently displayed corresponds to the determination of an offset amount. There is no change. Therefore, the
なお、他の実施形態においては、ゲーム装置3は、オフセット量を決定する際、上記第2カーソルを必ずしも用いる必要はない。例えば、ゲーム装置3は、「画面中央にコントローラを向けてAボタンを押して下さい」というメッセージを表示し(カーソルは表示しない)、Aボタンが押下された時点で上記ステップS56およびS57の処理を実行するようにしてもよい。この場合であっても、ユーザが「入力装置8が画面中央を指している」と感じる状態で、画面座標は画面の中心に位置することになるので、上記実施形態と同様、ユーザが抱く違和感を低減することができる。また、ゲーム装置3は、オフセット量を決定することを示唆する画面を表示する必要はなく、例えばゲーム画像が表示されている場合にオフセット量を決定してもよい。
In other embodiments, the
また、上記実施形態では、ゲーム装置3は、オフセット量を決定する処理(ステップS57)を、画面座標を入力として用いる処理(ステップS44)を実行前にのみ実行した。ここで、他の実施形態においては、画面座標を入力として用いる処理を繰り返し実行する場合、当該処理が繰り返し実行される合間に、オフセット量を(再度)決定する処理を実行してもよい。例えば上記実施形態に即して言えば、ゲーム中においてステップS3〜S9の処理ループが繰り返し実行される間に、オフセット量を決定する処理が実行されてもよい。例えば、ゲーム装置3は、ゲーム中において上記設定画面が表示されるタイミングでオフセット量を決定する処理を実行してもよいし、当該処理を所定時間間隔で実行してもよいし、ユーザが指示したタイミングで当該処理を実行してもよい。このように、ゲーム中においてオフセット量を決定し直すことによって、ゲーム中に入力装置を把持するユーザの状態が変化した場合(例えば、ゲームを立ってプレイしていたが、ゲーム途中で座った場合)でも、適切なオフセット量を決定し直すことができる。なお、オフセット量を決定し直す処理が実行されると、オフセット量が変化することによって、ユーザの意図しない画面座標の変化が生じ、ユーザがゲーム操作をうまく行えない可能性がある。そのため、ゲーム装置3は、画面座標を入力とする処理が実行されている期間(例えば、カーソルを用いてゲーム操作を行っている期間)には、オフセット量を決定し直す処理をできるだけ実行しないことが好ましい。また、当該処理を実行する場合には、画面座標の変化による影響が小さい場面(例えば、ゲームのポーズ中や、メニュー画面の表示中)で実行することが好ましい。
In the above embodiment, the
上記実施形態では、ゲーム装置3は、仮想空間に設定される平面Qを用いて入力装置8の姿勢から第1の座標を算出し、第1の座標から画面座標を算出した。ここで、入力装置8の姿勢から画面座標を算出する方法は、姿勢に応じて画面座標の位置が変化する方法であればどのような方法であってもよい。例えば、ゲーム装置3は、第1の座標を算出せずに、入力装置8の姿勢から画面座標を直接算出してもよい(換言すれば、第1の座標は画面上の位置を表す座標であってもよい。)。具体的には、ゲーム装置3は、入力装置8が所定の基準姿勢となる場合に画面座標が画面の中心の位置となるように設定し、かつ、当該基準姿勢からの回転角度に比例した大きさだけ、当該基準姿勢からの回転方向に(中心位置にある画面座標を)移動させた位置を表すように、画面座標を算出してもよい。また、例えば、ゲーム装置3は、上記X’Y’座標を画面座標の座標系と一致するように設定することで、入力装置8の姿勢から画面座標を直接算出してもよい。
In the above embodiment, the
また、上記実施形態においては、ゲーム装置3は、オフセット量を用いて第1の座標を補正することによって画面座標を間接的に補正するようにしたが、他の実施形態においては、画面座標を直接補正するようにしてもよい。具体的には、ゲーム装置3は、上記ステップS56において、第1の座標からさらに画面座標を算出し、ステップS57において、画面座標に関するオフセット量を算出してもよい。このとき、ステップS42およびS43においては、ゲーム装置3は、第1の方法で算出された第1の座標から画面座標を算出し、算出された画面座標をオフセット量に従って補正することによって、最終的な画面座標を得ればよい。
In the above embodiment, the
また、上記実施形態においては、ゲーム装置3は、第1の座標に関してオフセット量を設定する、すなわち、X’Y’座標系を平面Q上で移動することによって、第1の座標の補正を行った(図20、図25)。ここで、他の実施形態においては、仮想空間における入力装置8の位置を中心にX’Y’座標系を回転させることによって、第1の座標を補正してもよい。図26は、第2の方法における補正方法の変形例を示す図である。図26は、仮想空間における平面Qを側方から見た図であって、点線で示す平面Qは、第1の方法で用いる平面Qと同じ平面であり、実線で示す平面Q’は、補正後の平面Qである。図26に示す変形例では、CPU10は、図23に示す上記ステップS56およびS57の処理に代えて、次の処理を実行する。すなわち、CPU10は、入力装置8の姿勢(第1姿勢M1)に基づいて、補正後のX’Y’座標系を設定する。X’Y’座標系は、入力装置8のZ軸ベクトルVZの方向に長さLだけ離れた位置が原点となり、かつ、Z軸ベクトルVZと垂直な平面Q’上に設定される。また、ゲーム中においては、CPU10は、図22に示すステップS7およびS42の処理に代えて、上記平面Q’上のX’Y’座標系によって表現される第1の座標を算出する。上記変形例によれば、仮想空間における入力装置8の位置からの距離が一定になるので、第1の座標(画面座標)をより正確に算出することができる。例えば、実際にテレビ2の画面が鉛直方向から傾いて設置される場合(例えば、画面が水平よりも下方を向いてテレビ2が天井に設置される場合)には、より正確に画面座標を算出することができる。一方、上記実施形態における補正方法では、入力装置8の位置に対して固定される平面内においてX’Y’座標系が設定されるので、補正の計算が簡単になる。したがって、テレビ2の画面が鉛直方向から大きく傾いて設置される状況が想定されない場合や、CPU10の処理負荷の低減を優先する場合には、上記実施形態における補正方法を採用することが好ましい。
In the above embodiment, the
(撮像手段に関する変形例)
上記実施形態では、ゲーム装置3は、入力装置8が画面の中心を向く方向となったことを検知するために、入力装置8が備える撮像手段による撮像画像(マーカ座標)を用いた。ここで、ゲーム装置3は、空間内の所定位置から見たときの入力装置8の方向を知ることができれば、上記撮像画像に代えて、他の情報を用いて上記の検知を行ってもよい。例えば、テレビ2の周辺にカメラが設置される場合、ゲーム装置3は、当該カメラによって入力装置8が撮像された撮像画像を用いて上記検知を行ってもよい。また、上記検知を行うための方法はどのようなものであってもよく、例えば入力装置8の周囲に電波あるいは超音波等の信号を発生する装置を設置し、ゲーム装置3は、入力装置8において当該信号を検知することによって、空間内の所定位置から見たときの入力装置8の方向を検知するようにしてもよい。
(Modification regarding imaging means)
In the above-described embodiment, the
(入力装置8の姿勢算出に関する変形例)
なお、上記実施形態においては、ゲーム装置3は、ジャイロセンサ55および56、加速度センサ37、ならびに撮像素子40による検出結果を用いて、入力装置8の姿勢を算出した(ステップS3〜S6)。ここで、入力装置8の姿勢を算出する方法はどのような方法であってもよい。例えば、入力装置8の姿勢は、ジャイロセンサの検出結果のみを用いて算出されてもよいし、加速度センサの検出結果のみを用いて算出されてもよい。
(Modification regarding attitude calculation of input device 8)
In the above embodiment, the
なお、上記実施形態においては、3軸回りの角速度を検出するジャイロセンサを用いて、3次元の姿勢を算出する場合を例として説明したが、2次元の姿勢を算出する場合においても本発明を適用することが可能である。例えば、ロール方向の回転を行わない等の前提であれば、ピッチ方向およびヨー方向の回転に関する2次元の姿勢を、2軸回りの角速度を2軸ジャイロセンサで検出することによって算出してもよい。そして、当該2次元の姿勢から画面座標を算出してもよい。 In the above-described embodiment, the case where a three-dimensional posture is calculated using a gyro sensor that detects angular velocities around three axes has been described as an example. However, the present invention is also applied to a case where a two-dimensional posture is calculated. It is possible to apply. For example, if it is premised that the rotation in the roll direction is not performed, the two-dimensional posture related to the rotation in the pitch direction and the yaw direction may be calculated by detecting an angular velocity about two axes with a two-axis gyro sensor. . Then, the screen coordinates may be calculated from the two-dimensional posture.
また、他の実施形態においては、第2補正処理は、入力装置8がマーカ部6を撮像していると推測される場合にのみ、実行されるようにしてもよい。具体的には、CPU10は、第2補正処理を実行する前に、入力装置8(撮像手段)がマーカ部6を撮像可能な向きを向いているか否かを判定する。この判定は、第1の姿勢あるいは第2の姿勢を用いて行うことができる。例えば、第1の姿勢(または第2の姿勢)が、入力装置8の撮像方向が入力装置8からマーカ部6への向きに対して同じ向きかそれとも逆向きかを判定するようにしてもよい。また、上記の判定に用いられる第1の姿勢は、前回の処理ループにおいて第1および第2補正処理が行われた第1の姿勢であってもよいし、今回の処理ループにおいて算出されて第1補正処理が行われた第1の姿勢であってもよい。
In another embodiment, the second correction process may be executed only when it is estimated that the input device 8 is imaging the
上記の判定の結果、CPU10は、入力装置8がマーカ部6を撮像可能な向きを向いていると判定される場合、第2補正処理を実行し、マーカ部6を撮像可能な向きを向いていないと判定される場合、第2補正処理をスキップする。なお、マーカ部6でない物(例えば、部屋の電灯や窓の外の太陽光等)がマーカ部6と誤検出されることがあり、誤検出によって得られたマーカ座標を用いて第3の姿勢が算出される場合、かかる第3の姿勢を用いて第2補正処理を行っても正確に補正を行うことができない。これに対して、上記の判定処理を行うことにより、誤検出によって得られたマーカ座標から算出される第3の姿勢を用いて第2補正処理が行われることを防止することができる。これによって、第2補正処理をより正確に行うことができる。
As a result of the above determination, when it is determined that the input device 8 faces the direction in which the
以上のように、本発明は、入力装置の姿勢を用いて画面上の位置を適切に算出すること等を目的として、例えば算出された位置を入力として用いるゲーム処理を行うゲーム装置またはゲームプログラム等として利用することが可能である。 As described above, the present invention, for the purpose of appropriately calculating the position on the screen using the attitude of the input device, etc., for example, a game device or a game program for performing a game process using the calculated position as an input It can be used as
1 ゲームシステム
2 テレビ
3 ゲーム装置
4 光ディスク
5 コントローラ
6 マーカ部
7 ジャイロセンサユニット
8 入力装置
10 CPU
11c GPU
11e 内部メインメモリ
12 外部メインメモリ
63 角速度データ
64 加速度データ
65 マーカ座標データ
68 第1姿勢データ
76 第3姿勢データ
77 第1座標データ
78 第2座標データ
79 オフセット量データ
80 画面座標データ
DESCRIPTION OF
11c GPU
11e internal
Claims (23)
所定空間内の所定位置から見たときの入力装置の方向を表す情報を取得する方向取得手段と、
前記所定空間における入力装置の姿勢を算出する姿勢算出手段と、
前記入力装置の姿勢に基づいて、前記表示画面上の位置を決定するための第1の座標を算出する第1座標算出手段と、
前記方向取得手段で取得された前記入力装置の方向に基づいて表示画面上における第2の座標を算出する第2座標算出手段と、
前記方向取得手段で取得された前記入力装置の方向が所定の方向となる時点で算出された第1の座標によって決められる位置と、当該時点で算出された第2の座標が表す位置との差に応じた補正量を決定する補正量決定手段と、
前記補正量の分だけ第1の座標を補正する補正手段を備える、座標算出装置。 A coordinate calculation device that calculates coordinates representing a position on a display screen based on an attitude of an input device,
Direction acquisition means for acquiring information indicating the direction of the input device when viewed from a predetermined position in a predetermined space;
Attitude calculating means for calculating the attitude of the input device in the predetermined space;
First coordinate calculating means for calculating a first coordinate for determining a position on the display screen based on an attitude of the input device;
Second coordinate calculation means for calculating second coordinates on the display screen based on the direction of the input device acquired by the direction acquisition means;
The difference between the position determined by the first coordinates calculated when the direction of the input device acquired by the direction acquisition means becomes a predetermined direction and the position represented by the second coordinates calculated at the time Correction amount determining means for determining a correction amount according to
A coordinate calculation apparatus comprising correction means for correcting the first coordinate by the correction amount.
前記補正量決定手段は、前記所定の情報処理が実行される前に、前記入力装置の方向が所定の方向となったことに応じて前記補正量を決定し、
前記第1座標算出手段は、前記所定の情報処理が繰り返し実行される間に第1の座標を算出し、
前記補正手段は、前記第1座標算出手段が第1の座標を算出する度に当該第1の座標を前記補正量に従って補正する、請求項1に記載の座標算出装置。 Processing execution means for executing predetermined information processing in which the position on the display screen is used as an input;
The correction amount determining means determines the correction amount in response to the direction of the input device becoming a predetermined direction before the predetermined information processing is executed,
The first coordinate calculation means calculates first coordinates while the predetermined information processing is repeatedly executed,
The coordinate calculation apparatus according to claim 1, wherein the correction unit corrects the first coordinate according to the correction amount every time the first coordinate calculation unit calculates the first coordinate.
前記補正量決定手段は、前記指示画像が画面上の所定範囲内に入った場合、前記指示画像が当該所定範囲内に入った時点で算出された第1の座標と、当該所定範囲内の所定位置に対応する第2の座標とに基づいて前記補正量を決定する、請求項1に記載の座標算出装置。 An instruction image display means for displaying a predetermined instruction image at a position represented by the second coordinates on the display screen;
When the instruction image falls within a predetermined range on the screen, the correction amount determination means includes a first coordinate calculated when the instruction image enters the predetermined range, and a predetermined value within the predetermined range. The coordinate calculation apparatus according to claim 1, wherein the correction amount is determined based on a second coordinate corresponding to the position.
前記補正量決定手段は、前記ボタン画像が表示される場合にのみ、前記補正量を決定する処理を実行する、請求項3に記載の座標算出装置。 Button image display means for displaying a button image for a user to give a predetermined instruction in the predetermined range;
The coordinate calculation apparatus according to claim 3, wherein the correction amount determination unit executes the process of determining the correction amount only when the button image is displayed.
前記補正手段は、前記入力装置の方向が所定の方向となる時点で算出された第1の座標が前記所定の基準値となるように第1の座標の座標系を移動することで第1の座標を補正し、
前記補正手段によって補正された後の第1の座標に基づいて前記表示画面上の位置を表す座標を算出する位置算出手段をさらに備える、請求項1から請求項5のいずれか1項に記載の座標算出装置。 The first coordinate calculation means calculates, as the first coordinate, a coordinate representing a position of an intersection between a line segment extending from a predetermined reference point in a vector direction indicating the attitude of the input device and a predetermined plane;
The correction means moves the coordinate system of the first coordinate so that the first coordinate calculated when the direction of the input device becomes the predetermined direction becomes the predetermined reference value. Correct the coordinates,
6. The position calculation unit according to claim 1, further comprising a position calculation unit that calculates a coordinate representing a position on the display screen based on the first coordinate corrected by the correction unit. Coordinate calculation device.
前記補正手段は、第1の座標の一方の成分についてのみ補正を行う、請求項1から請求項8のいずれか1項に記載の座標算出装置。 The first coordinate calculating means calculates a two-dimensional coordinate as the first coordinate;
The coordinate calculation apparatus according to claim 1, wherein the correction unit corrects only one component of the first coordinate.
前記方向取得手段は、前記入力装置の方向を示す情報として、前記撮像手段が撮像する画像内における所定の撮像対象の位置を示す情報を取得する、請求項1から請求項9のいずれか1項に記載の座標算出装置。 The input device has an imaging means,
10. The information acquisition apparatus according to claim 1, wherein the direction acquisition unit acquires information indicating a position of a predetermined imaging target in an image captured by the imaging unit as information indicating the direction of the input device. The coordinate calculation apparatus described in 1.
前記姿勢算出手段は、加速度センサおよび/または角速度センサの検出結果に基づいて入力装置の姿勢を算出する、請求項1から請求項10のいずれか1項に記載の座標算出装置。 The input device includes an acceleration sensor and / or an angular velocity sensor,
The coordinate calculation apparatus according to any one of claims 1 to 10, wherein the attitude calculation unit calculates an attitude of the input device based on a detection result of an acceleration sensor and / or an angular velocity sensor.
前記姿勢算出手段は、前記角速度センサが検出する角速度に基づいて入力装置の姿勢を算出するとともに、前記撮像手段が撮像する画像内における所定の撮像対象の位置に基づいて、少なくとも重力方向を軸とした回転に関して当該姿勢を補正する、請求項11に記載の座標算出装置。 The input device has an imaging means,
The posture calculation means calculates the posture of the input device based on the angular velocity detected by the angular velocity sensor, and based on the position of a predetermined imaging target in the image captured by the imaging means, with at least the gravity direction as an axis. The coordinate calculation apparatus according to claim 11, wherein the posture is corrected with respect to the rotation performed.
所定空間内の所定位置から見たときの入力装置の方向を取得する方向取得手段と、
前記所定空間における入力装置の姿勢を算出する姿勢算出手段と、
前記方向取得手段で取得された前記入力装置の方向が所定の方向となる時点の入力装置の姿勢を基準姿勢として決定する基準決定手段と、
前記表示画面上の位置を決定するための第1の座標を、入力装置が前記基準姿勢となる場合に所定の基準値となるように、かつ、前記基準姿勢から、前記姿勢算出手段が算出した姿勢までの変化の向きおよび変化量に応じた値となるように算出する第1座標算出手段とを備え、
前記表示画面上における第2の座標を前記入力装置の方向に基づいて算出する第2座標算出手段をさらに備え、
前記基準決定手段は、前記第2の座標が所定の値となる時点の入力装置の姿勢を前記基準姿勢として決定する、座標算出装置。 A coordinate calculation device that calculates coordinates representing a position on a display screen based on an attitude of an input device,
Direction acquisition means for acquiring the direction of the input device when viewed from a predetermined position in a predetermined space;
Attitude calculating means for calculating the attitude of the input device in the predetermined space;
Reference determining means for determining, as a reference posture, the posture of the input device when the direction of the input device acquired by the direction acquiring device becomes a predetermined direction;
The posture calculation means calculates the first coordinates for determining the position on the display screen so as to be a predetermined reference value when the input device assumes the reference posture, and from the reference posture. A first coordinate calculation means for calculating a value corresponding to the direction and amount of change up to the posture;
A second coordinate calculating means for calculating a second coordinate on the display screen based on a direction of the input device;
The reference determination unit is a coordinate calculation device that determines the posture of the input device at the time when the second coordinate becomes a predetermined value as the reference posture.
前記基準決定手段は、前記基準姿勢となる場合に第1の座標が前記基準値となるように前記所定平面上で座標系を設定し、
前記第1座標算出手段は、前記基準決定手段が設定した座標系を用いて表される第1の座標を算出し、
前記第1座標算出手段が算出した第1の座標に基づいて前記表示画面上の位置を算出する位置算出手段をさらに備える、請求項14に記載の座標算出装置。 The first coordinate is a coordinate representing a position of an intersection of a line segment extending from a predetermined reference point in the direction of a vector indicating the attitude of the input device and a predetermined plane;
The reference determining means sets a coordinate system on the predetermined plane so that the first coordinate becomes the reference value when the reference posture is set;
The first coordinate calculation means calculates first coordinates expressed using the coordinate system set by the reference determination means,
The coordinate calculation apparatus according to claim 14 , further comprising a position calculation unit that calculates a position on the display screen based on the first coordinate calculated by the first coordinate calculation unit.
所定空間内の所定位置から見たときの入力装置の方向を表す情報を取得する方向取得手段と、
前記所定空間における入力装置の姿勢を算出する姿勢算出手段と、
前記入力装置の姿勢に基づいて、前記表示画面上の位置を決定するための第1の座標を算出する第1座標算出手段と、
前記方向取得手段で取得された前記入力装置の方向に基づいて表示画面上における第2の座標を算出する第2座標算出手段と、
前記方向取得手段で取得された前記入力装置の方向が所定の方向となる時点で算出された第1の座標によって決められる位置と、当該時点で算出された第2の座標が表す位置との差に応じた補正量を決定する補正量決定手段と、
前記補正量の分だけ第1の座標を補正する補正手段として前記コンピュータを機能させる、座標算出プログラム。 A coordinate calculation program executed in a computer of a coordinate calculation device that calculates coordinates representing a position on a display screen based on an attitude of an input device,
Direction acquisition means for acquiring information indicating the direction of the input device when viewed from a predetermined position in a predetermined space;
Attitude calculating means for calculating the attitude of the input device in the predetermined space;
First coordinate calculating means for calculating a first coordinate for determining a position on the display screen based on an attitude of the input device;
Second coordinate calculation means for calculating second coordinates on the display screen based on the direction of the input device acquired by the direction acquisition means;
The difference between the position determined by the first coordinates calculated when the direction of the input device acquired by the direction acquisition means becomes a predetermined direction and the position represented by the second coordinates calculated at the time Correction amount determining means for determining a correction amount according to
A coordinate calculation program for causing the computer to function as correction means for correcting the first coordinate by the correction amount.
所定空間内の所定位置から見たときの入力装置の方向を取得する方向取得手段と、
前記所定空間における入力装置の姿勢を算出する姿勢算出手段と、
前記方向取得手段で取得された前記入力装置の方向が所定の方向となる時点の入力装置の姿勢を基準姿勢として決定する基準決定手段と、
前記表示画面上の位置を決定するための第1の座標を、入力装置が前記基準姿勢となる場合に所定の基準値となるように、かつ、前記基準姿勢から、前記姿勢算出手段が算出した姿勢までの変化の向きおよび変化量に応じた値となるように算出する第1座標算出手段と、
前記表示画面上における第2の座標を前記入力装置の方向に基づいて算出する第2座標算出手段として前記コンピュータを機能させ、
前記基準決定手段は、前記第2の座標が所定の値となる時点の入力装置の姿勢を前記基準姿勢として決定する、座標算出プログラム。 A coordinate calculation program executed in a computer of a coordinate calculation device that calculates coordinates representing a position on a display screen based on an attitude of an input device,
Direction acquisition means for acquiring the direction of the input device when viewed from a predetermined position in a predetermined space;
Attitude calculating means for calculating the attitude of the input device in the predetermined space;
Reference determining means for determining, as a reference posture, the posture of the input device when the direction of the input device acquired by the direction acquiring device becomes a predetermined direction;
The posture calculation means calculates the first coordinates for determining the position on the display screen so as to be a predetermined reference value when the input device assumes the reference posture, and from the reference posture. First coordinate calculation means for calculating a value corresponding to the direction and amount of change up to the posture;
Causing the computer to function as second coordinate calculating means for calculating second coordinates on the display screen based on the direction of the input device;
The reference calculation unit is a coordinate calculation program for determining, as the reference posture, the posture of the input device when the second coordinate becomes a predetermined value.
所定空間内の所定位置から見たときの入力装置の方向を表す情報を取得する方向取得手段と、
前記所定空間における入力装置の姿勢を算出する姿勢算出手段と、
前記入力装置の姿勢に基づいて、前記表示画面上の位置を決定するための第1の座標を算出する第1座標算出手段と、
前記方向取得手段で取得された前記入力装置の方向に基づいて表示画面上における第2の座標を算出する第2座標算出手段と、
前記方向取得手段で取得された前記入力装置の方向が所定の方向となる時点で算出された第1の座標によって決められる位置と、当該時点で算出された第2の座標が表す位置との差に応じた補正量を決定する補正量決定手段と、
前記補正量の分だけ第1の座標を補正する補正手段を備える、座標算出システム。 A coordinate calculation system for calculating coordinates representing a position on a display screen based on an attitude of an input device,
Direction acquisition means for acquiring information indicating the direction of the input device when viewed from a predetermined position in a predetermined space;
Attitude calculating means for calculating the attitude of the input device in the predetermined space;
First coordinate calculating means for calculating a first coordinate for determining a position on the display screen based on an attitude of the input device;
Second coordinate calculation means for calculating second coordinates on the display screen based on the direction of the input device acquired by the direction acquisition means;
The difference between the position determined by the first coordinates calculated when the direction of the input device acquired by the direction acquisition means becomes a predetermined direction and the position represented by the second coordinates calculated at the time Correction amount determining means for determining a correction amount according to
A coordinate calculation system comprising correction means for correcting the first coordinates by the correction amount.
所定空間内の所定位置から見たときの入力装置の方向を取得する方向取得手段と、
前記所定空間における入力装置の姿勢を算出する姿勢算出手段と、
前記方向取得手段で取得された前記入力装置の方向が所定の方向となる時点の入力装置の姿勢を基準姿勢として決定する基準決定手段と、
前記表示画面上の位置を決定するための第1の座標を、入力装置が前記基準姿勢となる場合に所定の基準値となるように、かつ、前記基準姿勢から、前記姿勢算出手段が算出した姿勢までの変化の向きおよび変化量に応じた値となるように算出する第1座標算出手段とを備え、
前記表示画面上における第2の座標を前記入力装置の方向に基づいて算出する第2座標算出手段をさらに備え、
前記基準決定手段は、前記第2の座標が所定の値となる時点の入力装置の姿勢を前記基準姿勢として決定する、座標算出システム。 A coordinate calculation system for calculating coordinates representing a position on a display screen based on an attitude of an input device,
Direction acquisition means for acquiring the direction of the input device when viewed from a predetermined position in a predetermined space;
Attitude calculating means for calculating the attitude of the input device in the predetermined space;
Reference determining means for determining, as a reference posture, the posture of the input device when the direction of the input device acquired by the direction acquiring device becomes a predetermined direction;
The posture calculation means calculates the first coordinates for determining the position on the display screen so as to be a predetermined reference value when the input device assumes the reference posture, and from the reference posture. A first coordinate calculation means for calculating a value corresponding to the direction and amount of change up to the posture;
A second coordinate calculating means for calculating a second coordinate on the display screen based on a direction of the input device;
The reference determination unit is a coordinate calculation system that determines, as the reference posture, the posture of the input device when the second coordinate becomes a predetermined value.
所定空間内の所定位置から見たときの入力装置の方向を表す情報を取得する方向取得ステップと、
前記所定空間における入力装置の姿勢を算出する姿勢算出ステップと、
前記入力装置の姿勢に基づいて、前記表示画面上の位置を決定するための第1の座標を算出する第1座標算出ステップと、
前記方向取得ステップで取得された前記入力装置の方向に基づいて表示画面上における第2の座標を算出する第2座標算出ステップと、
前記方向取得ステップで取得された前記入力装置の方向が所定の方向となる時点で算出された第1の座標によって決められる位置と、当該時点で算出された第2の座標が表す位置との差に応じた補正量を決定する補正量決定ステップと、
前記補正量の分だけ第1の座標を補正する補正ステップを備える、座標算出方法。 A coordinate calculation method executed by a coordinate calculation system for calculating coordinates representing a position on a display screen based on an attitude of an input device,
A direction acquisition step of acquiring information representing the direction of the input device when viewed from a predetermined position in a predetermined space;
An attitude calculating step for calculating an attitude of the input device in the predetermined space;
A first coordinate calculating step for calculating a first coordinate for determining a position on the display screen based on an attitude of the input device;
A second coordinate calculating step of calculating a second coordinate on the display screen based on the direction of the input device acquired in the direction acquiring step;
The difference between the position determined by the first coordinates calculated when the direction of the input device acquired in the direction acquisition step becomes a predetermined direction and the position represented by the second coordinates calculated at the time A correction amount determination step for determining a correction amount according to
A coordinate calculation method comprising a correction step of correcting the first coordinate by the correction amount.
所定空間内の所定位置から見たときの入力装置の方向を取得する方向取得ステップと、
前記所定空間における入力装置の姿勢を算出する姿勢算出ステップと、
前記方向取得ステップによって取得された前記入力装置の方向が所定の方向となる時点の入力装置の姿勢を基準姿勢として決定する基準決定ステップと、
前記表示画面上の位置を決定するための第1の座標を、入力装置が前記基準姿勢となる場合に所定の基準値となるように、かつ、前記基準姿勢から、前記姿勢算出ステップによって算出された姿勢までの変化の向きおよび変化量に応じた値となるように算出する第1座標算出ステップとを備え、
前記表示画面上における第2の座標を前記入力装置の方向に基づいて算出する第2座標算出ステップをさらに備え、
前記基準決定ステップにおいては、前記第2の座標が所定の値となる時点の入力装置の姿勢を前記基準姿勢として決定する、座標算出方法。
A coordinate calculation method executed by a coordinate calculation system for calculating coordinates representing a position on a display screen based on an attitude of an input device,
A direction acquisition step of acquiring the direction of the input device when viewed from a predetermined position in a predetermined space;
An attitude calculating step for calculating an attitude of the input device in the predetermined space;
A reference determining step for determining, as a reference posture, the posture of the input device when the direction of the input device acquired by the direction acquiring step is a predetermined direction;
The first coordinate for determining the position on the display screen is calculated by the posture calculation step so as to have a predetermined reference value when the input device assumes the reference posture and from the reference posture. A first coordinate calculation step for calculating a value corresponding to the direction of change and the amount of change up to the determined posture,
A second coordinate calculating step of calculating a second coordinate on the display screen based on a direction of the input device;
In the reference determination step, a coordinate calculation method of determining, as the reference posture, the posture of the input device when the second coordinates become a predetermined value.
Priority Applications (6)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2009226048A JP5669294B2 (en) | 2009-09-30 | 2009-09-30 | Coordinate calculation apparatus and coordinate calculation program |
EP10154556.4A EP2228110B1 (en) | 2009-03-09 | 2010-02-24 | Coordinate calculation apparatus and storage medium having coordinate calculation program stored therein |
EP10154549.9A EP2228109B1 (en) | 2009-03-09 | 2010-02-24 | Information processing apparatus, storage medium having information processing program stored therein, information processing system, and display range control method |
US12/712,362 US8614672B2 (en) | 2009-03-09 | 2010-02-25 | Information processing apparatus, storage medium having information processing program stored therein, information processing system, and display range control method |
US12/713,622 US8704759B2 (en) | 2009-03-09 | 2010-02-26 | Coordinate calculation apparatus and storage medium having coordinate calculation program stored therein |
US14/170,943 US9772694B2 (en) | 2009-03-09 | 2014-02-03 | Coordinate calculation apparatus and storage medium having coordinate calculation program stored therein |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2009226048A JP5669294B2 (en) | 2009-09-30 | 2009-09-30 | Coordinate calculation apparatus and coordinate calculation program |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2011072475A JP2011072475A (en) | 2011-04-14 |
JP5669294B2 true JP5669294B2 (en) | 2015-02-12 |
Family
ID=44017133
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2009226048A Active JP5669294B2 (en) | 2009-03-09 | 2009-09-30 | Coordinate calculation apparatus and coordinate calculation program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP5669294B2 (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP5943553B2 (en) * | 2011-05-23 | 2016-07-05 | 任天堂株式会社 | GAME SYSTEM, GAME DEVICE, GAME PROGRAM, AND GAME PROCESSING METHOD |
JP5816032B2 (en) * | 2011-09-09 | 2015-11-17 | 任天堂株式会社 | INPUT DEVICE, INPUT PROCESSING PROGRAM, INPUT PROCESSING METHOD, INPUT PROCESSING SYSTEM |
Family Cites Families (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH0546318A (en) * | 1991-08-12 | 1993-02-26 | Nikko:Kk | Image generating device by light pen input |
JP4743818B2 (en) * | 2003-04-04 | 2011-08-10 | キヤノン株式会社 | Image processing apparatus, image processing method, and computer program |
US7489299B2 (en) * | 2003-10-23 | 2009-02-10 | Hillcrest Laboratories, Inc. | User interface devices and methods employing accelerometers |
JP4689585B2 (en) * | 2006-11-29 | 2011-05-25 | 任天堂株式会社 | Information processing apparatus and information processing program |
JP5531616B2 (en) * | 2007-12-07 | 2014-06-25 | ソニー株式会社 | Control device, input device, control system, control method, and handheld device |
JP4265814B1 (en) * | 2008-06-30 | 2009-05-20 | 任天堂株式会社 | Posture calculation device, posture calculation program, game device, and game program |
-
2009
- 2009-09-30 JP JP2009226048A patent/JP5669294B2/en active Active
Also Published As
Publication number | Publication date |
---|---|
JP2011072475A (en) | 2011-04-14 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP2228110B1 (en) | Coordinate calculation apparatus and storage medium having coordinate calculation program stored therein | |
EP2140915B1 (en) | Orientation calculation apparatus, storage medium having orientation calculation program stored therein, game apparatus, and storage medium having game program stored therein | |
JP4265814B1 (en) | Posture calculation device, posture calculation program, game device, and game program | |
JP5060798B2 (en) | Information processing program and information processing apparatus | |
EP2140918B1 (en) | Orientation calculation apparatus, storage medium having orientation calculation program stored therein, game apparatus, and storage medium having game program stored therein | |
US20100309117A1 (en) | Inclination calculation apparatus and inclination calculation program, and game apparatus and game program | |
JP4918376B2 (en) | Information processing program and information processing apparatus | |
EP2140916B1 (en) | Coordinate calculation apparatus and storage medium having coordinate calculation program stored therein | |
EP2140919B1 (en) | Orientation calculation apparatus, storage medium having orientation calculation program stored therein, game apparatus, and storage medium having game program stored therein | |
JP5630969B2 (en) | Posture calculation apparatus, posture calculation program, posture calculation system, and posture calculation method | |
JP2010207329A (en) | Coordinate calculation device and coordinate calculation program | |
JP5541851B2 (en) | Posture calculation device, posture calculation program, game device, and game program | |
JP5525177B2 (en) | Information processing program and information processing apparatus | |
JP5872136B2 (en) | Posture calculation device, posture calculation program, game device, game program, posture calculation system, and posture calculation method | |
JP5669294B2 (en) | Coordinate calculation apparatus and coordinate calculation program | |
JP5424400B2 (en) | Information processing apparatus, information processing program, information processing system, and display range control method | |
JP5455191B2 (en) | Posture calculation apparatus, posture calculation program, posture calculation system, and posture calculation method | |
JP6042394B2 (en) | Coordinate calculation apparatus and coordinate calculation program | |
JP5872135B2 (en) | Posture calculation device, posture calculation program, game device, game program, posture calculation system, and posture calculation method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
RD04 | Notification of resignation of power of attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7424 Effective date: 20111019 |
|
RD02 | Notification of acceptance of power of attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7422 Effective date: 20111104 |
|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20120829 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20140206 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20140403 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20140603 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20140730 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20140922 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20141022 |
|
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: 20141212 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20141215 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 5669294 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
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 |