JP2011138295A - Apparatus, program and system for processing information and display range control method - Google Patents

Apparatus, program and system for processing information and display range control method Download PDF

Info

Publication number
JP2011138295A
JP2011138295A JP2009297473A JP2009297473A JP2011138295A JP 2011138295 A JP2011138295 A JP 2011138295A JP 2009297473 A JP2009297473 A JP 2009297473A JP 2009297473 A JP2009297473 A JP 2009297473A JP 2011138295 A JP2011138295 A JP 2011138295A
Authority
JP
Japan
Prior art keywords
coordinates
posture
input device
display
predetermined
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.)
Granted
Application number
JP2009297473A
Other languages
Japanese (ja)
Other versions
JP5424400B2 (en
Inventor
Keizo Ota
敬三 太田
Kenta Sato
賢太 佐藤
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nintendo Co Ltd
Original Assignee
Nintendo Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nintendo Co Ltd filed Critical Nintendo Co Ltd
Priority to JP2009297473A priority Critical patent/JP5424400B2/en
Priority to EP10154549.9A priority patent/EP2228109B1/en
Priority to EP10154556.4A priority patent/EP2228110B1/en
Priority to US12/712,362 priority patent/US8614672B2/en
Priority to US12/713,622 priority patent/US8704759B2/en
Publication of JP2011138295A publication Critical patent/JP2011138295A/en
Priority to US14/170,943 priority patent/US9772694B2/en
Application granted granted Critical
Publication of JP5424400B2 publication Critical patent/JP5424400B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Position Input By Displaying (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To control a display range to be displayed at a display device by using the output of a gyro-sensor. <P>SOLUTION: An information processing apparatus inputs an angular rate detected by a gyro-sensor included in an input device, and displays an image on a display device. The information processing apparatus calculates an orientation of the input device based on the angular rate. Then, the information processing apparatus calculates coordinates at an intersection between a line extending from a predetermined position in a predetermined space toward a vector representing the orientation and a predetermined plane within the predetermined space. A display range of a display target that is to be displayed on the display device is controlled based on the coordinates. <P>COPYRIGHT: (C)2011,JPO&INPIT

Description

本発明は、情報処理装置、情報処理プログラム、情報処理システム、および、表示範囲制御方法に関し、より特定的には、ジャイロセンサの検出結果を入力として表示装置に表示される表示範囲を制御する情報処理装置、情報処理プログラム、情報処理システム、および、表示範囲制御方法に関する。   The present invention relates to an information processing device, an information processing program, an information processing system, and a display range control method, and more specifically, information for controlling a display range displayed on a display device using a detection result of a gyro sensor as an input. The present invention relates to a processing device, an information processing program, an information processing system, and a display range control method.

従来、加速度センサおよびジャイロセンサを用いたゲーム装置が考えられている。例えば、特許文献1には、加速度センサおよびジャイロセンサを備えた入力制御装置を使用するゲーム装置が記載されている。このゲーム装置は、ゲームキャラクタが持つ刀を入力制御装置の動きに応じて制御するものである。具体的には、加速度センサの出力に基づいて刀を振る動作のデータが作成され、ジャイロセンサの出力に基づいて刀の姿勢のデータが作成される。   Conventionally, a game apparatus using an acceleration sensor and a gyro sensor has been considered. For example, Patent Document 1 describes a game device that uses an input control device including an acceleration sensor and a gyro sensor. This game device controls a sword possessed by a game character in accordance with the movement of an input control device. Specifically, data on the motion of swinging the sword is created based on the output of the acceleration sensor, and data on the posture of the sword is created based on the output of the gyro sensor.

特開2000−308756号公報JP 2000-308756 A

ジャイロセンサを備える入力装置を用いるシステムにおいては、入力装置自体を動かす操作を入力として用いることができる。そのため、このような入力装置を用いて、例えば、表示画面上の位置を指定する操作や、画像をスクロールさせる操作等、種々の操作を行うことができればユーザにとって便利である。しかし、上記特許文献1では、ジャイロセンサの出力は仮想空間内のオブジェクト(刀)の姿勢を制御するために用いられるのみであり、ジャイロセンサの出力を各種の操作に用いることができなかった。   In a system using an input device including a gyro sensor, an operation for moving the input device itself can be used as an input. Therefore, it is convenient for the user if various operations such as an operation for designating a position on the display screen and an operation for scrolling an image can be performed using such an input device. However, in Patent Document 1, the output of the gyro sensor is only used for controlling the posture of the object (sword) in the virtual space, and the output of the gyro sensor cannot be used for various operations.

それ故、本発明の目的は、表示装置に表示される表示範囲をジャイロセンサの出力を用いて制御することができる情報処理装置、情報処理プログラム、情報処理システム、および、表示範囲制御方法を提供することである。   Therefore, an object of the present invention is to provide an information processing device, an information processing program, an information processing system, and a display range control method capable of controlling a display range displayed on a display device using an output of a gyro sensor. It is to be.

本発明は、上記の課題を解決するために、以下の(1)〜(13)の構成を採用した。   The present invention employs the following configurations (1) to (13) in order to solve the above problems.

(1)
本発明は、入力装置が備えるジャイロセンサによって検出される角速度を入力し、表示装置に画像を表示させる情報処理装置である。情報処理装置は、姿勢算出部と、座標算出部と、表示制御部とを備える。姿勢算出部は、角速度に基づいて入力装置の姿勢を算出する。座標算出部は、所定空間の所定位置から姿勢を表すベクトルの方向へ延ばした線分と、当該所定空間における所定平面との交点の座標を算出する。表示制御部は、表示対象のうちで表示装置に表示すべき表示範囲を座標に基づいて制御する。
(1)
The present invention is an information processing apparatus that inputs an angular velocity detected by a gyro sensor included in an input device and displays an image on a display device. The information processing apparatus includes an attitude calculation unit, a coordinate calculation unit, and a display control unit. The attitude calculation unit calculates the attitude of the input device based on the angular velocity. The coordinate calculation unit calculates the coordinates of the intersection of a line segment extending from a predetermined position in the predetermined space in the direction of the vector representing the posture and the predetermined plane in the predetermined space. A display control part controls the display range which should be displayed on a display apparatus among display objects based on a coordinate.

上記「入力装置」は、後述する実施形態における入力装置8のような加速度センサ等を備えた装置に限らず、ジャイロセンサを備える任意の入力手段を含む概念である。
上記「情報処理装置」は、後述する実施形態においては、ゲーム処理を実行するためのゲーム装置であるが、入力装置の角速度を入力として表示装置に画像を表示させる任意の情報処理装置を含む概念である。また、後述する実施形態においては、ゲーム装置3と入力装置8とは別体であったが、例えば情報処理装置が携帯型である場合には、情報処理装置と入力装置とは一体であってもよい。
上記「姿勢算出部」は、角速度に基づいて入力装置の姿勢を算出するものであればよく、姿勢の算出方法は問わない。例えば、後述する実施形態では、ジャイロセンサ、加速度センサ、および撮像手段の各出力を用いて姿勢を算出するが、「姿勢算出部」は、ジャイロセンサのみを用いて姿勢を算出してもよい。
上記「座標算出部」は、入力装置の姿勢から、所定平面における位置(2次元座標)を算出するものである。「座標算出部」は、後述する実施形態におけるステップS7を実行するものであってもよいし、ステップS7に加えてステップS81およびS82を実行するものであってもよい。
上記「表示制御部」は、座標算出部によって算出された座標に基づいて表示範囲を制御するものであればどのようなものであってもよい。「表示制御部」は、例えば、後述する実施形態や下記(2)の構成のように、3次元の仮想空間に設定される仮想カメラを用いて表示範囲を制御するものであってもよいし、表示対象である2次元平面上に表示範囲を設定して制御するものであってもよい。
The “input device” is not limited to a device including an acceleration sensor or the like like the input device 8 in an embodiment described later, and is a concept including an arbitrary input unit including a gyro sensor.
In the embodiment described later, the “information processing apparatus” is a game apparatus for executing a game process, but includes a concept including an arbitrary information processing apparatus that displays an image on a display device using an angular velocity of the input device as an input. It is. In the embodiment described later, the game apparatus 3 and the input apparatus 8 are separate bodies. However, for example, when the information processing apparatus is a portable type, the information processing apparatus and the input apparatus are integrated. Also good.
The “posture calculation unit” may be any unit that calculates the posture of the input device based on the angular velocity, and the posture 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. However, the “posture calculation unit” may calculate the posture using only the gyro sensor.
The “coordinate calculator” calculates a position (two-dimensional coordinates) on a predetermined plane from the attitude of the input device. The “coordinate calculation unit” may execute step S7 in the embodiment described later, or may execute steps S81 and S82 in addition to step S7.
The “display control unit” may be anything as long as it controls the display range based on the coordinates calculated by the coordinate calculation unit. The “display control unit” may control the display range using a virtual camera set in a three-dimensional virtual space, for example, as in the embodiments described later and the configuration of (2) below. The display range may be set and controlled on the two-dimensional plane that is the display target.

上記(1)の構成によれば、座標算出部によって、入力装置の姿勢から、当該姿勢に応じた2次元座標を得ることができる。したがって、表示制御部において2次元座標に基づいて表示範囲を制御することによって、入力装置の姿勢を用いて表示範囲を制御することができる。このように、上記(1)の構成によれば、表示装置に表示される表示範囲をジャイロセンサの出力を用いて制御することができる。   According to the configuration of (1) above, the coordinate calculation unit can obtain two-dimensional coordinates corresponding to the posture from the posture of the input device. Therefore, by controlling the display range based on the two-dimensional coordinates in the display control unit, the display range can be controlled using the attitude of the input device. Thus, according to the configuration of (1) above, the display range displayed on the display device can be controlled using the output of the gyro sensor.

(2)
表示制御部は、表示対象が配置される仮想空間内において仮想カメラの向きおよび/または位置を座標に基づいて変化させることで表示範囲を制御してもよい。
(2)
The display control unit may control the display range by changing the orientation and / or position of the virtual camera based on the coordinates in the virtual space where the display target is arranged.

上記(2)の構成によれば、仮想カメラの向きおよび/または位置を制御することによって、表示範囲を容易に制御することができる。   According to the configuration (2), the display range can be easily controlled by controlling the orientation and / or position of the virtual camera.

(3)
情報処理装置は、入力装置に設けられた操作手段に対する方向指示操作を示す操作情報をさらに入力してもよい。このとき、表示制御部は、座標に基づいて仮想カメラの向きを変化させ、操作情報に基づいて仮想カメラの位置を変化させることで表示範囲を制御する。
(3)
The information processing apparatus may further input operation information indicating a direction instruction operation on an operation unit provided in the input device. At this time, the display control unit controls the display range by changing the orientation of the virtual camera based on the coordinates and changing the position of the virtual camera based on the operation information.

上記「操作手段」は、入力装置に設けられる任意の操作装置を含む概念である、後述する実施形態における十字ボタンの他、スティックやタッチパッド等を含む概念である。   The “operation means” is a concept including an arbitrary operation device provided in the input device, and is a concept including a stick, a touch pad, and the like in addition to a cross button in an embodiment described later.

上記(3)の構成によれば、ユーザは、入力装置の姿勢を変化させる操作によって仮想カメラの向きを変化させるとともに、入力装置に設けられた操作手段に対する操作によって仮想カメラの位置を変化させることができる。したがって、ユーザは、入力装置を把持する片手で2種類の入力を行うことができ、2種類の方法で表示範囲を変更することができるので、表示範囲をより自由に操作することができる。つまり、上記(3)の構成によれば、表示範囲の操作の自由度を向上することができるとともに、表示範囲に対する操作の操作性を向上することができる。   According to the configuration of (3) above, the user can change the orientation of the virtual camera by an operation that changes the attitude of the input device, and can also change the position of the virtual camera by an operation on the operation means provided in the input device. Can do. Therefore, the user can perform two types of input with one hand holding the input device, and can change the display range by two types of methods, so that the display range can be operated more freely. That is, according to the configuration of (3) above, the degree of freedom of operation of the display range can be improved and the operability of the operation on the display range can be improved.

(4)
表示制御部は、座標が所定平面における所定領域の外側の位置を示す場合、表示範囲を変化させてもよい。
(4)
The display control unit may change the display range when the coordinates indicate a position outside the predetermined area on the predetermined plane.

上記「所定領域」とは、後述する実施形態においては、表示装置(テレビ2)の画面に対応する所定領域Arであるが、所定平面上における領域であればどのような位置・形状であってもよい。   In the embodiment described later, the “predetermined area” is a predetermined area Ar corresponding to the screen of the display device (television 2), but any position / shape as long as it is an area on a predetermined plane. Also good.

上記(4)の構成によれば、所定の基準方向を向く姿勢(座標が所定領域の内側となるときの入力装置の姿勢)から入力装置の姿勢を変化させることによって、表示範囲を変化させることができる。   According to the configuration of (4) above, the display range is changed by changing the attitude of the input device from the attitude facing the predetermined reference direction (the attitude of the input device when the coordinates are inside the predetermined area). Can do.

(5)
情報処理装置は、所定領域と表示装置の画面の領域とが対応するように、当該画面上の位置を座標に基づいて算出する画面位置算出部をさらに備えていてもよい。
(5)
The information processing apparatus may further include a screen position calculation unit that calculates the position on the screen based on the coordinates so that the predetermined area corresponds to the area of the screen of the display device.

上記(5)の構成によれば、上記所定領域と表示装置の画面の領域とが対応するので、上記「所定の基準方向を向く姿勢」は、入力装置が画面の方向を向く姿勢となる。したがって、入力装置を画面から外れる方へ向けることによって、表示範囲を変化させることができ、ユーザは、直感的なわかりやすい操作で表示範囲を変化させることができる。   According to the configuration of (5) above, the predetermined area corresponds to the area of the screen of the display device. Therefore, the “posture toward the predetermined reference direction” is an attitude in which the input device faces the screen. Therefore, the display range can be changed by turning the input device away from the screen, and the user can change the display range with an intuitive and easy-to-understand operation.

(6)
情報処理装置は、指示画像表示部と、処理実行部をさらに備えていてもよい。指示画像表示部は、画面位置算出部が算出した画面上の位置に所定の指示画像を表示させる。処理実行部は、指示画像の位置に基づいて所定の情報処理を実行する。
(6)
The information processing apparatus may further include an instruction image display unit and a process execution unit. The instruction image display unit displays a predetermined instruction image at the position on the screen calculated by the screen position calculation unit. The process execution unit executes predetermined information processing based on the position of the instruction image.

上記「指示画像」は、後述する実施形態におけるカーソルの他、画面位置算出部が算出した画面上の位置に表示される任意の画像を含む概念である。つまり、上記「指示画像表示部」は、後述する実施形態におけるステップS44のようにカーソルを表示するものに限らず、例えば、上記画面上の位置の軌跡を表示するものであってもよい。
上記「処理実行部」は、後述する実施形態においては、カーソル位置に基づくゲーム処理(ステップS45)を上記「所定の情報処理」として実行するCPU10であるが、これに限らず、画面位置算出部が算出した画面上の位置を入力として用いる処理を実行するものであればよい。
The “instruction image” is a concept including an arbitrary image displayed at a position on the screen calculated by the screen position calculation unit in addition to the cursor in the embodiment described later. That is, the “instruction image display unit” is not limited to the one that displays the cursor as in step S44 in the embodiment described later, and may be one that displays the locus of the position on the screen, for example.
In the embodiment described later, the “process execution unit” is the CPU 10 that executes the game process based on the cursor position (step S45) as the “predetermined information process”. As long as it executes processing using the position on the screen calculated by as an input.

上記(6)の構成によれば、入力装置が画面の方を向いている状態においては、上記処理実行部によって所定の処理が実行され、入力装置が画面の方を向けていない(画面外の方を向いている)状態においては、表示制御部によって表示範囲の制御が行われる。
したがって、ユーザは、入力装置を画面内に向けて操作することで指示画像を用いた指示操作を行うことができるとともに、入力装置を画面外に向けることで表示範囲を移動させることができる。これによれば、指示画像を用いた指示操作中においても非常に直感的でわかりやすい操作で表示範囲を移動させることができるので、指示画像を用いた指示操作の操作性を向上することができる。
According to the configuration of (6) above, in a state where the input device is facing the screen, the predetermined processing is executed by the processing execution unit, and the input device is not facing the screen (outside the screen). The display range is controlled by the display control unit.
Therefore, the user can perform an instruction operation using the instruction image by operating the input device toward the screen, and can move the display range by pointing the input device to the outside of the screen. According to this, since the display range can be moved by an operation that is very intuitive and easy to understand even during an instruction operation using an instruction image, the operability of the instruction operation using the instruction image can be improved.

(7)
表示制御部は、表示範囲を変化させる方向を、所定領域から座標が示す位置までの方向に応じて決定してもよい。
(7)
The display control unit may determine the direction in which the display range is changed according to the direction from the predetermined area to the position indicated by the coordinates.

上記(7)の構成によれば、所定の基準方向を向く姿勢(座標が所定領域の内側となるときの入力装置の姿勢)から入力装置の姿勢を変化させる向きに応じた方向へ、表示範囲を変化させることができる。これによれば、入力装置を向けた方向へ表示範囲を移動させることができるので、ユーザは、直感的なわかりやすい操作で表示範囲を変化させることができる。   According to the configuration of (7) above, the display range is changed from a posture facing the predetermined reference direction (a posture of the input device when the coordinates are inside the predetermined region) to a direction corresponding to the direction of changing the posture of the input device. Can be changed. According to this, since the display range can be moved in the direction in which the input device is directed, the user can change the display range with an intuitive and easy-to-understand operation.

(8)
表示制御部は、表示範囲を変化させる度合を、座標が示す位置が所定領域から離れている度合に基づいて決定してもよい。
(8)
The display control unit may determine the degree to which the display range is changed based on the degree to which the position indicated by the coordinates is away from the predetermined area.

上記「表示範囲を変化させる度合」とは、表示範囲の速度(単位時間当たりの移動量)、および、表示範囲の移動量を少なくとも含む概念である。
上記「座標が示す位置が所定領域から離れている度合」とは、後述する実施形態においてははみ出しベクトルVdの長さとして表されるが、これに限らず、座標の位置から所定領域までの距離を表す情報であればよい。上記「度合」は、例えば、座標の位置から所定領域の中心位置までの長さとして表されてもよいし、座標の位置から、所定領域の辺のうちで当該座標の位置に最も近い辺の中点までの長さとして表されてもよい。
The “degree of changing the display range” is a concept including at least the speed of the display range (the amount of movement per unit time) and the amount of movement of the display range.
The above “degree to which the position indicated by the coordinates is away from the predetermined area” is expressed as the length of the protrusion vector Vd in the embodiment described later, but is not limited to this, and the distance from the coordinate position to the predetermined area May be used as long as it represents information. The “degree” may be expressed as, for example, the length from the coordinate position to the center position of the predetermined area, or the side closest to the position of the coordinate among the edges of the predetermined area from the coordinate position. It may be expressed as the length to the midpoint.

上記(8)の構成によれば、所定の基準方向を向く姿勢から入力装置の姿勢を変化させる量に応じて、表示範囲を変化させる度合が決定される。これによれば、ユーザは、入力装置の向きを大きく変化させれば表示範囲を大きく(または速く)移動させることができるので、ユーザは、直感的なわかりやすい操作で表示範囲を変化させることができる。   According to the configuration of (8) above, the degree to which the display range is changed is determined according to the amount by which the attitude of the input device is changed from the attitude facing the predetermined reference direction. According to this, since the user can move the display range largely (or quickly) if the direction of the input device is greatly changed, the user can change the display range by an intuitive and easy-to-understand operation. .

(9)
表示制御部は、表示範囲を変化させる度合を、座標が所定領域の外側に位置する場合における当該座標の速度に基づいて決定してもよい。
(9)
The display control unit may determine the degree to which the display range is changed based on the speed of the coordinates when the coordinates are located outside the predetermined area.

上記「座標の速度に基づいて決定する」とは、座標の速度をそのまま用いて上記度合を決定することの他、座標の速度から算出される情報を用いて(座標の速度を加工して用いて)上記度合を決定することを含む。表示制御部は、例えば、後述する実施形態におけるスクロール成分速度Sを用いて上記度合を決定してもよいし、所定期間における速度の最大値を用いて上記度合を決定してもよい。   The above "determining based on the coordinate speed" means determining the degree by using the coordinate speed as it is, and using information calculated from the coordinate speed (using the coordinate speed processed) And) determining the above degree. For example, the display control unit may determine the degree using a scroll component speed S in an embodiment described later, or may determine the degree using a maximum value of the speed in a predetermined period.

上記(9)の構成によれば、所定の基準方向を向く姿勢から入力装置の姿勢を変化させる速度に応じて、表示範囲を変化させる度合が決定される。これによれば、ユーザは、入力装置の向きを速く変化させれば表示範囲を大きく(または速く)移動させることができるので、ユーザは、直感的なわかりやすい操作で表示範囲を変化させることができる。   According to the configuration of (9) above, the degree of changing the display range is determined in accordance with the speed at which the posture of the input device is changed from the posture facing the predetermined reference direction. According to this, since the user can move the display range large (or fast) if the direction of the input device is changed quickly, the user can change the display range with an intuitive and easy-to-understand operation. .

(10)
表示制御部は、座標が所定領域の外側に出てからの所定期間における当該座標の速度の最大値を少なくとも用いて、表示範囲を変化させる速度を決定してもよい。
(10)
The display control unit may determine the speed at which the display range is changed using at least the maximum value of the speed of the coordinates in a predetermined period after the coordinates are outside the predetermined area.

上記「座標が所定領域の外側に出てからの所定期間」とは、後述する実施形態のように、座標が所定領域の外側に出ている期間であってもよいし、座標が所定領域の外側に出てから、予め定められた所定時間が経過するまでの期間であってもよい。   The “predetermined period after the coordinates appear outside the predetermined area” may be a period during which the coordinates are outside the predetermined area, as in the embodiment described later, It may be a period until a predetermined time elapses after going outside.

上記(10)の構成によれば、上記所定期間における最大値が表示範囲の移動速度に反映されるので、入力装置が停止した場合であっても表示範囲の移動を継続することができる。したがって、表示対象が非常に大きいために表示範囲を大きく移動させる必要がある場合等であっても、ユーザは表示範囲を容易に移動させることができる。   According to the configuration of (10) above, since the maximum value in the predetermined period is reflected in the moving speed of the display range, the movement of the display range can be continued even when the input device is stopped. Therefore, even when the display range needs to be moved greatly because the display target is very large, the user can easily move the display range.

(11)
表示制御部は、ユーザが入力装置を用いて指定した期間において、座標に基づき表示範囲を変化させてもよい。
(11)
The display control unit may change the display range based on the coordinates in a period specified by the user using the input device.

上記(11)の構成によれば、ユーザが指定した期間のみ表示範囲が変化するので、誤って表示範囲が変更されることを防止することができる。   With configuration (11) above, the display range changes only during the period specified by the user, so that it is possible to prevent the display range from being changed by mistake.

(12)
表示制御部は、座標の移動方向に応じた方向へ、座標の移動量に応じた量だけ表示範囲を移動させてもよい。
(12)
The display control unit may move the display range in an amount corresponding to the coordinate movement amount in a direction corresponding to the coordinate movement direction.

上記(12)の構成によれば、座標の移動方向および移動量に応じて表示範囲の移動方向および移動量が決まるので、ユーザは、直感的なわかりやすい操作で表示範囲を変化させることができる。   According to the configuration of (12) above, since the moving direction and moving amount of the display range are determined according to the moving direction and moving amount of the coordinates, the user can change the display range with an intuitive and easy-to-understand operation.

(13)
表示制御部は、所定平面における所定の基準位置から座標が示す位置までの方向に応じた方向へ、当該所定の基準位置から座標が示す位置までの距離に応じた速度で表示範囲を移動させてもよい。
(13)
The display control unit moves the display range in a direction corresponding to the direction from the predetermined reference position to the position indicated by the coordinates on the predetermined plane at a speed corresponding to the distance from the predetermined reference position to the position indicated by the coordinates. Also good.

上記(13)の構成によれば、所定の基準方向を向く姿勢(座標が所定の基準位置となるときの入力装置の姿勢)から入力装置の姿勢を変化させる向きに応じた方向へ、表示範囲を変化させることができる。これによれば、入力装置を向けた方向へ表示範囲を移動させることができるので、ユーザは、直感的なわかりやすい操作で表示範囲を変化させることができる。また、上記基準方向を向く姿勢から入力装置の姿勢を変化させる量に応じた速度で表示範囲を移動させることができる。そのため、ユーザは、入力装置を静止させていても表示範囲を移動させることができるので、表示対象が非常に大きいために表示範囲を大きく移動させる必要がある場合等であっても、表示範囲を容易に移動させることができる。   According to the configuration of (13) above, the display range is changed from a posture facing the predetermined reference direction (an posture of the input device when the coordinates are the predetermined reference position) to a direction corresponding to the direction in which the posture of the input device is changed. Can be changed. According to this, since the display range can be moved in the direction in which the input device is directed, the user can change the display range with an intuitive and easy-to-understand operation. Further, the display range can be moved at a speed corresponding to the amount by which the posture of the input device is changed from the posture facing the reference direction. Therefore, since the user can move the display range even when the input device is stationary, the display range can be changed even when the display range needs to be moved greatly because the display target is very large. It can be moved easily.

また、本発明は、情報処理装置のコンピュータを上記各部と同等の手段として機能させる情報処理プログラムの形態で実施されてもよい。また、本発明は、上記各部を備える1以上の情報処理装置からなる情報処理システムの形態で実施されてもよい。このとき、1以上の情報処理装置は、有線または無線通信によって直接通信を行ってもよいし、ネットワークを介して通信を行ってもよい。さらに、本発明は、上記各部によって行われる表示範囲制御方法の形態で実施されてもよい。   The present invention may also be implemented in the form of an information processing program that causes a computer of the information processing apparatus to function as means equivalent to the above-described units. Further, the present invention may be implemented in the form of an information processing system including one or more information processing apparatuses including the above-described units. At this time, the one or more information processing apparatuses may perform direct communication via wired or wireless communication, or may perform communication via a network. Furthermore, the present invention may be implemented in the form of a display range control method performed by each of the above units.

本発明によれば、ジャイロセンサの出力から算出される入力装置の姿勢から、当該姿勢に応じた2次元座標を得て、この2次元座標に基づいて表示範囲を制御することによって、ジャイロセンサの出力を用いて表示装置に表示される表示範囲を制御することができる。   According to the present invention, a two-dimensional coordinate corresponding to the posture is obtained from the posture of the input device calculated from the output of the gyro sensor, and the display range is controlled based on the two-dimensional coordinate. The display range displayed on the display device can be controlled using the output.

ゲームシステムの外観図External view of game system ゲーム装置の機能ブロック図Functional block diagram of game device 入力装置の外観構成を示す斜視図The perspective view which shows the external appearance structure of an input device コントローラの外観構成を示す斜視図Perspective view showing the external configuration of the controller コントローラの内部構造を示す図Diagram showing the internal structure of the controller コントローラの内部構造を示す図Diagram showing the internal structure of the controller 入力装置の構成を示すブロック図Block diagram showing the configuration of the input device 第1の姿勢および第2の姿勢を示すベクトルを示す図The figure which shows the vector which shows a 1st attitude | position and a 2nd attitude | position 補正量を示すベクトルv3を示す図The figure which shows vector v3 which shows correction amount 第1補正処理による補正後の第1の姿勢を示すベクトルを示す図The figure which shows the vector which shows the 1st attitude | position after correction | amendment by a 1st correction process. 第1の姿勢および第3の姿勢を示すベクトルを示す図The figure which shows the vector which shows a 1st attitude | position and a 3rd attitude | position 第2補正処理による補正後の第1の姿勢を示す図The figure which shows the 1st attitude | position after correction | amendment by a 2nd correction process. ゲーム装置のメインメモリに記憶される主なデータを示す図The figure which shows the main data memorize | stored in the main memory of a game device ゲーム装置において実行される処理の流れを示すメインフローチャートMain flowchart showing the flow of processing executed in the game device 図14に示す第1補正処理(ステップS5)の流れを示すフローチャートFlowchart showing the flow of the first correction process (step S5) shown in FIG. 図14に示す第2補正処理(ステップS6)の流れを示すフローチャートFlowchart showing the flow of the second correction process (step S6) shown in FIG. 撮像画像に対応する2次元座標を示す図The figure which shows the two-dimensional coordinate corresponding to a captured image 所定の仮想空間における入力装置と所定の平面とを示す図The figure which shows the input device and predetermined plane in a predetermined virtual space 図18に示す仮想空間をy軸正方向側から負方向側へ見た図FIG. 18 is a diagram in which the virtual space shown in FIG. 18 is viewed from the y-axis positive direction side to the negative direction side. 図14に示す表示制御処理(ステップS8)の流れを示すフローチャート14 is a flowchart showing the flow of the display control process (step S8) shown in FIG. 入力装置の姿勢と、カメラ向き制御処理によって決められる表示範囲との関係の一例を示す図The figure which shows an example of the relationship between the attitude | position of an input device, and the display range determined by camera direction control processing 図20に示すカメラ向き制御処理(ステップS41)の流れを示すフローチャート20 is a flowchart showing the flow of the camera orientation control process (step S41) shown in FIG. 第1の仮想空間に配置される平面Qを示す図The figure which shows the plane Q arrange | positioned in 1st virtual space 表示対象および仮想カメラが配置される仮想空間を示す図The figure which shows the virtual space where the display object and the virtual camera are arranged 仮想カメラの位置制御に関する第1〜第4の制御方法の例を示す図The figure which shows the example of the 1st-4th control method regarding position control of a virtual camera. 第1の制御方法を採用する場合におけるカメラ位置制御処理(ステップS42)の流れを示すフローチャートThe flowchart which shows the flow of the camera position control process (step S42) in the case of employ | adopting a 1st control method. 第2の制御方法を採用する場合におけるカメラ位置制御処理(ステップS42)の流れを示すフローチャートThe flowchart which shows the flow of the camera position control process (step S42) in the case of employ | adopting a 2nd control method. 第3の制御方法を採用する場合におけるカメラ位置制御処理(ステップS42)の流れを示すフローチャートThe flowchart which shows the flow of the camera position control process (step S42) in the case of employ | adopting a 3rd control method. 第4の制御方法を採用する場合においてゲーム装置のメインメモリに記憶されるゲーム処理用データを示す図The figure which shows the data for game processing memorize | stored in the main memory of a game device in the case of employ | adopting a 4th control method. 第4の制御方法を採用する場合におけるカメラ位置制御処理(ステップS42)の流れを示すフローチャートThe flowchart which shows the flow of the camera position control process (step S42) in the case of employ | adopting a 4th control method. 平面Qにおけるスクロール成分速度Sを示す図The figure which shows the scroll component speed S in the plane Q 第1の方法と第2の方法との比較を示す図The figure which shows the comparison with the 1st method and the 2nd method 第2の方法を採用する場合においてゲーム装置のメインメモリに記憶される主なデータを示す図The figure which shows the main data memorize | stored in the main memory of a game device in the case of employ | adopting a 2nd method. 第2の方法を採る場合においてゲーム装置が実行する処理の流れを示すメインフローチャートThe main flowchart which shows the flow of the process which a game device performs in the case of taking a 2nd method. 図34に示すオフセット決定処理(ステップS41)の流れを示すフローチャート34 is a flowchart showing the flow of the offset determination process (step S41) shown in FIG. 設定画面の一例を示す図Figure showing an example of the setting screen オフセット量の決定方法を示す図Diagram showing how to determine the offset amount 第2の方法における補正方法の変形例を示す図The figure which shows the modification of the correction method in a 2nd method.

[ゲームシステムの全体構成]
図1を参照して、本発明の一実施形態に係る座標算出装置の一例であるゲーム装置を含むゲームシステム1について説明する。図1は、ゲームシステム1の外観図である。以下、据置型のゲーム装置を一例にして、本実施形態のゲーム装置およびゲームプログラムについて説明する。図1において、ゲームシステム1は、テレビジョン受像器(以下、単に「テレビ」と記載する)2、ゲーム装置3、光ディスク4、入力装置8、およびマーカ部6を含む。本システムは、入力装置8を用いたゲーム操作に基づいてゲーム装置3でゲーム処理を実行するものである。
[Overall configuration of game system]
With reference to FIG. 1, a game system 1 including a game apparatus which is an example of a coordinate calculation apparatus according to an embodiment of the present invention will be described. FIG. 1 is an external view of the game system 1. Hereinafter, the game apparatus and the game program of the present embodiment will be described using a stationary game apparatus as an example. In FIG. 1, the game system 1 includes a television receiver (hereinafter simply referred to as “TV”) 2, a game device 3, an optical disk 4, an input device 8, and a marker unit 6. In the present system, game processing is executed by the game device 3 based on a game operation using the input device 8.

ゲーム装置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 game apparatus 3 is detachably inserted into the game apparatus 3. The optical disc 4 stores a game program to be executed on the game apparatus 3. An insertion slot for the optical disk 4 is provided on the front surface of the game apparatus 3. The game apparatus 3 executes a game process by reading and executing a game program stored in the optical disc 4 inserted into the insertion slot.

ゲーム装置3には、表示装置の一例であるテレビ2が接続コードを介して接続される。テレビ2は、ゲーム装置3において実行されるゲーム処理の結果得られるゲーム画像を表示する。また、テレビ2の画面の周辺(図1では画面の上側)には、マーカ部6が設置される。マーカ部6は、その両端に2つのマーカ6Rおよび6Lを備えている。マーカ6R(マーカ6Lも同様)は、具体的には1以上の赤外LEDであり、テレビ2の前方に向かって赤外光を出力する。マーカ部6はゲーム装置3に接続されており、ゲーム装置3はマーカ部6が備える各赤外LEDの点灯を制御することが可能である。   A television 2 which is an example of a display device is connected to the game apparatus 3 via a connection cord. The television 2 displays a game image obtained as a result of the game process executed in the game device 3. In addition, a marker unit 6 is installed around the screen of the television 2 (upper side of the screen in FIG. 1). The marker unit 6 includes two markers 6R and 6L at both ends thereof. The marker 6R (same for the marker 6L) is specifically one or more infrared LEDs, and outputs infrared light toward the front of the television 2. The marker unit 6 is connected to the game apparatus 3, and the game apparatus 3 can control lighting of each infrared LED included in the marker unit 6.

入力装置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 game device 3. In the present embodiment, the input device 8 includes a controller 5 and a gyro sensor unit 7. Although details will be described later, the input device 8 has a configuration in which a gyro sensor unit 7 is detachably connected to the controller 5. The controller 5 and the game apparatus 3 are connected by wireless communication. In the present embodiment, for example, Bluetooth (registered trademark) technology is used for wireless communication between the controller 5 and the game apparatus 3. In other embodiments, the controller 5 and the game apparatus 3 may be connected by wire.

[ゲーム装置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 game apparatus 3 will be described with reference to FIG. FIG. 2 is a block diagram showing a configuration of the game apparatus 3. The game apparatus 3 includes a CPU 10, a system LSI 11, an external main memory 12, a ROM / RTC 13, a disk drive 14, an AV-IC 15 and the like.

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 CPU 10 executes a game process by executing a game program stored on the optical disc 4, and functions as a game processor. The CPU 10 is connected to the system LSI 11. In addition to the CPU 10, an external main memory 12, a ROM / RTC 13, a disk drive 14, and an AV-IC 15 are connected to the system LSI 11. The system LSI 11 performs processing such as control of data transfer between components connected thereto, generation of an image to be displayed, and acquisition of data from an external device. The internal configuration of the system LSI will be described later. The volatile external main memory 12 stores a program such as a game program read from the optical disc 4 or a game program read from the flash memory 17, or stores various data. Used as a work area and buffer area. The ROM / RTC 13 includes a ROM (so-called boot ROM) in which a program for starting the game apparatus 3 is incorporated, and a clock circuit (RTC: Real Time Clock) that counts time. The disk drive 14 reads program data, texture data, and the like from the optical disk 4 and writes the read data to an internal main memory 11e or an external main memory 12 described later.

また、システムLSI11には、入出力プロセッサ(I/Oプロセッサ)11a、GPU(Graphics Processor Unit)11b、DSP(Digital Signal Processor)11c、VRA 1d、および内部メインメモリ11eが設けられる。図示は省略するが、これらの構成要素11a〜11eは内部バスによって互いに接続される。   The system LSI 11 includes an input / output processor (I / O processor) 11a, a GPU (Graphics Processor Unit) 11b, a DSP (Digital Signal Processor) 11c, a VRA 1d, and an internal main memory 11e. Although not shown, these components 11a to 11e are connected to each other by an internal bus.

GPU11bは、描画手段の一部を形成し、CPU10からのグラフィクスコマンド(作画命令)に従って画像を生成する。VRAM11dは、GPU11bがグラフィクスコマンドを実行するために必要なデータ(ポリゴンデータやテクスチャデータ等のデータ)を記憶する。画像が生成される際には、GPU11bは、VRAM11dに記憶されたデータを用いて画像データを作成する。   The GPU 11b forms part of a drawing unit and generates an image according to a graphics command (drawing command) from the CPU 10. The VRAM 11d stores data (data such as polygon data and texture data) necessary for the GPU 11b to execute the graphics command. When an image is generated, the GPU 11b creates image data using data stored in the VRAM 11d.

DSP11cは、オーディオプロセッサとして機能し、内部メインメモリ11eや外部メインメモリ12に記憶されるサウンドデータや音波形(音色)データを用いて、音声データを生成する。   The DSP 11c functions as an audio processor, and generates sound data using sound data and sound waveform (tone color) data stored in the internal main memory 11e and the external main memory 12.

上述のように生成された画像データおよび音声データは、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-IC 15. The AV-IC 15 outputs the read image data to the television 2 via the AV connector 16, and outputs the read audio data to the speaker 2 a built in the television 2. As a result, an image is displayed on the television 2 and a sound is output from the speaker 2a.

入出力プロセッサ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 flash memory 17, the wireless communication module 18, the wireless controller module 19, the expansion connector 20, and the memory card connector 21. An antenna 22 is connected to the wireless communication module 18, and an antenna 23 is connected to the wireless controller module 19.

入出力プロセッサ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 wireless communication module 18 and the antenna 22, and can communicate with other game devices and various servers connected to the network. The input / output processor 11a periodically accesses the flash memory 17 to detect the presence / absence of data that needs to be transmitted to the network. If there is such data, the input / output processor 11a communicates with the network via the wireless communication module 18 and the antenna 22. Send. Further, the input / output processor 11a receives data transmitted from other game devices and data downloaded from the download server via the network, the antenna 22 and the wireless communication module 18, and receives the received data in the flash memory 17. Remember. By executing the game program, the CPU 10 reads out the data stored in the flash memory 17 and uses it in the game program. In the flash memory 17, in addition to data transmitted and received between the game apparatus 3 and other game apparatuses and various servers, save data (game result data or intermediate data) of the game played using the game apparatus 3 May be stored.

また、入出力プロセッサ11aは、コントローラ5から送信される操作データをアンテナ23および無線コントローラモジュール19を介して受信し、内部メインメモリ11eまたは外部メインメモリ12のバッファ領域に記憶(一時記憶)する。   The input / output processor 11a receives operation data transmitted from the controller 5 via the antenna 23 and the wireless controller module 19, and stores (temporarily stores) the data in the buffer area of the internal main memory 11e or the external main memory 12.

さらに、入出力プロセッサ11aには、拡張コネクタ20およびメモリカード用コネクタ21が接続される。拡張コネクタ20は、USBやSCSIのようなインターフェースのためのコネクタであり、外部記憶媒体のようなメディアを接続したり、他のコントローラのような周辺機器を接続したり、有線の通信用コネクタを接続することによって無線通信モジュール18に替えてネットワークとの通信を行ったりすることができる。メモリカード用コネクタ21は、メモリカードのような外部記憶媒体を接続するためのコネクタである。例えば、入出力プロセッサ11aは、拡張コネクタ20やメモリカード用コネクタ21を介して外部記憶媒体にアクセスし、外部記憶媒体にデータを保存したり、外部記憶媒体からデータを読み出したりすることができる。   Further, an expansion connector 20 and a memory card connector 21 are connected to the input / output processor 11a. The expansion connector 20 is a connector for an interface such as USB or SCSI, and connects a medium such as an external storage medium, a peripheral device such as another controller, or a wired communication connector. By connecting, communication with the network can be performed instead of the wireless communication module 18. The memory card connector 21 is a connector for connecting an external storage medium such as a memory card. For example, the input / output processor 11a can access an external storage medium via the expansion connector 20 or the memory card connector 21 to store data in the external storage medium or read data from the external storage medium.

ゲーム装置3には、電源ボタン24、リセットボタン25、およびイジェクトボタン26が設けられる。電源ボタン24およびリセットボタン25は、システムLSI11に接続される。電源ボタン24がオンされると、ゲーム装置3の各構成要素に対して、図示しないACアダプタを経て電源が供給される。リセットボタン25が押されると、システムLSI11は、ゲーム装置3の起動プログラムを再起動する。イジェクトボタン26は、ディスクドライブ14に接続される。イジェクトボタン26が押されると、ディスクドライブ14から光ディスク4が排出される。   The game apparatus 3 is provided with a power button 24, a reset button 25, and an eject button 26. The power button 24 and the reset button 25 are connected to the system LSI 11. When the power button 24 is turned on, power is supplied to each component of the game apparatus 3 via an AC adapter (not shown). When the reset button 25 is pressed, the system LSI 11 restarts the boot program for the game apparatus 3. The eject button 26 is connected to the disk drive 14. When the eject button 26 is pressed, the optical disk 4 is ejected from the disk drive 14.

[入力装置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 controller 5. 3 is a perspective view of the controller 5 as seen from the upper rear side, and FIG. 4 is a perspective view of the controller 5 as seen from the lower front side.

図3および図4において、コントローラ5は、例えばプラスチック成型によって形成されたハウジング31を有している。ハウジング31は、その前後方向(図3に示すZ軸方向)を長手方向とした略直方体形状を有しており、全体として大人や子供の片手で把持可能な大きさである。プレイヤは、コントローラ5に設けられたボタンを押下すること、および、コントローラ5自体を動かしてその位置や姿勢を変えることによってゲーム操作を行うことができる。   3 and 4, the controller 5 includes a housing 31 formed by plastic molding, for example. The housing 31 has a substantially rectangular parallelepiped shape whose longitudinal direction is the front-rear direction (the Z-axis direction shown in FIG. 3), and is a size that can be gripped with one hand of an adult or a child as a whole. The player can perform a game operation by pressing a button provided on the controller 5 and moving the controller 5 itself to change its position and posture.

ハウジング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 housing 31 is provided with a plurality of operation buttons. As shown in FIG. 3, a cross button 32a, a first button 32b, a second button 32c, an A button 32d, a minus button 32e, a home button 32f, a plus button 32g, and a power button 32h are provided on the upper surface of the housing 31. It is done. In the present specification, the upper surface of the housing 31 on which these buttons 32a to 32h are provided may be referred to as a “button surface”. On the other hand, as shown in FIG. 4, a recess is formed on the lower surface of the housing 31, and a B button 32i is provided on the rear inclined surface of the recess. A function corresponding to the game program executed by the game apparatus 3 is appropriately assigned to each of the operation buttons 32a to 32i. The power button 32h is for remotely turning on / off the main body of the game apparatus 3. The home button 32 f and the power button 32 h are embedded in the upper surface of the housing 31. This can prevent the player from pressing the home button 32f or the power button 32h by mistake.

ハウジング31の後面にはコネクタ33が設けられている。コネクタ33は、コントローラ5に他の機器(例えば、ジャイロセンサユニット7や他のコントローラ)を接続するために利用される。また、ハウジング31の後面におけるコネクタ33の両側には、上記他の機器が容易に離脱することを防止するために係止穴33aが設けられている。   A connector 33 is provided on the rear surface of the housing 31. The connector 33 is used to connect another device (for example, the gyro sensor unit 7 or another controller) to the controller 5. Further, locking holes 33a are provided on both sides of the connector 33 on the rear surface of the housing 31 in order to prevent the other devices from being easily detached.

ハウジング31上面の後方には複数(図3では4つ)のLED34a〜34dが設けられる。ここで、コントローラ5には、他のメインコントローラと区別するためにコントローラ種別(番号)が付与される。各LED34a〜34dは、コントローラ5に現在設定されている上記コントローラ種別をプレイヤに通知したり、コントローラ5の電池残量をプレイヤに通知したりする等の目的で用いられる。具体的には、コントローラ5を用いてゲーム操作が行われる際、上記コントローラ種別に応じて複数のLED34a〜34dのいずれか1つが点灯する。   A plurality (four in FIG. 3) of LEDs 34 a to 34 d are provided behind the upper surface of the housing 31. Here, the controller type (number) is assigned to the controller 5 to distinguish it from other main controllers. The LEDs 34a to 34d are used for the purpose of notifying the player of the controller type currently set in the controller 5 and notifying the player of the remaining battery level of the controller 5. Specifically, when a game operation is performed using the controller 5, any one of the plurality of LEDs 34a to 34d is turned on according to the controller type.

また、コントローラ5は撮像情報演算部35(図6)を有しており、図4に示すように、ハウジング31前面には撮像情報演算部35の光入射面35aが設けられる。光入射面35aは、マーカ6Rおよび6Lからの赤外光を少なくとも透過する材質で構成される。   Further, the controller 5 has an imaging information calculation unit 35 (FIG. 6), and a light incident surface 35a of the imaging information calculation unit 35 is provided on the front surface of the housing 31, as shown in FIG. The light incident surface 35a is made of a material that transmits at least infrared light from the markers 6R and 6L.

ハウジング31上面における1番ボタン32bとホームボタン32fとの間には、コントローラ5に内蔵されるスピーカ49(図5)からの音を外部に放出するための音抜き孔31aが形成されている。   Between the first button 32b and the home button 32f on the upper surface of the housing 31, a sound release hole 31a for releasing sound from the speaker 49 (FIG. 5) built in the controller 5 is formed.

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

図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 substrate 30 is fixed inside the housing 31, and operation buttons 32 a to 32 h, LEDs 34 a to 34 d, an acceleration sensor 37, an antenna 45, and a speaker 49 are provided on the upper main surface of the substrate 30. Etc. are provided. These are connected to a microcomputer (microcomputer) 42 (see FIG. 6) by wiring (not shown) formed on the substrate 30 and the like. In the present embodiment, the acceleration sensor 37 is disposed at a position shifted from the center of the controller 5 with respect to the X-axis direction. This makes it easier to calculate the movement of the controller 5 when the controller 5 is rotated about the Z axis. The acceleration sensor 37 is disposed in front of the center of the controller 5 in the longitudinal direction (Z-axis direction). Further, the controller 5 functions as a wireless controller by the wireless module 44 (FIG. 6) and the antenna 45.

一方、図6において、基板30の下主面上の前端縁に撮像情報演算部35が設けられる。撮像情報演算部35は、コントローラ5の前方から順に赤外線フィルタ38、レンズ39、撮像素子40、および画像処理回路41を備えている。これらの部材38〜41はそれぞれ基板30の下主面に取り付けられる。   On the other hand, in FIG. 6, an imaging information calculation unit 35 is provided at the front edge on the lower main surface of the substrate 30. The imaging information calculation unit 35 includes an infrared filter 38, a lens 39, an imaging element 40, and an image processing circuit 41 in order from the front of the controller 5. These members 38 to 41 are respectively attached to the lower main surface of the substrate 30.

さらに、基板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 microcomputer 42 and the vibrator 48 are provided on the lower main surface of the substrate 30. The vibrator 48 is, for example, a vibration motor or a solenoid, and is connected to the microcomputer 42 by wiring formed on the substrate 30 or the like. The controller 48 is vibrated by the operation of the vibrator 48 according to the instruction of the microcomputer 42. As a result, a so-called vibration-compatible game in which the vibration is transmitted to the hand of the player holding the controller 5 can be realized. In the present embodiment, the vibrator 48 is disposed slightly forward of the housing 31. That is, by arranging the vibrator 48 on the end side of the center of the controller 5, the entire controller 5 can be vibrated greatly by the vibration of the vibrator 48. The connector 33 is attached to the rear edge on the lower main surface of the substrate 30. 5 and 6, the controller 5 includes a crystal resonator that generates a basic clock of the microcomputer 42, an amplifier that outputs an audio signal to the speaker 49, and the like.

また、ジャイロセンサユニット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 gyro sensor unit 7 includes gyro sensors (gyro sensors 55 and 56 shown in FIG. 7) that detect angular velocities around three axes. The gyro sensor unit 7 is detachably attached to the connector 33 of the controller 5. A plug (plug 53 shown in FIG. 7) that can be connected to the connector 33 is provided at the front end of the gyro sensor unit 7 (end on the Z-axis positive direction side shown in FIG. 3). Further, hooks (not shown) are provided on both sides of the plug 53. In a state where the gyro sensor unit 7 is attached to the controller 5, the plug 53 is connected to the connector 33 and the hook is locked in the locking hole 33 a of the controller 5. Thereby, the controller 5 and the gyro sensor unit 7 are firmly fixed. The gyro sensor unit 7 has a button 51 on a side surface (surface in the X-axis direction shown in FIG. 3). The button 51 is configured such that when the button 51 is pressed, the hook is released from the locked state with respect to the locking hole 33a. Therefore, the gyro sensor unit 7 can be detached from the controller 5 by removing the plug 53 from the connector 33 while pressing the button 51.

また、ジャイロセンサユニット7の後端には、上記コネクタ33と同形状のコネクタが設けられる。したがって、コントローラ5(のコネクタ33)に対して装着可能な他の機器は、ジャイロセンサユニット7のコネクタに対しても装着可能である。なお、図3においては、当該コネクタに対してカバー52が着脱可能に装着されている。   A connector having the same shape as the connector 33 is provided at the rear end of the gyro sensor unit 7. Therefore, other devices that can be attached to the controller 5 (connector 33 thereof) can also be attached to the connector of the gyro sensor unit 7. In FIG. 3, a cover 52 is detachably attached to the connector.

なお、図3〜図6に示したコントローラ5およびジャイロセンサユニット7の形状や、各操作ボタンの形状、加速度センサやバイブレータの数および設置位置等は単なる一例に過ぎず、他の形状、数、および設置位置であっても、本発明を実現することができる。また、本実施形態では、撮像手段による撮像方向はZ軸正方向であるが、撮像方向はいずれの方向であってもよい。すなわち、コントローラ5における撮像情報演算部35の位置(撮像情報演算部35の光入射面35a)は、ハウジング31の前面でなくてもよく、ハウジング31の外部から光を取り入れることができれば他の面に設けられてもかまわない。   The shapes of the controller 5 and the gyro sensor unit 7 shown in FIGS. 3 to 6, the shapes of the operation buttons, the number of acceleration sensors and vibrators, and the installation positions are merely examples, and other shapes, numbers, Even in the installation position, the present invention can be realized. In the present embodiment, the imaging direction by the imaging unit is the positive Z-axis direction, but the imaging direction may be any direction. That is, the position of the imaging information calculation unit 35 in the controller 5 (the light incident surface 35a of the imaging information calculation unit 35) does not have to be the front surface of the housing 31, and other surfaces can be used as long as light can be taken in from the outside of the housing 31. May be provided.

図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 controller 5 and the gyro sensor unit 7). The controller 5 includes an operation unit 32 (operation buttons 32a to 32i), a connector 33, an imaging information calculation unit 35, a communication unit 36, and an acceleration sensor 37. The controller 5 transmits data indicating the details of the operation performed on the own device to the game apparatus 3 as operation data.

操作部32は、上述した各操作ボタン32a〜32iを含み、各操作ボタン32a〜32iに対する入力状態(各操作ボタン32a〜32iが押下されたか否か)を示す操作ボタンデータを通信部36のマイコン42へ出力する。   The operation unit 32 includes the operation buttons 32a to 32i described above, and the operation button data indicating the input state (whether or not each operation button 32a to 32i is pressed) to each operation button 32a to 32i is transmitted to the microcomputer of the communication unit 36. Output to 42.

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

撮像情報演算部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 information calculation unit 35 includes an infrared filter 38, a lens 39, an imaging element 40, and an image processing circuit 41. The infrared filter 38 passes only infrared rays from the light incident from the front of the controller 5. The lens 39 collects the infrared light transmitted through the infrared filter 38 and makes it incident on the image sensor 40. The image sensor 40 is a solid-state image sensor such as a CMOS sensor or a CCD sensor, for example, and receives the infrared light collected by the lens 39 and outputs an image signal. Here, the markers 6 </ b> R and 6 </ b> L of the marker unit 6 disposed in the vicinity of the display screen of the television 2 are configured by infrared LEDs that output infrared light toward the front of the television 2. Therefore, by providing the infrared filter 38, the image sensor 40 receives only the infrared light that has passed through the infrared filter 38 and generates image data, so that the images of the markers 6R and 6L can be captured more accurately. Hereinafter, an image captured by the image sensor 40 is referred to as a captured image. Image data generated by the image sensor 40 is processed by the image processing circuit 41. The image processing circuit 41 calculates the position of the imaging target (markers 6R and 6L) in the captured image. The image processing circuit 41 outputs coordinates indicating the calculated position to the microcomputer 42 of the communication unit 36. The coordinate data is transmitted to the game apparatus 3 as operation data by the microcomputer 42. Hereinafter, the coordinates are referred to as “marker coordinates”. Since the marker coordinates change corresponding to the direction (tilt angle) and position of the controller 5 itself, the game apparatus 3 can calculate the direction and position of the controller 5 using the marker coordinates.

なお、他の実施形態においては、コントローラ5は画像処理回路41を備えていない構成であってもよく、撮像画像自体がコントローラ5からゲーム装置3へ送信されてもよい。このとき、ゲーム装置3は、画像処理回路41と同様の機能を有する回路あるいはプログラムを有しており、上記マーカ座標を算出するようにしてもよい。   In other embodiments, the controller 5 may not include the image processing circuit 41, and the captured image itself may be transmitted from the controller 5 to the game apparatus 3. At this time, the game apparatus 3 may have a circuit or a program having the same function as the image processing circuit 41, and may calculate the marker coordinates.

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

本実施形態では、加速度センサ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 acceleration sensor 37 has a vertical direction (Y-axis direction shown in FIG. 3), a horizontal direction (X-axis direction shown in FIG. 3), and a front-back direction (Z-axis direction shown in FIG. 3) with reference to the controller 5. ) Linear acceleration is detected in each of the three axis directions. Since the acceleration sensor 37 detects acceleration in the linear direction along each axis, the output from the acceleration sensor 37 represents the linear acceleration value of each of the three axes. That is, the detected acceleration is represented as a three-dimensional vector (ax, ay, az) in an XYZ coordinate system (controller coordinate system) set with reference to the input device 8 (controller 5). Hereinafter, a vector having the respective acceleration values related to the three axes detected by the acceleration sensor 37 as components is referred to as an acceleration vector.

加速度センサ37が検出した加速度を示すデータ(加速度データ)は、通信部36へ出力される。なお、加速度センサ37が検出した加速度は、コントローラ5自体の向き(傾斜角度)や動きに対応して変化するので、ゲーム装置3は取得された加速度データを用いてコントローラ5の向きや動きを算出することができる。本実施形態では、ゲーム装置3は、取得された加速度データに基づいてコントローラ5の姿勢や傾斜角度等を算出する。   Data indicating the acceleration detected by the acceleration sensor 37 (acceleration data) is output to the communication unit 36. The acceleration detected by the acceleration sensor 37 changes in accordance with the direction (tilt angle) and movement of the controller 5 itself, so the game apparatus 3 calculates the direction and movement of the controller 5 using the acquired acceleration data. can do. In the present embodiment, the game apparatus 3 calculates the attitude, tilt angle, and the like of the controller 5 based on the acquired acceleration data.

なお、加速度センサ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 acceleration sensor 37, a computer such as a processor (for example, the CPU 10) of the game apparatus 3 or a processor (for example, the microcomputer 42) of the controller 5 performs processing, whereby further information regarding the controller 5 is obtained. Those skilled in the art will be able to easily understand from the description of the present specification that can be estimated or calculated (determined). For example, when processing on the computer side is executed on the assumption that the controller 5 on which the acceleration sensor 37 is mounted is stationary (that is, the processing is executed assuming that the acceleration detected by the acceleration sensor is only gravitational acceleration). When the controller 5 is actually stationary, it can be determined whether or not the attitude of the controller 5 is inclined with respect to the direction of gravity based on the detected acceleration. Specifically, whether or not the controller 5 is inclined with respect to the reference depending on whether or not 1G (gravity acceleration) is applied, based on the state in which the detection axis of the acceleration sensor 37 is directed vertically downward. It is possible to know how much it is inclined with respect to the reference according to its size. Further, in the case of the multi-axis acceleration sensor 37, it is possible to know in detail how much the controller 5 is inclined with respect to the direction of gravity by further processing the acceleration signal of each axis. . In this case, the processor may calculate the tilt angle of the controller 5 based on the output from the acceleration sensor 37, or may calculate the tilt direction of the controller 5 without calculating the tilt angle. Good. Thus, by using the acceleration sensor 37 in combination with the processor, the tilt angle or posture of the controller 5 can be determined.

一方、コントローラ5が動的な状態(コントローラ5が動かされている状態)であることを前提とする場合には、加速度センサ37は重力加速度に加えてコントローラ5の動きに応じた加速度を検出するので、検出された加速度から重力加速度の成分を所定の処理により除去することによってコントローラ5の動き方向を知ることができる。また、コントローラ5が動的な状態であることを前提とする場合であっても、検出された加速度から、加速度センサの動きに応じた加速度の成分を所定の処理により除去することによって、重力方向に対するコントローラ5の傾きを知ることが可能である。なお、他の実施例では、加速度センサ37は、内蔵の加速度検出手段で検出された加速度信号をマイコン42に出力する前に当該加速度信号に対して所定の処理を行うための、組込み式の処理装置または他の種類の専用の処理装置を備えていてもよい。組込み式または専用の処理装置は、例えば、加速度センサ37が静的な加速度(例えば、重力加速度)を検出するために用いられる場合、加速度信号を傾斜角(あるいは、他の好ましいパラメータ)に変換するものであってもよい。   On the other hand, when it is assumed that the controller 5 is in a dynamic state (a state in which the controller 5 is moved), the acceleration sensor 37 detects an acceleration corresponding to the movement of the controller 5 in addition to the gravitational acceleration. Therefore, the movement direction of the controller 5 can be known by removing the gravitational acceleration component from the detected acceleration by a predetermined process. Even if it is assumed that the controller 5 is in a dynamic state, the direction of gravity is obtained by removing the acceleration component corresponding to the movement of the acceleration sensor from the detected acceleration by a predetermined process. It is possible to know the inclination of the controller 5 with respect to. In another embodiment, the acceleration sensor 37 is a built-in process for performing a predetermined process on the acceleration signal before outputting the acceleration signal detected by the built-in acceleration detection means to the microcomputer 42. An apparatus or other type of dedicated processing apparatus may be provided. A built-in or dedicated processing device converts the acceleration signal into a tilt angle (or other preferred parameter) if, for example, the acceleration sensor 37 is used to detect static acceleration (eg, gravitational acceleration). It may be a thing.

通信部36は、マイコン42、メモリ43、無線モジュール44、およびアンテナ45を含んでいる。マイコン42は、処理を行う際にメモリ43を記憶領域として用いながら、マイコン42が取得したデータをゲーム装置3へ無線送信する無線モジュール44を制御する。また、マイコン42はコネクタ33に接続されている。ジャイロセンサユニット7から送信されてくるデータは、コネクタ33を介してマイコン42に入力される。以下、ジャイロセンサユニット7の構成について説明する。   The communication unit 36 includes a microcomputer 42, a memory 43, a wireless module 44, and an antenna 45. The microcomputer 42 controls the wireless module 44 that wirelessly transmits data acquired by the microcomputer 42 to the game apparatus 3 while using the memory 43 as a storage area when performing processing. The microcomputer 42 is connected to the connector 33. Data transmitted from the gyro sensor unit 7 is input to the microcomputer 42 via the connector 33. Hereinafter, the configuration of the gyro sensor unit 7 will be described.

ジャイロセンサユニット7は、プラグ53、マイコン54、2軸ジャイロセンサ55、および1軸ジャイロセンサ56を備えている。上述のように、ジャイロセンサユニット7は、3軸(本実施形態では、XYZ軸)周りの角速度を検出し、検出した角速度を示すデータ(角速度データ)をコントローラ5へ送信する。   The gyro sensor unit 7 includes a plug 53, a microcomputer 54, a 2-axis gyro sensor 55, and a 1-axis gyro sensor 56. As described above, the gyro sensor unit 7 detects angular velocities around the three axes (in this embodiment, the XYZ axes), and transmits data (angular velocity data) indicating the detected angular velocities to the controller 5.

2軸ジャイロセンサ55は、X軸周りの角速度およびZ軸周りの(単位時間あたりの)角速度を検出する。また、1軸ジャイロセンサ56は、Y軸周りの(単位時間あたりの)角速度を検出する。なお、本明細書では、コントローラ5の撮像方向(Z軸正方向)を基準として、XYZ軸周りの回転方向を、それぞれ、ピッチ方向、ヨー方向、ロール方向と呼ぶ。すなわち、2軸ジャイロセンサ55は、ピッチ方向(X軸周りの回転方向)およびロール方向(Z軸周りの回転方向)の角速度を検出し、1軸ジャイロセンサ56は、ヨー方向(Y軸周りの回転方向)の角速度を検出する。   The biaxial gyro sensor 55 detects an angular velocity around the X axis and an angular velocity (per unit time) around the Z axis. Further, the uniaxial gyro sensor 56 detects an angular velocity (per unit time) around the Y axis. In this specification, the rotation directions around the XYZ axes are referred to as a pitch direction, a yaw direction, and a roll direction, respectively, with reference to the imaging direction (Z-axis positive direction) of the controller 5. That is, the biaxial gyro sensor 55 detects angular velocities in the pitch direction (rotation direction around the X axis) and the roll direction (rotation direction around the Z axis), and the single axis gyro sensor 56 detects the yaw direction (around the Y axis). Detect the angular velocity in the rotation direction.

なお、本実施形態では、3軸回りの角速度を検出するために、2軸ジャイロセンサ55と1軸ジャイロセンサ56とを用いる構成としたが、他の実施形態においては、3軸回りの角速度を検出することができればよく、用いるジャイロセンサの数および組み合わせはどのようなものであってもよい。   In this embodiment, the 2-axis gyro sensor 55 and the 1-axis gyro sensor 56 are used to detect the angular velocity around the three axes. However, in other embodiments, the angular velocity around the three axes is Any number and combination of gyro sensors may be used as long as they can be detected.

また、本実施形態では、後述する姿勢算出処理における計算を容易にする目的で、各ジャイロセンサ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 gyro sensors 55 and 56 detect the angular velocity are the three axes (XYZ) where the acceleration sensor 37 detects the acceleration. Axis). However, in other embodiments, the three axes for detecting the angular velocities by the gyro sensors 56 and 57 and the three axes for detecting the acceleration by the acceleration sensor 37 may not coincide with each other.

各ジャイロセンサ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 gyro sensors 56 and 57 is output to the microcomputer 54. Accordingly, the microcomputer 54 receives data indicating the angular velocity around the three axes of the XYZ axes. The microcomputer 54 transmits data indicating the angular velocities around the three axes as angular velocity data to the controller 5 via the plug 53. Although transmission from the microcomputer 54 to the controller 5 is sequentially performed every predetermined cycle, since the game processing is generally performed in units of 1/60 seconds (one frame time), this time Transmission is preferably performed in the following cycle.

コントローラ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 controller 5, the data output from the operation unit 32, the imaging information calculation unit 35, and the acceleration sensor 37 to the microcomputer 42 and the data transmitted from the gyro sensor unit 7 to the microcomputer 42 are temporarily stored. Stored in the memory 43. These data are transmitted to the game apparatus 3 as the operation data. That is, the microcomputer 42 outputs the operation data stored in the memory 43 to the wireless module 44 when the transmission timing to the wireless controller module 19 of the game apparatus 3 arrives. The wireless module 44 modulates a carrier wave of a predetermined frequency with operation data using, for example, Bluetooth (registered trademark) technology, and radiates a weak radio signal from the antenna 45. That is, the operation data is modulated by the wireless module 44 into a weak radio signal and transmitted from the controller 5. The weak radio signal is received by the wireless controller module 19 on the game apparatus 3 side. By demodulating and decoding the received weak radio signal, the game apparatus 3 can acquire operation data. And CPU10 of the game device 3 performs a game process based on the acquired operation data and a game program. Note that the wireless transmission from the communication unit 36 to the wireless controller module 19 is sequentially performed at predetermined intervals, but the game processing is generally performed in units of 1/60 seconds (one frame time). Therefore, it is preferable to perform transmission at a period equal to or shorter than this time. The communication unit 36 of the controller 5 outputs each operation data to the wireless controller module 19 of the game apparatus 3 at a rate of once every 1/200 seconds, for example.

上記コントローラ5を用いることによって、プレイヤは、各操作ボタンを押下する従来の一般的なゲーム操作に加えて、コントローラ5を任意の傾斜角度に傾ける操作を行うことができる。その他、上記コントローラ5によれば、プレイヤは、コントローラ5によって画面上の任意の位置を指示する操作、および、コントローラ5自体を動かす操作を行うこともできる。   By using the controller 5, the player can perform an operation of tilting the controller 5 to an arbitrary tilt angle in addition to the conventional general game operation of pressing each operation button. In addition, according to the controller 5, the player can also perform an operation of instructing an arbitrary position on the screen by the controller 5 and an operation of moving the controller 5 itself.

[姿勢算出処理の概要]
次に、図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 game apparatus 3 will be described. In the present embodiment, the game apparatus 3 acquires data (operation data) from the input device 8 including the gyro sensors 55 and 56, the acceleration sensor 37, and the imaging means (imaging element 40). Calculate the posture. In the present embodiment, the input device 8 is configured to include both the acceleration sensor 37 and the image sensor 40. However, in other embodiments, the input device 8 includes only one of the acceleration sensor 37 and the image sensor 40. It may be a configuration.

ゲーム装置3は、(1)姿勢算出手段と、(2)第1補正手段と、(3)第2補正手段とを備えている。本実施形態においては、これら各手段は、ゲーム装置3のコンピュータ(CPU10)によって実行されるゲームプログラム(座標算出プログラム)が、当該コンピュータを当該各手段として機能させることによって実現される。なお、他の実施形態においては、上記各手段の一部または全部は、ゲーム装置3が備える専用回路として実現されてもよい。   The game apparatus 3 includes (1) posture calculation means, (2) first correction means, and (3) second correction means. In the present embodiment, these means are realized by causing a game program (coordinate calculation program) executed by the computer (CPU 10) of the game apparatus 3 to function as the means. In other embodiments, part or all of the above means may be realized as a dedicated circuit included in the game apparatus 3.

(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 gyro sensors 55 and 56 (step S4 described later). Any method may be used to calculate the posture from the angular velocity. For example, there is a method of sequentially adding the angular velocity (per unit time) to the initial posture. That is, the current posture can be calculated by integrating the angular velocities sequentially output from the gyro sensors 55 and 56 and calculating the amount of change in posture from the initial state from the integration result. In the following, the posture of the input device 8 calculated from the angular velocity by the posture calculation means is referred to as a “first posture”. However, the posture after the first posture is corrected is also referred to as the first posture.

ここで、ジャイロセンサ55および56が検出する角速度を用いて算出される上記第1の姿勢には、ジャイロセンサ55および56の誤検知が原因で、入力装置8の実際の姿勢との間に誤差が生じることがある。そこで、本実施形態では、ゲーム装置3は、加速度センサ37によって検出される加速度を用いて上記第1の姿勢を補正する。また、撮像素子40によって撮像される画像(撮像画像)を用いて上記第1の姿勢を補正する。   Here, the first posture calculated using the angular velocities detected by the gyro sensors 55 and 56 has an error between the actual posture of the input device 8 due to erroneous detection of the gyro sensors 55 and 56. May occur. Therefore, in the present embodiment, the game apparatus 3 corrects the first posture using the acceleration detected by the acceleration sensor 37. Further, the first posture is corrected using an image (captured image) captured by the image sensor 40.

(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 controller 5 is in the first posture (that is, the negative Y-axis direction shown in FIGS. 3 to 5). It shows the orientation in the system. When the posture of the input device 8 is in the basic state, the vector indicating the posture matches the vector G. Therefore, the vector v1 corresponds to the first posture in the spatial coordinate system. The first posture can also be expressed as a rotation made by the vector v1 with respect to the vector G, and is shown as an angle θ1 in the two-dimensional FIG. Since the first posture is calculated based on the angular velocity, the vector v1 is calculated by adding the angular velocity to the previous posture and rotating the vector v1. The second posture is calculated based on the acceleration data. A vector v2 shown in FIG. 8A indicates the direction of acceleration indicated by the acceleration data (the direction of acceleration in the view coordinate system). However, the acceleration data is an acceleration applied to the input device 8, and what can be acquired is a vector in a coordinate system based on the input device 8. FIG. 8B shows the relationship between the acceleration sensor axis and the acceleration vector. As shown in FIG. 8B, when the angle formed by the acceleration vector v0 acquired from the acceleration sensor and the Y-axis negative direction of the sensor is θ2, the vector v1 in the spatial coordinate system of FIG. A vector v2 obtained by adding the rotation θ2 to the acceleration vector in the spatial coordinate system. Since the second posture is “the posture of the input device 8 when the acceleration direction indicated by the acceleration data is regarded as being vertically downward” as described above, the rotation of the angle θ2 from the vector v2 to the vector v1 is performed. Becomes the second posture. If the second posture is represented by a downward vector of the input device 8 in the spatial coordinate system as a vector v1, it can be represented as a vector v2 'obtained by rotating the vector G by θ2. In the case of a three-dimensional posture, it can be expressed by a three-dimensional rotation matrix or the like. When the first posture is correctly calculated from the angular velocity and the acceleration data accurately indicates the direction of gravity, the direction of the vector v2 indicating the direction of acceleration is the vertical downward direction of the spatial coordinate system, that is, gravity. Match the direction. That is, when the first posture is not correctly calculated from the angular velocity, or when the acceleration data does not indicate the correct gravity direction, the vector v2 indicating the direction of acceleration and the gravity as shown in FIG. The direction vector G is different. In a situation where the direction indicated by the acceleration data is assumed to coincide with the direction of gravity, such as in a stationary state, the vector v2 is more accurate as data corresponding to the attitude of the input device 8 than the vector v1. It is considered a thing. Even when the input device is not stationary, taking into account the accuracy of the average posture within a certain period of time, the acceleration vector will be close to the direction of gravity on average, so that the error may increase with time. It can be considered more reliable than the posture calculated from the accumulated angular velocity. On the other hand, if the correct posture has been calculated at the previous calculation timing, the posture at the next calculation timing is calculated more accurately using the angular velocity than the acceleration. it is conceivable that. In other words, the posture calculation based on the angular velocity has a smaller error for each timing than the calculation based on the acceleration, but the error increases with time, while the posture calculation based on the acceleration may have a larger error for each timing. Since it can be calculated at each timing, it has a feature that no error is accumulated. Therefore, the first correction unit performs correction in consideration of both the first posture and the second posture.

第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 marker unit 6 are determined in advance, the orientation of the input device 8 can be relatively calculated based on the orientation and position of the marker in the image. Assuming that the third posture represents the correct posture, when the first posture is correctly calculated from the angular velocity, the vector v1 indicating the first posture indicates the third posture. It matches the vector v4. That is, when the first posture is not correctly calculated from the angular velocity, the vector v1 indicating the first posture and the vector v4 indicating the third posture are different as shown in FIG.

第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 marker unit 6. In this case, the second correction unit cannot perform the second correction process. Therefore, if the second correction unit performs correction so that the corrected first posture matches the third posture, the second correction processing is performed from a state where the second correction processing cannot be performed. There is a possibility that the first posture may change abruptly when transitioning to a state where it is possible to do so. Thus, if the first posture suddenly changes without conforming to the player's intention, the player feels uncomfortable with the operation (even if the corrected posture is accurate). In order to prevent such a sudden change, in the present embodiment, correction is performed so that the first posture approaches the third posture at a predetermined rate. As a result, it is possible to prevent the first posture from changing suddenly, thereby preventing the player from feeling uncomfortable with the operation. However, in other embodiments, such as when the input device 8 can be assumed to be used in a posture in which the imaging unit can always image the marker unit 6, the second correction unit is the corrected first unit. You may correct | amend so that this attitude | position may correspond with a 3rd attitude | position.

なお、本実施形態では、ゲーム装置3は、第1補正処理と第2補正処理との両方を実行するが、他の実施形態においては、第1補正処理と第2補正処理とのいずれか一方のみを実行するようにしてもよい。また、本実施形態においては、ゲーム装置3は、第1補正処理を先に行い、第2補正処理を後に行うこととするが、第1補正処理と第2補正処理とのいずれを先に行うようにしてもよい。   In the present embodiment, the game apparatus 3 executes both the first correction process and the second correction process, but in other embodiments, one of the first correction process and the second correction process. May be executed only. In the present embodiment, the game apparatus 3 performs the first correction process first and the second correction process later, but either the first correction process or the second correction process is performed first. You may do it.

以上のように、本実施形態によれば、ジャイロセンサ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 gyro sensors 55 and 56 is corrected using the acceleration detected by the acceleration sensor 37, and imaging is performed. Correction is performed using the image captured by the means. Thereby, the error of the attitude calculated from the gyro sensor can be reduced, and the attitude of the input device 8 can be calculated more accurately.

なお、加速度センサ37の検出結果からは、重力方向を軸とした回転(ヨー方向の回転)を検知することはできないので、第1補正手段による補正は、ヨー方向に関しては行うことができない。しかし、加速度センサ37の検出結果を用いた補正は、入力装置8の姿勢がどのような姿勢であっても(常に加速度を検出することができるので)可能であるという特長を有する。一方、入力装置8の撮像方向にマーカ部6がなければマーカ座標が検出されないので、第2補正手段による補正は、入力装置8の姿勢によっては行うことができない。しかし、撮像画像を用いた補正は、姿勢(特にロール方向の姿勢)を正確に算出することができるという特長を有する。本実施形態においては、このように特長の異なる2種類の補正を行うことによって、入力装置8の姿勢をより正確に算出することができる。   In addition, from the detection result of the acceleration sensor 37, the rotation around the gravity direction (rotation in the yaw direction) cannot be detected, and therefore the correction by the first correction unit cannot be performed in the yaw direction. However, the correction using the detection result of the acceleration sensor 37 has a feature that the posture of the input device 8 can be any posture (because acceleration can always be detected). On the other hand, if the marker unit 6 is not present in the imaging direction of the input device 8, the marker coordinates are not detected, and therefore the correction by the second correction unit cannot be performed depending on the attitude of the input device 8. However, the correction using the captured image has a feature that the posture (especially the posture in the roll direction) can be accurately calculated. In the present embodiment, the posture of the input device 8 can be calculated more accurately by performing two types of corrections having different features as described above.

[ゲーム装置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 game apparatus 3 will be described. First, main data used in the processing in the game apparatus 3 will be described with reference to FIG. FIG. 13 is a diagram illustrating main data stored in the main memory (the external main memory 12 or the internal main memory 11e) of the game apparatus 3. As shown in FIG. 13, a game program 60, operation data 62, and game processing data 67 are stored in the main memory of the game apparatus 3. In addition to the data shown in FIG. 13, the main memory stores data necessary for game processing, such as image data of various objects appearing in the game and data indicating various parameters of the objects.

ゲームプログラム60は、ゲーム装置3に電源が投入された後の適宜のタイミングで光ディスク4からその一部または全部が読み込まれてメインメモリに記憶される。ゲームプログラム60には、座標算出プログラム61が含まれる。座標算出プログラム61は、入力装置8の姿勢を算出し、算出された姿勢に基づいて(テレビ2の画面上における)2次元座標を算出する処理を実行するためのプログラムである。   A part or all of the game program 60 is read from the optical disc 4 and stored in the main memory at an appropriate timing after the game apparatus 3 is turned on. The game program 60 includes a coordinate calculation program 61. The coordinate calculation program 61 is a program for calculating the attitude of the input device 8 and executing processing for calculating two-dimensional coordinates (on the screen of the television 2) based on the calculated attitude.

操作データ62は、コントローラ5からゲーム装置3へ送信されてくる操作データである。上述したように、コントローラ5からゲーム装置3へ1/200秒に1回の割合で操作データが送信されるので、メインメモリに記憶される操作データ62はこの割合で更新される。本実施形態においては、メインメモリには、最新の(最後に取得された)操作データのみが記憶されればよい。   The operation data 62 is operation data transmitted from the controller 5 to the game apparatus 3. As described above, since the operation data is transmitted from the controller 5 to the game apparatus 3 at a rate of once every 1/200 seconds, the operation data 62 stored in the main memory is updated at this rate. In the present embodiment, only the latest (last acquired) operation data may be stored in the main memory.

操作データ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 operation data 62 includes angular velocity data 63, acceleration data 64, marker coordinate data 65, and operation button data 66. The angular velocity data 63 is data indicating angular velocities detected by the gyro sensors 55 and 56 of the gyro sensor unit 7. Here, the angular velocity data 63 indicates the respective angular velocities around the three axes of XYZ shown in FIG. The acceleration data 64 is data indicating the acceleration (acceleration vector) detected by the acceleration sensor 37. Here, the acceleration data 64 represents a three-dimensional acceleration vector Va1 having as components the accelerations in the directions of the three axes of XYZ shown in FIG. In the present embodiment, the magnitude of the acceleration vector Va1 detected by the acceleration sensor 37 while the controller 5 is stationary is “1”. That is, the magnitude of gravitational acceleration detected by the acceleration sensor 37 is “1”.

マーカ座標データ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 data 65 is data indicating coordinates calculated by the image processing circuit 41 of the imaging information calculation unit 35, that is, the marker coordinates. The marker coordinates are expressed in a two-dimensional coordinate system (x′y ′ coordinate system shown in FIG. 17) for representing a position on a plane corresponding to the captured image. Note that, when the two markers 6R and 6L are imaged by the imaging element 40, two marker coordinates are calculated. On the other hand, if either one of the markers 6R and 6L is not located within the imageable range of the image sensor 40, only one marker is imaged by the image sensor 40, and only one marker coordinate is calculated. Further, when both of the markers 6R and 6L are not located within the image capturing range of the image sensor 40, the marker is not imaged by the image sensor 40, and the marker coordinates are not calculated. Therefore, the marker coordinate data 65 may indicate two marker coordinates, may indicate one marker coordinate, or may indicate that there is no marker coordinate.

操作ボタンデータ66は、各操作ボタン32a〜32iに対する入力状態を示すデータである。   The operation button data 66 is data indicating an input state for each of the operation buttons 32a to 32i.

ゲーム処理用データ67は、後述するゲーム処理(図14)において用いられるデータである。ゲーム処理用データ67は、第1姿勢データ68、加速度大きさデータ69、補正度データ70、補正量ベクトルデータ71、補正行列データ72、ロール姿勢成分データ73、ヨー姿勢成分データ74、ピッチ姿勢成分データ75、第3姿勢データ76、仮想面座標データ77、はみ出しベクトルデータ78、カメラ向きデータ79、カメラ位置データ80、およびカーソル位置データ81を含む。なお、図13に示すデータの他、ゲーム処理用データ67は、ゲーム処理において用いられる各種データ(ゲームパラメータを示すデータ等)を含む。   The game process data 67 is data used in a game process (FIG. 14) described later. The game processing data 67 includes first posture data 68, acceleration magnitude data 69, correction degree data 70, correction amount vector data 71, correction matrix data 72, roll posture component data 73, yaw posture component data 74, pitch posture component. Data 75, third attitude data 76, virtual plane coordinate data 77, protrusion vector data 78, camera orientation data 79, camera position data 80, and cursor position data 81 are included. In addition to the data shown in FIG. 13, the game processing data 67 includes various data (data indicating game parameters, etc.) used in the game processing.

第1姿勢データ68は、角速度データ63を用いて算出される上記第1の姿勢を示すデータである。本実施形態では、第1の姿勢は、以下の式(1)に示す3×3の行列M1で表現される。

Figure 2011138295
上記行列M1は、所定の基準姿勢から現在の入力装置8の姿勢への回転を表す回転行列である。以下では、第1の姿勢を示す行列M1を、「第1姿勢行列M1」と呼ぶ。なお、第1姿勢行列M1により表される第1の姿勢は、入力装置8が存在する空間の所定位置を基準としたxyz座標系(上記空間座標系)における姿勢である。ここでは、xyz座標系は、入力装置8がマーカ部6の正面に位置することを前提とし、入力装置8の位置からマーカ部6を向く方向をz軸正方向とし、鉛直上向き(重力方向の逆方向)をy軸正方向とし、入力装置8の位置からマーカ部6を向いた場合の左方向をx軸正方向とした座標系であるとする。ここでは、上記所定の基準姿勢は、マーカ部6の正面に位置する入力装置8の撮像方向がマーカ部6の中央を向き、かつ、コントローラ5のボタン面が鉛直上向きとなる姿勢(すなわち、入力装置8を基準としたX軸、Y軸、Z軸が、それぞれx軸、y軸、z軸の向きと一致する姿勢)であるとする。なお、本実施形態では、行列を用いて第1の姿勢を表現することとしたが、他の実施形態においては、第1の姿勢は、3次のベクトルまたは3つの角度によって表現されてもよい。 The first attitude data 68 is data indicating the first attitude calculated using the angular velocity data 63. In the present embodiment, the first posture is expressed by a 3 × 3 matrix M1 shown in the following equation (1).
Figure 2011138295
The matrix M1 is a rotation matrix representing the rotation from a predetermined reference posture to the current input device 8 posture. Hereinafter, the matrix M1 indicating the first posture is referred to as a “first posture matrix M1”. Note that the first posture represented by the first posture matrix M1 is a posture in the xyz coordinate system (the spatial coordinate system) with reference to a predetermined position in the space where the input device 8 exists. Here, the xyz coordinate system is based on the premise that the input device 8 is located in front of the marker unit 6, and the direction from the input device 8 toward the marker unit 6 is the z-axis positive direction, and is vertically upward (in the gravitational direction). It is assumed that the coordinate system is such that the reverse direction) is the y-axis positive direction and the left direction when facing the marker unit 6 from the position of the input device 8 is the x-axis positive direction. Here, the predetermined reference posture is a posture in which the imaging direction of the input device 8 located in front of the marker unit 6 faces the center of the marker unit 6 and the button surface of the controller 5 is vertically upward (that is, input) Assume that the X axis, the Y axis, and the Z axis with respect to the device 8 are postures that coincide with the directions of the x axis, the y axis, and the z axis, respectively. In the present embodiment, the first posture is expressed using a matrix. However, in other embodiments, the first posture may be expressed by a cubic vector or three angles. .

加速度大きさデータ69は、加速度データ64により示される加速度ベクトルVa1の大きさ(長さ)Lを示すデータである。   The acceleration magnitude data 69 is data indicating the magnitude (length) L of the acceleration vector Va1 indicated by the acceleration data 64.

補正度データ70は、第2の姿勢を用いて第1の姿勢を補正する度合(補正度A)を示すデータである。補正度Aは、0≦A≦C1(C1は、0<C1≦1の所定の定数)の範囲を取り得る値である。詳細は後述するが、補正後の第1の姿勢は、補正度Aの値が大きいほど第2の姿勢に近くなる。   The correction degree data 70 is data indicating the degree of correction of the first attitude using the second attitude (correction degree A). The correction degree A is a value that can take a range of 0 ≦ A ≦ C1 (C1 is a predetermined constant of 0 <C1 ≦ 1). Although details will be described later, the corrected first posture becomes closer to the second posture as the correction degree A is larger.

補正量ベクトルデータ71は、第1の姿勢を補正する補正量を示すベクトル(図9に示すベクトルv3。以下、補正量ベクトルと呼ぶ。)を示すデータである。補正量ベクトルVgは、上記加速度ベクトルVa1を上記xyz座標系で表したベクトルVa2と、上記補正度Aとに基づいて算出される。   The correction amount vector data 71 is data indicating a vector indicating a correction amount for correcting the first posture (vector v3 shown in FIG. 9; hereinafter referred to as a correction amount vector). The correction amount vector Vg is calculated based on the vector Va2 representing the acceleration vector Va1 in the xyz coordinate system and the correction degree A.

補正行列データ72は、第1の姿勢を補正するために用いる回転行列(補正行列と呼ぶ)Maを示すデータである。つまり、第1補正処理においては、第1の姿勢を表す第1姿勢行列M1に補正行列Maを掛けることで第1の姿勢が補正される。補正行列Maは、上記ベクトルVa2と上記補正量ベクトルVgとに基づいて算出される。   The correction matrix data 72 is data indicating a rotation matrix (referred to as a correction matrix) Ma used for correcting the first posture. That is, in the first correction process, the first posture is corrected by multiplying the first posture matrix M1 representing the first posture by the correction matrix Ma. The correction matrix Ma is calculated based on the vector Va2 and the correction amount vector Vg.

ロール姿勢成分データ73は、上記撮像対象の画像から算出される第3の姿勢に含まれる姿勢成分のうち、ロール方向に関する姿勢成分(ロール姿勢成分)M3rを示すデータである。また、ヨー姿勢成分データ74は、上記第3の姿勢に含まれる姿勢成分のうち、ヨー方向に関する姿勢成分(ヨー姿勢成分)M3yを示すデータであり、ピッチ姿勢成分データ75は、上記第3の姿勢に含まれる姿勢成分のうち、ピッチ方向に関する姿勢成分(ピッチ姿勢成分)M3pを示すデータである。なお、ここで言うロール方向、ヨー方向、およびピッチ方向とは、入力装置8の撮像方向(Z軸正方向)を基準とした場合の回転方向である。本実施形態においては、各姿勢成分M3r、M3y、およびM3pは、第1の姿勢と同様、3×3の行列で表現される。   The roll posture component data 73 is data indicating a posture component (roll posture component) M3r related to the roll direction among the posture components included in the third posture calculated from the image to be captured. The yaw posture component data 74 is data indicating the posture component (yaw posture component) M3y related to the yaw direction among the posture components included in the third posture, and the pitch posture component data 75 is the third posture information. Among the posture components included in the posture, this is data indicating a posture component (pitch posture component) M3p related to the pitch direction. Note that the roll direction, yaw direction, and pitch direction referred to here are rotation directions when the imaging direction (Z-axis positive direction) of the input device 8 is used as a reference. In the present embodiment, each of the posture components M3r, M3y, and M3p is represented by a 3 × 3 matrix as in the first posture.

第3姿勢データ76は、上記撮像対象の画像から算出される第3の姿勢を示すデータである。本実施形態では、第3の姿勢は、第1の姿勢と同様、3×3の行列M3で表現される。以下では、第3の姿勢を示す行列M3を「第3姿勢行列M3」と呼ぶ。本実施形態では、入力装置8から操作データとしてマーカ座標データが送信されてくるので、第3姿勢行列M3は、マーカ座標データ65に基づいて算出される。具体的には、第3姿勢行列M3は、上記各姿勢成分M3r、M3y、およびM3pを合成することによって得られる。   The third attitude data 76 is data indicating a third attitude calculated from the image to be imaged. In the present embodiment, the third posture is represented by a 3 × 3 matrix M3, like the first posture. Hereinafter, the matrix M3 indicating the third posture is referred to as a “third posture matrix M3”. In the present embodiment, since the marker coordinate data is transmitted as operation data from the input device 8, the third posture matrix M <b> 3 is calculated based on the marker coordinate data 65. Specifically, the third posture matrix M3 is obtained by combining the posture components M3r, M3y, and M3p.

仮想面座標データ77は、所定の仮想空間内における所定の平面(図18に示す平面Q)上の位置を示す2次元座標(「仮想面座標」と呼ぶ)を示すデータである。仮想面座標は、入力装置8の姿勢に基づいて算出される。本実施形態においては、この仮想面座標がゲーム処理に用いられ、表示対象(ゲームマップやWebページ等)のうちでテレビ2の画面に表示される表示範囲は仮想面座標に基づいて決定される。   The virtual plane coordinate data 77 is data indicating two-dimensional coordinates (referred to as “virtual plane coordinates”) indicating a position on a predetermined plane (plane Q shown in FIG. 18) in a predetermined virtual space. The virtual plane coordinates are calculated based on the attitude of the input device 8. In the present embodiment, the virtual plane coordinates are used for the game process, and the display range displayed on the screen of the television 2 among the display targets (game map, web page, etc.) is determined based on the virtual plane coordinates. .

はみ出しベクトルデータ78は、上記平面Qにおいて、仮想面座標が所定の領域(図23に示す領域Ar)からはみ出している方向および量を表すベクトル(「はみ出しベクトル」と呼ぶ)を示すデータである(図23参照)。本実施形態においては、画面に表示すべき表示範囲は上記はみ出しベクトルに基づいて決定される。   The protrusion vector data 78 is data indicating a vector (referred to as an “extrusion vector”) indicating the direction and amount in which the virtual plane coordinates protrude from a predetermined area (area Ar shown in FIG. 23) on the plane Q ( (See FIG. 23). In the present embodiment, the display range to be displayed on the screen is determined based on the protrusion vector.

カメラ向きデータ79は、仮想カメラの向き(姿勢)を示すデータである。また、カメラ位置データ80は、上記仮想空間における仮想カメラの位置を示すデータである。ここで、本実施形態においては、仮想空間(上記平面Qが配置される仮想空間とは異なる)に表示対象および仮想カメラが設定され、当該仮想カメラを用いる方法で画像が生成される。そのため、テレビ2の画面に表示される表示範囲は、仮想カメラの位置および向きにより決定される。なお、本実施形態においては、仮想カメラの向き(姿勢)は、入力装置8の第1の姿勢と同様、3×3の回転行列によって表される。ただし、他の実施形態においては、仮想カメラの姿勢は、3次のベクトルまたは3つの角度によって表現されてもよい。   The camera orientation data 79 is data indicating the orientation (posture) of the virtual camera. The camera position data 80 is data indicating the position of the virtual camera in the virtual space. Here, in this embodiment, a display target and a virtual camera are set in a virtual space (different from the virtual space in which the plane Q is arranged), and an image is generated by a method using the virtual camera. Therefore, the display range displayed on the screen of the television 2 is determined by the position and orientation of the virtual camera. In the present embodiment, the orientation (posture) of the virtual camera is represented by a 3 × 3 rotation matrix as in the first posture of the input device 8. However, in other embodiments, the orientation of the virtual camera may be represented by a cubic vector or three angles.

カーソル位置データ81は、テレビ2の画面上におけるカーソルの位置を示すデータである。本実施形態においては、上記仮想面座標に基づいて画面上の位置を表す座標(画面座標)が算出され、当該位置にカーソルが表示される。つまり、カーソル位置データ81は、仮想面座標に基づいて算出される画面座標を示す。   The cursor position data 81 is data indicating the position of the cursor on the screen of the television 2. In the present embodiment, coordinates (screen coordinates) representing a position on the screen are calculated based on the virtual surface coordinates, and a cursor is displayed at the position. That is, the cursor position data 81 indicates screen coordinates calculated based on the virtual plane coordinates.

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

まず、ステップS1において、CPU10は、ゲームに関する初期化処理を実行する。この初期化処理においては、ゲーム処理に用いられる各種パラメータの値が初期化されたり、仮想のゲーム空間が構築されたり、プレイヤオブジェクトや他のオブジェクトがゲーム空間の初期位置に配置されたりする。以上のステップS1の次にステップS2の処理が実行される。   First, in step S1, the CPU 10 executes an initialization process relating to the game. In this initialization process, the values of various parameters used in the game process are initialized, a virtual game space is constructed, and player objects and other objects are placed at initial positions in the game space. Following step S1, the process of step S2 is executed.

ステップ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 CPU 10 executes an initial posture setting process. Specifically, a predetermined value is set as the initial posture of the input device 8 in response to the player performing a predetermined operation (for example, an operation of pressing the A button 32d). Here, the reference posture is a posture in which the Z axis is parallel to the vertical direction and the imaging direction of the input device 8 faces the center of the marker unit 6 (the center of the markers 6R and 6L). It is desirable to perform the predetermined operation while holding the input device 8 so that the initial posture becomes the reference posture, but if the input device is close to a stationary state and the marker portion can be imaged, It is possible to calculate the initial posture. When a predetermined operation is performed, the CPU 10 stores data indicating the matrix representing the initial posture in the main memory as first posture data. After the above step S2, the processing loop of steps S3 to S9 is repeatedly executed while the game is executed. Note that one processing loop is executed once per frame time (for example, 1/60 seconds).

なお、本実施形態では、初期姿勢設定処理(ステップ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 CPU 10 may execute the initial posture setting process in response to the player performing the predetermined operation during the game.

ステップS3において、CPU10は操作データを取得する。すなわち、コントローラ5から送信されてくる操作データが無線コントローラモジュール19を介して受信される。そして、受信された操作データに含まれる角速度データ、加速度データ、マーカ座標データ、操作ボタンデータがそれぞれメインメモリに記憶される。ステップS3の次にステップS4の処理が実行される。   In step S3, the CPU 10 acquires operation data. That is, operation data transmitted from the controller 5 is received via the wireless controller module 19. Then, angular velocity data, acceleration data, marker coordinate data, and operation button data included in the received operation data are stored in the main memory. Following step S3, the process of step S4 is executed.

ステップ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 CPU 10 calculates the first posture based on the angular velocity data 63 stored in the main memory. Any method may be used to calculate the attitude of the input device 8 from the angular velocity. However, in the present embodiment, the first attitude is the previous first attitude (calculated in the previous processing loop). (First attitude) and the current angular velocity (the angular velocity acquired in the current processing loop). Specifically, the CPU 10 sets the posture obtained by rotating the previous first posture by unit time at the current angular velocity as the first posture. The previous first posture is indicated by the first posture data 68 stored in the main memory, and the current angular velocity is indicated by the angular velocity data 63 stored in the main memory. Data indicating the posture (3 × 3 matrix) calculated in step S4 is newly stored in the main memory as the first posture data 68. Following step S4, the process of step S5 is executed.

ステップS5において、CPU10は前述した第1補正処理を実行する。第1補正処理は、加速度データを用いて第1の姿勢を補正する処理である。以下、図15を参照して、第1補正処理の詳細を説明する。   In step S5, the CPU 10 executes the first correction process described above. The first correction process is a process of correcting the first posture using acceleration data. Hereinafter, the details of the first correction process will be described with reference to FIG.

図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 CPU 10 calculates the magnitude L of the acceleration detected by the acceleration sensor 37. That is, the acceleration data 64 stored in the main memory is read, and the magnitude L is calculated for the acceleration vector Va1 indicated by the acceleration data 64. Data indicating the calculated magnitude L is stored as acceleration magnitude data 69 in the main memory. Following step S11, the process of step S12 is executed.

ステップ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 CPU 10 determines whether or not the magnitude of the acceleration detected by the acceleration sensor 37 is zero. That is, the acceleration magnitude data 69 stored in the main memory is read, and it is determined whether or not the magnitude L indicated by the acceleration magnitude data 69 is zero. If the determination result of step S12 is negative, the process of step S13 is executed. On the other hand, when the determination result of step S12 is affirmative, the processes of subsequent steps S13 to S21 are skipped, and the CPU 10 ends the first correction process. Thus, in this embodiment, when the magnitude of the acceleration detected by the acceleration sensor 37 is 0, correction using the acceleration is not performed. This means that the direction of gravity cannot be calculated from the detection result of the acceleration sensor 37 when the magnitude of the acceleration is 0, and the subsequent steps S13 to S21 are performed if the magnitude of the acceleration vector is 0. The reason is that it is difficult.

ステップS13において、CPU10は、加速度センサ37によって検出された加速度ベクトルVa1を正規化する。すなわち、メインメモリに記憶されている加速度データ64を読み出し、当該加速度データ64により示される加速度ベクトルVa1を、大きさが1となるように補正する。CPU10は、正規化された加速度ベクトルVa1を示すデータをメインメモリに記憶しておく。ステップS13の次にステップS14の処理が実行される。   In step S <b> 13, the CPU 10 normalizes the acceleration vector Va <b> 1 detected by the acceleration sensor 37. That is, the acceleration data 64 stored in the main memory is read, and the acceleration vector Va1 indicated by the acceleration data 64 is corrected so that the magnitude is 1. The CPU 10 stores data indicating the normalized acceleration vector Va1 in the main memory. Following step S13, the process of step S14 is executed.

ステップ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 CPU 10 calculates the correction degree A indicating the degree of correction of the first posture in the first correction process. The correction degree A is calculated based on the magnitude L of the acceleration vector Va1 before normalization. Specifically, the CPU 10 reads acceleration magnitude data 69 stored in the main memory. Then, using the magnitude L indicated by the acceleration magnitude data 69, the correction degree A is calculated according to the following equation (2).
A = | L−1 | (2)
Data indicating the correction degree A calculated by the above equation (2) is stored as correction degree data 70 in the main memory. The correction degree A calculated by the above equation (2) is a value that is not a final value and is being calculated, and the final correction degree A is obtained by converting the value in the subsequent step S16. A value is obtained. Following step S14, the process of step S15 is executed.

ステップ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 CPU 10 determines whether or not the correction degree A calculated in step S14 is smaller than a predetermined value R. The predetermined value R is determined in advance and is set to 0.4, for example. Here, as described above, in the present embodiment, the magnitude of the gravitational acceleration detected by the acceleration sensor 37 is “1”, and the correction degree A is the magnitude L of the acceleration vector Va1 and “1”. (The above formula (2)). Therefore, the case where the correction degree A is equal to or greater than the predetermined value R is a case where the magnitude L of the acceleration vector Va1 is separated from the magnitude of the gravitational acceleration by the predetermined value R or more. If the determination result of step S15 is affirmative, the process of step S16 is executed. On the other hand, when the determination result of step S15 is negative, the processes of subsequent steps S16 to S21 are skipped, and the CPU 10 ends the first correction process.

上記のように、本実施形態では、加速度センサ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 acceleration sensor 37 and the gravitational acceleration magnitude (= 1) is smaller than a predetermined reference (predetermined value R). Correction is performed, and correction is not performed when the difference between the magnitude L and the magnitude of gravitational acceleration is equal to or greater than a predetermined reference. Here, in the state where the input device 8 is moved, in addition to the gravitational acceleration, the acceleration due to inertia caused by the movement of the input device 8 is detected by the acceleration sensor 37, so the magnitude of the detected acceleration vector Va1. L becomes a value different from “1”, and when the input device 8 is moved violently, the size L becomes a value far from “1”. Therefore, the case where the difference between the magnitude L and the magnitude of the gravitational acceleration is equal to or greater than a predetermined reference is estimated to be a case where the input device 8 is moved violently. On the other hand, when the input device 8 is moved violently, the acceleration vector Va1 detected by the acceleration sensor 37 contains many components other than gravitational acceleration (the acceleration component due to inertia), and therefore the acceleration vector Va1. The value of is presumed to be unreliable as a value indicating the direction of gravity. Therefore, the determination process of step S15 determines whether or not the input device 8 is moved violently, in other words, whether or not the value of the acceleration vector Va1 is reliable as a value indicating the direction of gravity. It is processing. In the present embodiment, if the value of the acceleration vector Va1 is not reliable as a value indicating the direction of gravity by the determination process in step S15, no correction is performed, and the value of the acceleration vector Va1 is a value indicating the direction of gravity. Corrections are made only when reliable. As a result, it is possible to prevent the first posture from being correctly corrected as a result of performing the correction on the first posture using the acceleration vector Va1 that is not reliable as a value indicating the direction of gravity.

ステップ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 CPU 10 converts the value of the correction degree A. In the present embodiment, the correction degree A is converted so that the correction degree A becomes closer to 1 as the magnitude L of the detected acceleration vector Va1 is closer to the magnitude of gravitational acceleration. Specifically, the CPU 10 reads the correction degree data 70 stored in the main memory, and converts the correction degree A indicated by the correction degree data 70 according to the following equations (3) to (5).
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 correction degree data 70 currently stored in the main memory), and the variable A4 is finally converted in step S16. Is the degree of correction. The above expression (3) is an expression for obtaining the corrected degree of correction A2 so that the degree of correction A1 before the conversion becomes closer to 1 as the magnitude of the gravitational acceleration (= 1) is closer. The above equation (4) is an equation for obtaining the corrected degree of correction A3 so that a larger weight is assigned as the correction degree A2 before conversion is closer to 1. The above equation (5) is an equation for adjusting the magnitude of the correction amount. That is, the correction amount of the constant C1 increases as the value of the constant C1 increases. The constant C1 is determined in advance and is set in a range of 0 <C1 ≦ 1 (for example, 0.03). Data indicating the correction degree A4 obtained by the conversion according to the above equations (3) to (5) is stored as new correction degree data 70 in the main memory. Following step S16, the process of step S17 is executed.

なお、本実施形態においては、上式(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, 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 CPU 10 converts the acceleration vector Va1 expressed in the XYZ coordinate system into a value Va2 in the xyz coordinate system. The acceleration vector Va2 in the xyz coordinate system is calculated by converting the normalized acceleration vector Va1 using the first posture matrix M1 representing the first posture obtained in the previous frame. That is, the CPU 10 reads the data of the acceleration vector Va1 (normalized) stored in the main memory in step S13 and the first attitude data 68. Then, using the acceleration vector Va1 and the first posture matrix M1 indicated by the first posture data 68, an acceleration vector Va2 in the xyz coordinate system is calculated. More specifically, normalized acceleration vector Va1 = (nx, ny, nz), each element of the first posture matrix M1 is a variable shown in the above equation (1), and acceleration expressed in the xyz coordinate system If the vector Va2 = (vx, vy, vz), the acceleration vector Va2 is calculated according to the following equation (6).
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 CPU 10 calculates the correction amount vector Vg using the acceleration vector Va2 expressed in the xyz coordinate system and the correction degree A. The correction amount vector Vg is calculated using the degree of correction after the conversion in step S16 and a vector (0, -1, 0) indicating the vertical downward direction (gravity direction) of the xyz coordinate system. Specifically, the CPU 10 reads out the correction degree data 70 stored in the main memory, and uses the correction degree A indicated by the correction degree data 70, according to the following equation (7), the correction amount vector Vg = ( gx, gy, gz) is calculated.
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 CPU 10 stores data indicating the correction amount vector Vg calculated by the above equation (7) as correction amount vector data 71 in the main memory. Following step S18, the process of step S19 is executed.

ステップS19において、CPU10は、上記ステップS18で算出された補正量ベクトルVgを正規化する。すなわち、メインメモリに記憶されている補正量ベクトルデータ71を読み出し、当該補正量ベクトルデータ71により示されるベクトルを正規化する。そして、正規化されたベクトルを示すデータを新たな補正量ベクトルデータ71としてメインメモリに記憶する。なお、上記ステップS19で算出された補正量ベクトルVgが、図9に示すベクトルv3に相当する。上記ステップS19の次にステップS20の処理が実行される。   In step S19, the CPU 10 normalizes the correction amount vector Vg calculated in step S18. That is, the correction amount vector data 71 stored in the main memory is read, and the vector indicated by the correction amount vector data 71 is normalized. Then, the data indicating the normalized vector is stored as new correction amount vector data 71 in the main memory. The correction amount vector Vg calculated in step S19 corresponds to the vector v3 shown in FIG. Following step S19, the process of step S20 is executed.

ステップ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 CPU 10 calculates a correction matrix Ma for correcting the first posture. The correction matrix Ma is calculated based on the acceleration vector Va2 expressed in the xyz coordinate system and the correction amount vector Vg normalized in step S19. Specifically, the CPU 10 reads the acceleration vector Va2 and the correction amount vector data 71 stored in the main memory in step S17. Then, a rotation matrix for rotating the acceleration vector Va2 so as to coincide with the correction amount vector Vg is calculated, and the calculated rotation matrix is set as a correction matrix Ma. That is, the correction matrix Ma is a rotation matrix that performs the rotation of the angle Δθ shown in FIG. Data indicating the correction matrix Ma calculated in step S20 is stored in the main memory as correction matrix data 72. Following step S20, the process of step S21 is executed.

ステップ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 CPU 10 corrects the first posture matrix M1 indicating the first posture with the correction matrix Ma. Specifically, the CPU 10 reads the first attitude data 68 and the correction matrix data 72 stored in the main memory. Then, the first attitude matrix M1 indicated by the first attitude data 68 is converted by the correction matrix Ma indicated by the correction matrix data 72 (the product of the first attitude matrix M1 and the correction matrix Ma is calculated). The converted first posture matrix M1 indicates the corrected first posture. That is, the process of step S21 corresponds to the process of rotating the vector v1 shown in FIG. 10 by the angle Δθ. The CPU 10 stores data indicating the converted first attitude matrix M1 as new first attitude data 68 in the main memory. After step S21, the CPU 10 ends the first correction process.

以上のように、第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 acceleration sensor 37 and the gravity direction vector (vector G shown in FIG. 8) (steps S18 and S19). ), The first posture is corrected by the correction amount (correction matrix Ma. Angle Δθ shown in FIG. 9) represented by the correction amount vector Vg (step S21). As a result, the first attitude calculated from the gyro sensors 55 and 56 (vector v1 or angle θ1 shown in FIG. 8) is corrected to approach the second attitude (angle θ2 shown in FIG. 8) determined by the acceleration sensor 37. It can be performed. By performing such correction, the first posture can be corrected so as to have a more accurate value.

また、第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 CPU 10 executes the second correction process described above. The second correction process is a process of correcting the first posture using the marker coordinate data. Hereinafter, the details of the second correction process will be described with reference to FIG.

図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 CPU 10 determines whether or not the marker unit 6 is imaged by the imaging unit (imaging device 40) of the input device 8. The determination in step S31 can be made by referring to the marker coordinate data 65 stored in the main memory. Here, when the marker coordinate data 65 indicates two marker coordinates, it is determined that the marker unit 6 is captured, and when the marker coordinate data 65 indicates only one marker coordinate, or there is no marker coordinate. When it shows, it determines with the marker part 6 not being imaged. If the determination result of step S31 is affirmative, the processes of subsequent steps S32 to S37 are executed. On the other hand, when the determination result of step S31 is negative, the processes of the subsequent steps S32 to S37 are skipped, and the CPU 10 ends the second correction process. As described above, when the marker unit 6 is not imaged by the image sensor 40, the attitude of the input device 8 cannot be calculated using data obtained from the image sensor 40. In this case, the second correction is performed. No correction is performed in the process.

ステップS32において、CPU10は、マーカ座標データに基づいてロール姿勢成分M3rを算出する。ロール姿勢成分M3rは、撮像画像内でのマーカ部6の向きに基づいて、すなわち、マーカ座標データ65により示される2つのマーカ座標を結ぶ線の傾きに基づいて算出される。以下、図17を参照して、ロール姿勢成分M3rの算出方法の例を説明する。   In step S32, the CPU 10 calculates a roll posture component M3r based on the marker coordinate data. The roll posture component M3r is calculated based on the orientation of the marker unit 6 in the captured image, that is, based on the slope of the line connecting the two marker coordinates indicated by the marker coordinate data 65. Hereinafter, an example of a method for calculating the roll posture component M3r will be described with reference to FIG.

図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 an image 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 marker unit 6 and the button surface of the controller 5 is vertically upward). In the image, it is assumed that the vertically downward direction is the positive direction of the y ′ axis and the right direction is the positive direction of the x ′ axis. Also, point P1 and point P2 shown in FIG. 17 indicate the positions of the marker coordinates, and point P3 is a midpoint between point P1 and point P2. A vector v10 shown in FIG. 17 is a vector having a point P1 as a start point and a point P2 as an end point.

ロール姿勢成分M3rを算出するために、CPU10はまず、マーカ座標データ65を読み出し、当該マーカ座標データ65により示される2つのマーカ座標から上記ベクトルv10を算出する。さらに、ベクトルv10を正規化したベクトル(hx,hy)を算出する。このベクトル(hx,hy)は、入力装置8が上記基準姿勢にある場合にx軸正方向を向き、入力装置8のロール方向の回転に応じて向きが変化する。ベクトル(hx,hy)がロール方向の姿勢に対応しているので、ロール姿勢成分M3rは、このベクトル(hx,hy)に基づいて算出することができる。具体的には、CPU10は、次の式(8)に従ってロール姿勢成分M3rを算出する。

Figure 2011138295
上式(8)によって算出された行列を示すデータは、ロール姿勢成分データ73としてメインメモリに記憶される。ステップS32の次にステップS33の処理が実行される。 In order to calculate the roll posture component M3r, the CPU 10 first reads the marker coordinate data 65, and calculates the vector v10 from the two marker coordinates indicated by the marker coordinate data 65. Further, a vector (hx, hy) obtained by normalizing the vector v10 is calculated. The vector (hx, hy) is directed in the positive x-axis direction when the input device 8 is in the reference posture, and the direction changes according to the rotation of the input device 8 in the roll direction. Since the vector (hx, hy) corresponds to the posture in the roll direction, the roll posture component M3r can be calculated based on the vector (hx, hy). Specifically, the CPU 10 calculates the roll posture component M3r according to the following equation (8).
Figure 2011138295
Data indicating the matrix calculated by the above equation (8) is stored in the main memory as roll posture component data 73. Following step S32, the process of step S33 is executed.

ステップS33において、CPU10は、マーカ座標データに基づいてヨー姿勢成分M3yを算出する。ヨー姿勢成分M3yは、撮像画像内でのマーカ部6の向きおよび位置に基づいて算出される。以下、図17を参照して、ヨー姿勢成分M3yの算出方法の例を説明する。   In step S33, the CPU 10 calculates a yaw posture component M3y based on the marker coordinate data. The yaw posture component M3y is calculated based on the orientation and position of the marker unit 6 in the captured image. Hereinafter, an example of a method for calculating the yaw posture component M3y will be described with reference to FIG.

まず、CPU10は、マーカ座標データ65を読み出し、当該マーカ座標データ65により示される2つのマーカ座標の中点を算出する。本実施形態では、マーカ部6の位置として当該中点の位置を用いる。さらに、CPU10は、算出された中点の座標を、x’y’座標系の原点を中心として、入力装置8のロール方向に関する回転角度だけ(入力装置8の回転方向とは逆方向に)回転させた座標(px,py)を算出する。換言すれば、中点の座標は、原点を中心として、上記ベクトル(hx,hy)がx軸正方向を向くように回転される。入力装置8が水平方向(x軸方向)に関してマーカ部6と同じ位置(すなわち、マーカ部6の正面の位置)にあるとすれば、上記のようにして得られた回転後の座標(px,py)から、ヨー方向に関する姿勢を算出することができる。   First, the CPU 10 reads the marker coordinate data 65 and calculates the midpoint between the two marker coordinates indicated by the marker coordinate data 65. In the present embodiment, the position of the middle point is used as the position of the marker unit 6. Further, the CPU 10 rotates the calculated midpoint coordinates by the rotation angle related to the roll direction of the input device 8 (in the direction opposite to the rotation direction of the input device 8) around the origin of the x′y ′ coordinate system. Calculated coordinates (px, py) are calculated. In other words, the coordinates of the midpoint are rotated around the origin so that the vector (hx, hy) faces the positive x-axis direction. If the input device 8 is at the same position as the marker unit 6 in the horizontal direction (x-axis direction) (that is, the front position of the marker unit 6), the coordinates (px, py) can be used to calculate the attitude related to the yaw direction.

次に、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 CPU 10 based on the coordinates (px, py) after the rotation of the midpoint and the angle (limit angle) θy ′ in the yaw direction when the marker unit 6 is located at the end in the x′-axis direction. Then, the rotation angle θy related to the yaw direction is calculated. Here, the limit angle θy ′ and the x-coordinate value px ′ after the rotation of the midpoint when the limit angle θy1 is reached can be obtained in advance. Therefore, the rotation angle θy related to the yaw direction can be calculated using the fact that the ratio between px and px ′ is equal to the ratio between θy and θy ′. Specifically, the rotation angle θy related to the yaw direction can be calculated by the following equation (9).
θy = px × θy ′ / px ′ (9)
When the horizontal length of the marker unit 6 is ignored, the limit angle θy ′ can be set to ½ of the angle of view of the controller 5 and the value of px ′ can be set to “1”.

最後に、CPU10は、上式(9)により算出された角度θyの回転を行う回転行列をヨー姿勢成分M3yとして算出する。具体的には、ヨー姿勢成分M3yは次の式(10)によって算出される。

Figure 2011138295
上式(10)によって算出された行列を示すデータが、ヨー姿勢成分データ74としてメインメモリに記憶される。以上のステップS33の次にステップS34の処理が実行される。 Finally, the CPU 10 calculates a rotation matrix for performing the rotation of the angle θy calculated by the above equation (9) as the yaw attitude component M3y. Specifically, the yaw posture component M3y is calculated by the following equation (10).
Figure 2011138295
Data indicating the matrix calculated by the above equation (10) is stored in the main memory as yaw attitude component data 74. Following step S33, the process of step S34 is executed.

ステップS34において、CPU10は、ロール姿勢成分M3rとヨー姿勢成分M3yとを合成する。すなわち、メインメモリからロール姿勢成分データ73およびヨー姿勢成分データ74を読み出し、各データ73および74により示されるロール姿勢成分M3rとヨー姿勢成分M3yとを積算する。ステップS34の次にステップS35の処理が実行される。   In step S34, the CPU 10 combines the roll posture component M3r and the yaw posture component M3y. That is, the roll attitude component data 73 and the yaw attitude component data 74 are read from the main memory, and the roll attitude component M3r and the yaw attitude component M3y indicated by the data 73 and 74 are integrated. Following step S34, the process of step S35 is executed.

ステップ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 CPU 10 calculates a pitch posture component M3p based on the first posture. Although different from the processing of the present embodiment, the pitch attitude component M3p can also be calculated based on the y coordinate value of the coordinates (px, py) in the same manner as the yaw attitude component M3y. . However, in the method of calculating the attitude in the yaw direction (pitch direction) using the coordinates (px, py), the input device 8 is at the same position as the marker unit 6 in the horizontal direction (vertical direction in the case of the pitch direction). This method is based on the assumption. In the game system 1 of the present embodiment, it is considered that the player operates the input device 8 at a position substantially in front of the marker unit 6 (TV 2) in the horizontal direction. It is possible to calculate the attitude in the yaw direction by the method of step S33 on the assumption that “they are at the same position”. On the other hand, it is conceivable that the player stands and operates the input device 8 or sits down and operates the input device 8, and the position of the marker unit 6 is also arranged on the upper side of the screen of the television 2. It is also possible to arrange them in For this reason, in the game system 1 of the present embodiment, it is not necessarily assumed that “the input device 8 is at the same position as the marker unit 6 in the vertical direction”. Therefore, the coordinates in the pitch direction are determined using the coordinates (px, py). The posture may not be calculated.

そこで、本実施形態においては、ピッチ姿勢成分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の行列を算出する。

Figure 2011138295
上式(12)によって算出された行列を示すデータが、ピッチ姿勢成分データ75としてメインメモリに記憶される。以上のステップS35の次にステップS36の処理が実行される。 Therefore, in the present embodiment, the first posture is used as it is for the pitch posture component M3p (thus, in the second correction process, the pitch direction is not corrected). Specifically, the CPU 10 reads the first attitude data 68 from the main memory. Then, using each element of the first posture matrix M1 indicated by the first posture data 68, the rotation angle θp with respect to the pitch direction is calculated according to the following equation (11).
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 CPU 10 calculates a matrix of the pitch posture component M3p according to the following equation (12) using cos (θp) and sin (θp) calculated by the above equation (11).
Figure 2011138295
Data indicating the matrix calculated by the above equation (12) is stored in the main memory as pitch attitude component data 75. Following step S35, the process of step S36 is executed.

ステップS36において、CPU10は、ロール方向、ヨー方向、およびピッチ方向の各姿勢成分に基づいて第3の姿勢を算出する。第3の姿勢は、ロール姿勢成分M3rとヨー姿勢成分M3yとの合成結果に、ピッチ姿勢成分M3pをさらに合成することによって得られる。具体的には、CPU10は、メインメモリからピッチ姿勢成分データ75を読み出し、当該ピッチ姿勢成分データ75により示されるピッチ姿勢成分M3pを、ステップS34で算出された行列に積算する。算出された行列を示すデータは、第3姿勢データ76としてメインメモリに記憶される。ステップS36の次にステップS37の処理が実行される。   In step S36, the CPU 10 calculates a third posture based on the posture components in the roll direction, the yaw direction, and the pitch direction. The third attitude is obtained by further synthesizing the pitch attitude component M3p with the synthesis result of the roll attitude component M3r and the yaw attitude component M3y. Specifically, the CPU 10 reads the pitch posture component data 75 from the main memory, and integrates the pitch posture component M3p indicated by the pitch posture component data 75 in the matrix calculated in step S34. Data indicating the calculated matrix is stored in the main memory as third attitude data 76. Following step S36, the process of step S37 is executed.

ステップ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 CPU 10 corrects the first attitude using the third attitude. The correction in step S37 is performed by bringing the first posture matrix M1 closer to the third posture matrix M3 at a predetermined ratio (the following constant C2). The CPU 10 reads the first attitude data 68 and the third attitude data 76 from the main memory. Then, correction is performed according to the following equation (13) using the first posture matrix M1 indicated by the first posture data 68 and the third posture matrix M3 indicated by the third posture data 76.
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 first posture data 68. After step S37, the CPU 10 ends the second correction process.

以上のように、第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 subsequent to step S <b> 6, the CPU 10 calculates two-dimensional coordinates (virtual plane coordinates) based on the corrected first posture. Although details will be described later, in the present embodiment, the two-dimensional coordinates are used as input by the player in a game process (step S8) described later. Hereinafter, with reference to FIG. 18 and FIG. 19, the detail of step S7 is demonstrated.

図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 CPU 10 defines a three-dimensional virtual space, and calculates coordinates assuming that the input device 8 and a predetermined plane Q are virtually arranged. The plane Q corresponds to the screen of the television 2. The CPU 10 calculates the coordinates of the position on the plane Q indicated by the direction of the Z-axis (Z-axis vector VZ shown in FIG. 18) of the input device 8 in the virtual space. That is, the coordinates of the intersection R between the line segment obtained by extending the Z-axis vector VZ representing the attitude of the input device 8 in the virtual space and the predetermined plane Q in the virtual space are calculated. The “line segment obtained by extending the Z-axis vector VZ” means a line segment that is parallel to the Z-axis vector VZ and passes through the Z-axis vector VZ. Although details will be described later, in this embodiment, a cursor or the like is displayed at a position on the screen corresponding to the calculated coordinates. Thereby, the position of the cursor on the screen is controlled according to the posture of the input device 8, and the player can move the cursor by an operation for changing the posture of the input device 8.

なお、図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 first attitude data 68 can be used as it is as data indicating the attitude of the input device 8, so that calculation in the virtual space can be easily performed. Further, the position on the plane Q is expressed by the X′Y ′ coordinate system. At this time, the plane Q is set to be parallel to the xy plane of the spatial coordinate system, the x axis of the spatial coordinate system and the X ′ axis of the plane Q are parallel, and the y axis of the spatial coordinate system and the Y ′ of the plane Q are set. The X′Y ′ coordinate system is set so that the axes are parallel (FIG. 18).

また、本実施形態では、プレイヤは入力装置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 television 2 and the position of the input device 8 does not change in the virtual space. In other words, the CPU 10 performs the process without changing the position of the input device 8 because only the attitude of the input device 8 changes in the virtual space. As a result, the position on the plane Q (the position of the intersection R) can be uniquely determined from the attitude of the input device 8.

次に、平面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は、仮想面座標データ77として当該2次元座標を示すデータをメインメモリ32に記憶する。ステップS7の次にステップS8の処理が実行される。   The specific processing in step S7 will be described. First, the CPU 10 reads the first attitude data 68 and the length data from the main memory. Then, Zx, Zy, and Zz included in the first posture matrix M1 indicated by the first posture data 68 and the length L indicated by the length data are substituted into the above equations (14) and (15). To calculate the lengths Wx and Wy. As a result, the two-dimensional coordinates (Wx, Wy) of the intersection R on the plane Q are obtained. The CPU 10 stores data indicating the two-dimensional coordinates in the main memory 32 as the virtual plane coordinate data 77. Following step S7, the process of step S8 is executed.

以上のように、上記ステップ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 game apparatus 10 using a predetermined method. For example, the CPU 10 may calculate an actual distance from the input device 8 to the screen of the television 2 and set the calculated distance as the length L. The actual distance can be calculated using, for example, the length between the two markers 6R and 6L in the captured image captured by the image sensor 40 or the size of the marker 6R or 6L. Furthermore, if the plane Q is set so that the position and size of the plane Q in the virtual space correspond to the position and size of the screen of the television 2 in the real space (for example, the player sets the size of the television screen). The cursor is displayed at a position on the screen of the television 2 corresponding to the two-dimensional coordinates (Wx, Wy). According to this, the cursor can be displayed at a position (on the screen) indicated by the input device 8.

なお、入力装置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 data 65 shown in FIG. 13) described above. That is, since the marker coordinates change in accordance with the position pointed to by the input device 8, the position on the screen pointed to by the input device 8 can be calculated based on the marker coordinates. Therefore, if the marker portion 6 is present, the two-dimensional coordinates can be calculated using the marker coordinates. However, when the marker unit 6 cannot be used, or in an input device that is not equipped with an image sensor, the two-dimensional coordinates cannot be obtained by photographing with the marker unit 6. The method according to the present embodiment can obtain two-dimensional coordinates even when the imaging device 40 of the input device 8 is not capturing the marker unit 6, and therefore can be used even in an input device without the marker unit or imaging device. Is.

また、本実施形態においては、上記第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 television 2 is assumed, and the Z-axis direction of the input device 8 faces the screen (marker part 6) of the television 2. In this case, the plane Q is arranged in the Z-axis direction. However, as described above, since the two-dimensional coordinates can be obtained even if the imaging element 40 does not capture the marker portion 6, the player points the Z-axis direction of the input device 8 in an arbitrary direction. It is possible to use. For example, the CPU 10 may set the plane Q in the Z-axis direction of the input device 8 at the time of the predetermined operation in response to the player performing a predetermined operation (for example, an operation of pressing an operation button). . According to this, since the plane Q can be arranged at an appropriate position according to the orientation of the input device 8 in the virtual space, the input device 8 can be in any orientation at the time of the predetermined operation. Two-dimensional coordinates can be calculated. That is, the player can use the input device 8 in an arbitrary direction.

なお、本実施形態では、ゲーム装置3は、入力装置8のZ軸方向が水平方向を向く場合に原点(0,0)を取るように2次元座標を算出する方法(第1の方法と呼ぶ)を採用した。ここで、ゲーム装置3は、上記第1の方法に代えて、後述する第2の方法によって2次元座標を算出してもよい。   In the present embodiment, the game apparatus 3 calculates a two-dimensional coordinate so as to take the origin (0, 0) when the Z-axis direction of the input apparatus 8 faces the horizontal direction (referred to as a first method). )It was adopted. Here, the game apparatus 3 may calculate the two-dimensional coordinates by a second method described later, instead of the first method.

図14の説明に戻り、ステップS7の次のステップS8において、CPU10は、上記2次元座標を用いた表示制御処理を行う。表示制御処理は、表示対象のうちで表示装置(テレビ2)に表示すべき表示範囲を、上記ステップS7で算出される2次元座標に基づいて制御する処理である。表示制御処理は、上記の表示対象を2次元座標に基づいてスクロール等させる処理である。つまり、本実施形態では、ユーザは、入力装置8の姿勢を変える操作によってテレビ2に表示される画面をスクロール等させることができる。また、上記表示対象とはどのようなものであってもよく、例えば、ゲーム空間内に形成されるフィールド(フィールド上に配置されるオブジェクトを含む)や、ゲーム空間を表すマップ等であってもよいし、Webページや電子番組表等であってもよい。   Returning to the description of FIG. 14, in step S <b> 8 following step S <b> 7, the CPU 10 performs display control processing using the two-dimensional coordinates. The display control process is a process of controlling the display range to be displayed on the display device (television 2) among the display objects based on the two-dimensional coordinates calculated in step S7. The display control process is a process for scrolling the display target based on the two-dimensional coordinates. That is, in this embodiment, the user can scroll the screen displayed on the television 2 by an operation of changing the attitude of the input device 8. The display target may be anything, such as a field formed in the game space (including objects arranged on the field), a map representing the game space, or the like. It may be a Web page or an electronic program guide.

また、本実施形態においては、CPU10は、仮想空間に表示対象および仮想カメラを配置し、当該仮想空間内において仮想カメラの向きおよび/または位置を仮想面座標に基づいて変化させることで表示範囲の制御を行うものとする。なお、表示対象が配置される仮想空間は、ステップS7で算出される2次元座標が存在する仮想空間とは異なる空間である。以下では、両者を区別する目的で、上記2次元座標が存在する仮想空間を「第1の仮想空間」と呼び、表示対象が配置される仮想空間を「第2の仮想空間」と呼ぶことがある。   In the present embodiment, the CPU 10 arranges the display target and the virtual camera in the virtual space, and changes the orientation and / or position of the virtual camera in the virtual space based on the virtual plane coordinates. Control shall be performed. Note that the virtual space in which the display target is arranged is a space different from the virtual space in which the two-dimensional coordinates calculated in step S7 exist. Hereinafter, for the purpose of distinguishing between the two, the virtual space in which the two-dimensional coordinates exist is referred to as “first virtual space”, and the virtual space in which the display target is arranged is referred to as “second virtual space”. is there.

なお、表示範囲の制御方法は、仮想面座標に応じて表示範囲を変化させる方法であればどのようなものであってもよい。例えば、CPU10は、仮想カメラでなく表示対象を移動させるようにしてもよい。また、表示範囲の制御方法は、3次元空間において仮想カメラを用いて表示範囲を算出する方法でなくてもよい。例えば、CPU10は、表示対象である2次元平面上に表示範囲を設定し、当該表示範囲を仮想面座標に応じて変化させてもよい。   The display range control method may be any method as long as the display range is changed according to the virtual plane coordinates. For example, the CPU 10 may move the display target instead of the virtual camera. The display range control method may not be a method of calculating the display range using a virtual camera in a three-dimensional space. For example, the CPU 10 may set a display range on a two-dimensional plane that is a display target, and change the display range according to the virtual plane coordinates.

以下、図20を参照して、表示制御処理の詳細を説明する。なお、以下の表示制御処理の説明では、上記ステップS7で算出される2次元座標を、表示画面上の座標(画面座標)と区別する目的で「仮想面座標」と呼ぶ。   Hereinafter, the details of the display control process will be described with reference to FIG. In the following description of the display control process, the two-dimensional coordinates calculated in step S7 are referred to as “virtual plane coordinates” for the purpose of distinguishing them from coordinates on the display screen (screen coordinates).

図20は、図14に示す表示制御処理(ステップS8)の流れを示すフローチャートである。本実施形態における表示制御処理においては、まずステップS41において、カメラ向き制御処理が実行される。カメラ向き制御処理は、仮想面座標に基づいて仮想カメラの向きを制御する処理である。   FIG. 20 is a flowchart showing the flow of the display control process (step S8) shown in FIG. In the display control process in the present embodiment, first, in step S41, a camera orientation control process is executed. The camera orientation control process is a process for controlling the orientation of the virtual camera based on the virtual plane coordinates.

図21は、入力装置8の姿勢と、カメラ向き制御処理によって決められる表示範囲との関係の一例を示す図である。図21においては、入力装置8が基準姿勢(ここでは、入力装置8のZ軸がテレビ2の画面を向く姿勢)である場合、カレンダーの一部が画面に表示されるような表示範囲が設定されるとする(図21における上段参照)。ここで、入力装置8を基準姿勢から右に向け、入力装置8が指し示す位置を画面の右側に外した場合(図21における中段参照)、表示範囲は右向きに変化する(画面に表示される画像は左に移動し、視線がカレンダーに対して左右方向に傾いたような表示となる)。つまり、上記の場合、CPU10は、表示範囲が右に移動するように仮想カメラの向きを制御する。また、入力装置8を基準姿勢から上に向け、入力装置8が指し示す位置を画面の上側に外した場合(図21における下段参照)、表示範囲は上向きに変化する(画像は下に移動し、視線がカレンダーに対して上下方向に傾いたような表示となる)。このように、本実施形態におけるカメラ向き制御処理によれば、ユーザは、入力装置8の向きと仮想カメラの向きとが対応するように仮想カメラを制御することができ、入力装置8の向きをテレビ2の画面から外す方向および量によって、画像をスクロールさせる方向および量を操作することができる。以下、カメラ向き制御処理の詳細を説明する。   FIG. 21 is a diagram illustrating an example of the relationship between the attitude of the input device 8 and the display range determined by the camera orientation control process. In FIG. 21, when the input device 8 is in the reference posture (here, the posture in which the Z axis of the input device 8 faces the screen of the television 2), a display range is set such that a part of the calendar is displayed on the screen. (See the upper part of FIG. 21). Here, when the input device 8 is turned to the right from the reference posture and the position pointed to by the input device 8 is removed to the right side of the screen (see the middle stage in FIG. 21), the display range changes to the right (image displayed on the screen). Moves to the left, and the line of sight tilts to the left and right with respect to the calendar). That is, in the above case, the CPU 10 controls the orientation of the virtual camera so that the display range moves to the right. When the input device 8 is directed upward from the reference posture and the position pointed to by the input device 8 is removed from the upper side of the screen (see the lower row in FIG. 21), the display range changes upward (the image moves downward, The line of sight is tilted up and down with respect to the calendar). As described above, according to the camera orientation control processing in the present embodiment, the user can control the virtual camera so that the orientation of the input device 8 and the orientation of the virtual camera correspond to each other. The direction and amount of scrolling the image can be manipulated by the direction and amount removed from the screen of the television 2. Details of the camera orientation control process will be described below.

図22は、図20に示すカメラ向き制御処理(ステップS41)の流れを示すフローチャートである。カメラ向き制御処理においては、まずステップS46において、CPU10は、仮想面座標は所定領域の外にあるか否かを判定する。ここで、所定領域は、上記第1の仮想空間に配置される平面Q上において設定される領域である。図23は、第1の仮想空間に配置される平面Qを示す図である。図23においては、一点鎖線で表される領域Arが上記所定領域である。ここで、CPU10は、仮想面座標に基づいてテレビ2の画面上の位置(後述するカーソル位置)を算出する(後述するステップS43)。画面上の位置は、所定領域Arとテレビ2の画面の領域とが対応するように算出される。例えば、仮想面座標が所定領域Arの縁に位置する場合に、画面上の位置としては画面の端の位置が算出される。つまり、本実施形態において、所定領域Arは、平面Q上においてテレビ2の画面の領域に対応する領域である。なお、所定領域Arはテレビ2の画面の領域に対応することが好ましいが、所定領域Arの縁が画面の領域の縁に厳密に対応している必要はない。したがって、所定領域Arは長方形に限らず、例えば楕円形あるいは円形であってもよい。また、他の実施形態においては所定領域Arはどのように設定されてもよい。   FIG. 22 is a flowchart showing the flow of the camera orientation control process (step S41) shown in FIG. In the camera orientation control process, first, in step S46, the CPU 10 determines whether or not the virtual plane coordinates are outside a predetermined area. Here, the predetermined area is an area set on the plane Q arranged in the first virtual space. FIG. 23 is a diagram illustrating the plane Q arranged in the first virtual space. In FIG. 23, a region Ar represented by a one-dot chain line is the predetermined region. Here, CPU10 calculates the position (cursor position mentioned later) on the screen of the television 2 based on a virtual surface coordinate (step S43 mentioned later). The position on the screen is calculated so that the predetermined area Ar corresponds to the area of the screen of the television 2. For example, when the virtual plane coordinates are located at the edge of the predetermined area Ar, the position of the edge of the screen is calculated as the position on the screen. That is, in the present embodiment, the predetermined area Ar is an area corresponding to the area of the screen of the television 2 on the plane Q. The predetermined area Ar preferably corresponds to the area of the screen of the television 2, but the edge of the predetermined area Ar does not have to correspond exactly to the edge of the area of the screen. Therefore, the predetermined area Ar is not limited to a rectangle, and may be an ellipse or a circle, for example. In other embodiments, the predetermined area Ar may be set in any manner.

本実施形態においては、所定領域Arは予め定められているものとする。ただし、所定領域Arは、ユーザの指示あるいはゲーム状況等に応じて可変としてもよい。例えば、CPU10は、所定領域Arとテレビ2の画面の領域とが対応するように、第1の仮想空間における入力装置8から平面Qまでの長さL(図19参照)に応じて所定領域Arを変化させてもよい。   In the present embodiment, it is assumed that the predetermined area Ar is predetermined. However, the predetermined area Ar may be variable according to a user instruction or a game situation. For example, the CPU 10 determines the predetermined area Ar according to the length L (see FIG. 19) from the input device 8 to the plane Q in the first virtual space so that the predetermined area Ar corresponds to the area of the screen of the television 2. May be changed.

CPU10は、予め定められた所定領域Arを示すデータと仮想面座標データ77とをメインメモリから読み出し、仮想面座標と所定領域Arとの位置関係を判別することで上記ステップS46の判定を行う。ステップS46の判定結果が肯定である場合、ステップS47およびS48の処理が実行される。一方、ステップS46の判定結果が否定である場合、後述するステップS49の処理が実行される。   The CPU 10 reads the data indicating the predetermined area Ar and the virtual plane coordinate data 77 that are determined in advance from the main memory, and determines the positional relationship between the virtual plane coordinates and the predetermined area Ar to perform the determination in step S46. If the determination result of step S46 is affirmative, the processes of steps S47 and S48 are executed. On the other hand, when the determination result of step S46 is negative, a process of step S49 described later is executed.

ステップS47において、CPU10ははみ出しベクトルを算出する。はみ出しベクトルは、上記平面Qにおいて、仮想面座標が所定領域Arからはみ出している方向および量を表すベクトルである。以下、図23を参照して、はみ出しベクトルの算出方法を説明する。図23において、点Rは仮想面座標が示す位置である。また、点P10は、上述の投影点Tであり、平面Q上のX’Y’座標系の原点である。このとき、はみ出しベクトルVdは、点P10から点Rまでを結ぶ線分と所定領域Arとの交点P11を始点とし、点Rを終点とするベクトルである。したがって、はみ出しベクトルVdは、所定領域Arを表す式と仮想面座標とに基づいて算出することができる。具体的には、CPU10は、所定領域Arを示すデータと仮想面座標データ77とをメインメモリから読み出し、所定領域Arを表す式と仮想面座標とに基づいてはみ出しベクトルVdを算出する。算出されたはみ出しベクトルVdを示すデータは、はみ出しベクトルデータ78としてメインメモリに記憶される。ステップS47の次にステップS48の処理が実行される。   In step S47, the CPU 10 calculates a protrusion vector. The protrusion vector is a vector representing the direction and amount in which the virtual surface coordinates protrude from the predetermined area Ar on the plane Q. Hereinafter, with reference to FIG. 23, a method of calculating the protrusion vector will be described. In FIG. 23, a point R is a position indicated by the virtual plane coordinates. The point P10 is the projection point T described above, and is the origin of the X′Y ′ coordinate system on the plane Q. At this time, the protrusion vector Vd is a vector having the intersection P11 between the line segment connecting the point P10 to the point R and the predetermined area Ar as the start point and the point R as the end point. Therefore, the protrusion vector Vd can be calculated based on the formula representing the predetermined area Ar and the virtual plane coordinates. Specifically, the CPU 10 reads data indicating the predetermined area Ar and the virtual plane coordinate data 77 from the main memory, and calculates the protrusion vector Vd based on the expression indicating the predetermined area Ar and the virtual plane coordinates. Data indicating the calculated protrusion vector Vd is stored in the main memory as the protrusion vector data 78. Following step S47, the process of step S48 is executed.

なお、はみ出しベクトルは、仮想面座標が所定領域Arからはみ出している方向および量を表すものであればよく、はみ出しベクトルの算出方法は上記に限らない。例えば、はみ出しベクトルは、所定領域Arの4辺のうちで仮想面座標に最も近い辺の中点を始点とする(そして、仮想面座標の点Rを終点とする)ように算出されてもよい。   In addition, the protrusion vector should just represent the direction and quantity which the virtual surface coordinate protrudes from the predetermined area | region Ar, and the calculation method of an protrusion vector is not restricted above. For example, the protrusion vector may be calculated so that the midpoint of the side closest to the virtual plane coordinate among the four sides of the predetermined area Ar is the start point (and the virtual plane coordinate point R is the end point). .

ステップS48において、CPU10は、はみ出しベクトルVdに基づいて仮想カメラの向きを制御する。本実施形態においては、仮想カメラの向きは、はみ出しベクトルVdの向きに応じた方向へ表示範囲が移動するように、かつ、はみ出しベクトルVdの大きさに応じた量だけ表示範囲が移動するように制御される。以下、ステップS48の詳細を説明する。   In step S48, the CPU 10 controls the direction of the virtual camera based on the protrusion vector Vd. In the present embodiment, the direction of the virtual camera is such that the display range moves in a direction corresponding to the direction of the protruding vector Vd, and the display range moves by an amount corresponding to the size of the protruding vector Vd. Be controlled. Details of step S48 will be described below.

まず、表示対象および仮想カメラが配置される仮想空間(第2の仮想空間)について説明する。図24は、表示対象および仮想カメラが配置される仮想空間を示す図である。本実施形態においては、第2の仮想空間はx”y”z”座標系によって表される。x”y”z”座標系は、平面状の表示対象92の正面の位置から見て、表示対象92を向く方向を前方向とした場合において、後方向をz”軸正方向とし、上方向をy”軸正方向とし、右方向をx”軸正方向とした座標系である。   First, the virtual space (second virtual space) in which the display target and the virtual camera are arranged will be described. FIG. 24 is a diagram illustrating a virtual space in which a display target and a virtual camera are arranged. In the present embodiment, the second virtual space is represented by an x ″ y ″ z ″ coordinate system, which is displayed when viewed from the front position of the planar display object 92. This is a coordinate system in which the direction toward the object 92 is the forward direction, the backward direction is the z "-axis positive direction, the upward direction is the y" -axis positive direction, and the right direction is the x "-axis positive direction.

仮想カメラ91の向き(姿勢)は、入力装置8の第1の姿勢と同様、3×3の回転行列によって表される。この行列は、仮想カメラ91の視線方向を前方向としたときにおける下記3つのベクトルの各成分を行列の各要素とするものである。
・右方向(画面の右方向に対応)を向くベクトルCX=(CXx,CXy,CXz)
・上方向(画面の上方向に対応)を向くベクトルCY=(CYx,CYy,CYz)
・後方向を向くベクトルCZ=(CZx,CZy,CZz)
上記行列は、所定の基準姿勢から現在の仮想カメラ91の姿勢への回転を表す回転行列である。所定の基準姿勢は、本実施形態においては、上記3つのベクトルCX,CY,およびCZが、それぞれx”軸、y”軸、およびz”軸の向きと一致する姿勢である。つまり、基準姿勢となる場合、仮想カメラ91の視線方向は表示対象92の平面に垂直な方向を向く。
The orientation (posture) of the virtual camera 91 is represented by a 3 × 3 rotation matrix, like the first posture of the input device 8. In this matrix, each component of the following three vectors when the line-of-sight direction of the virtual camera 91 is the forward direction is used as each element of the matrix.
-Vector CX = (CXx, CXy, CXz) pointing to the right (corresponding to the right of the screen)
-Vector CY = (CYx, CYy, CYz) pointing upward (corresponding to the upward direction of the screen)
-Vector CZ = (CZx, CZy, CZZ) facing backward
The matrix is a rotation matrix representing the rotation from a predetermined reference posture to the current virtual camera 91 posture. In the present embodiment, the predetermined reference posture is a posture in which the three vectors CX, CY, and CZ coincide with the directions of the x ″ axis, the y ″ axis, and the z ″ axis, respectively. In such a case, the line-of-sight direction of the virtual camera 91 faces in a direction perpendicular to the plane of the display object 92.

上記ステップS48においては、CPU10は、まず、上記基準姿勢から仮想カメラ91を回転させるべき角度(回転角度)をはみ出しベクトルVdに基づいて算出する。本実施形態においては、はみ出しベクトルVdのX’成分dxに応じて仮想カメラ91のy”軸回りの回転角度rXが算出され、はみ出しベクトルVdのY’成分dyに応じて仮想カメラ91のx”軸回りの回転角度rYが算出される。具体的には、CPU10は、はみ出しベクトルデータ78をメインメモリから読み出し、各回転角度rXおよびrYを下記の式(16)に従って算出する。
rX=dx×K1
rY=dy×K1 …(16)
上式(16)において、定数K1は予め定められる。なお、定数K1を大きくすると仮想カメラ91の回転角度が大きくなる。
In step S48, the CPU 10 first calculates an angle (rotation angle) at which the virtual camera 91 should be rotated from the reference posture based on the protrusion vector Vd. In the present embodiment, the rotation angle rX around the y ″ axis of the virtual camera 91 is calculated according to the X ′ component dx of the protrusion vector Vd, and x ″ of the virtual camera 91 according to the Y ′ component dy of the protrusion vector Vd. A rotation angle rY about the axis is calculated. Specifically, the CPU 10 reads the protrusion vector data 78 from the main memory, and calculates the rotation angles rX and rY according to the following equation (16).
rX = dx × K1
rY = dy × K1 (16)
In the above equation (16), the constant K1 is predetermined. If the constant K1 is increased, the rotation angle of the virtual camera 91 is increased.

上記ステップS48においては、次に、CPU10は、上記基準姿勢から上記回転角度だけ回転した仮想カメラ91の姿勢を算出する。具体的には、回転後の仮想カメラ91の姿勢を表す行列Mcは次の式(17)に従って算出される。

Figure 2011138295
上式(17)で算出された行列Mcを示すデータは、カメラ向きデータ79としてメインメモリに記憶される。以上のステップS48の後、CPU10はカメラ向き制御処理を終了する。 Next, in step S48, the CPU 10 calculates the attitude of the virtual camera 91 rotated by the rotation angle from the reference attitude. Specifically, the matrix Mc representing the posture of the virtual camera 91 after rotation is calculated according to the following equation (17).
Figure 2011138295
Data indicating the matrix Mc calculated by the above equation (17) is stored in the main memory as camera orientation data 79. After step S48, the CPU 10 ends the camera orientation control process.

上記ステップS48によれば、仮想カメラ91の姿勢の変化方向(基準姿勢から変化する方向)は、はみ出しベクトルVdの向きに応じて決定され、仮想カメラ91の姿勢の変化量(基準姿勢からの変化量、すなわち、上記回転角度)は、はみ出しベクトルVdの大きさに応じて決定される。したがって、表示範囲が変化する方向(仮想カメラ91の姿勢の変化方向に対応する)は、所定領域Arから仮想面座標が示す位置までの方向(はみ出しベクトルVdの向き)に応じて決定される。また、表示範囲が変化する度合(仮想カメラの姿勢の変化量に対応する)は、仮想面座標が示す位置が所定領域Arから離れている度合(はみ出しベクトルVdの大きさ)に応じて決定される。   According to the above step S48, the change direction of the posture of the virtual camera 91 (direction changing from the reference posture) is determined according to the direction of the protrusion vector Vd, and the change amount of the posture of the virtual camera 91 (change from the reference posture). The amount, that is, the rotation angle is determined according to the magnitude of the protrusion vector Vd. Accordingly, the direction in which the display range changes (corresponding to the change direction of the attitude of the virtual camera 91) is determined according to the direction from the predetermined area Ar to the position indicated by the virtual plane coordinates (the direction of the protrusion vector Vd). Further, the degree to which the display range changes (corresponding to the amount of change in the attitude of the virtual camera) is determined according to the degree to which the position indicated by the virtual plane coordinates is away from the predetermined area Ar (the magnitude of the protrusion vector Vd). The

なお、上記ステップS48の処理においては、仮想カメラの向き(姿勢)のみを変化させたが、他の実施形態においては、仮想カメラの向きおよび位置を変化させるようにしてもよい。例えば、基準姿勢である仮想カメラを右に向ける場合、CPU10は、仮想カメラ91の姿勢のみを変化させてもよいし、仮想カメラ91の姿勢を右に向けるとともに位置を右に移動させるようにしてもよい。   In the process of step S48, only the orientation (posture) of the virtual camera is changed. However, in other embodiments, the orientation and position of the virtual camera may be changed. For example, when the virtual camera that is the reference posture is turned to the right, the CPU 10 may change only the posture of the virtual camera 91, or the posture of the virtual camera 91 is turned to the right and the position is moved to the right. Also good.

一方、ステップS49において、CPU10は、仮想カメラ91を基準姿勢となるように制御する。基準姿勢を表す行列は、上式(17)において、回転角度を示す変数rXおよびrYを“0”としたときの行列となる。CPU10は、基準姿勢を表す行列を示すデータをカメラ向きデータ79としてメインメモリに記憶する。以上のステップS48の後、CPU10はカメラ向き制御処理を終了する。   On the other hand, in step S49, the CPU 10 controls the virtual camera 91 to be in the reference posture. The matrix representing the reference posture is a matrix when the variables rX and rY indicating the rotation angle are set to “0” in the above equation (17). The CPU 10 stores data indicating a matrix representing the reference posture in the main memory as camera orientation data 79. After step S48, the CPU 10 ends the camera orientation control process.

以上に説明したカメラ向き制御処理によれば、仮想面座標が所定領域Ar内にある場合には、仮想カメラ91は基準姿勢に固定される(ステップS49)ので、表示範囲は移動しない。このように、本実施形態においては、表示範囲を移動させる処理(ステップS47およびS48)は、仮想面座標が平面Qにおける所定領域Arの外側の位置を示す場合に実行される。一方、仮想面座標が所定領域Ar外となった場合には、仮想面座標が所定領域Arから外れた方向および外れた度合に応じて仮想カメラ91の姿勢が制御される結果、当該外れた方向および度合に応じて表示範囲が移動する。ここで、本実施形態においては、仮想面座標が所定領域Ar内にある場合とは、入力装置8がテレビ2の画面の方を向く、すなわち、入力装置8が画面上の位置を指し示す場合である。また、仮想面座標が所定領域Ar外にある場合とは、入力装置8の向きがテレビ2の画面から外れる、すなわち、入力装置8の指し示す位置が画面上から外れる場合である。したがって、上記カメラ向き制御処理によれば、ユーザは、入力装置8の向きをテレビ2の画面から外すように操作することによって、表示範囲を移動させることができる(図21参照)。   According to the camera orientation control process described above, when the virtual plane coordinates are within the predetermined area Ar, the virtual camera 91 is fixed to the reference posture (step S49), so the display range does not move. Thus, in the present embodiment, the process of moving the display range (steps S47 and S48) is executed when the virtual plane coordinates indicate a position outside the predetermined area Ar on the plane Q. On the other hand, when the virtual plane coordinates are out of the predetermined area Ar, the orientation of the virtual camera 91 is controlled according to the direction in which the virtual plane coordinates are out of the predetermined area Ar and the degree to which the virtual plane coordinates are out. The display range moves according to the degree. Here, in this embodiment, the case where the virtual plane coordinates are within the predetermined area Ar is a case where the input device 8 faces the screen of the television 2, that is, the input device 8 points to a position on the screen. is there. Further, the case where the virtual plane coordinates are outside the predetermined area Ar is a case where the direction of the input device 8 deviates from the screen of the television 2, that is, the position pointed to by the input device 8 deviates from the screen. Therefore, according to the camera orientation control process, the user can move the display range by operating the input device 8 so that the orientation of the input device 8 is removed from the screen of the television 2 (see FIG. 21).

なお、上記カメラ向き制御処理では、CPU10は、仮想面座標が所定領域Arから離れている度合に基づいて表示範囲の移動量を決定した。ここで、他の実施形態においては、CPU10は、上記度合に基づいて表示範囲の速さ(単位時間当たりの移動量)を決定するようにしてもよい。すなわち、CPU10は、仮想面座標が所定領域Arの外へ出た場合、上記度合に応じた角速度で仮想カメラを回転させるようにしてもよい。これによれば、ユーザは、入力装置8の向きをテレビ2の画面から外した状態で静止させても、仮想カメラを回転させて表示範囲を変化させることができる。   In the camera orientation control process, the CPU 10 determines the amount of movement of the display range based on the degree to which the virtual plane coordinates are away from the predetermined area Ar. Here, in another embodiment, the CPU 10 may determine the speed of the display range (movement amount per unit time) based on the above degree. That is, when the virtual plane coordinates go out of the predetermined area Ar, the CPU 10 may rotate the virtual camera at an angular velocity corresponding to the above degree. According to this, even if the user stops the input device 8 in a state in which the direction of the input device 8 is removed from the screen of the television 2, the display range can be changed by rotating the virtual camera.

図20の説明に戻り、ステップS42において、CPU10はカメラ位置制御処理を実行する。カメラ位置制御処理は、仮想面座標に基づいて仮想カメラの位置を制御する処理である。以下、図25〜図31を参照して、カメラ位置制御処理について説明する。   Returning to FIG. 20, in step S42, the CPU 10 executes a camera position control process. The camera position control process is a process for controlling the position of the virtual camera based on the virtual plane coordinates. Hereinafter, the camera position control process will be described with reference to FIGS.

カメラ位置制御処理における制御方法は種々考えられるが、以下では、例として4種類の制御方法について説明する。図25は、仮想カメラの位置制御に関する第1〜第4の制御方法の例を示す図である。なお、図25においては、CPU10は、仮想面座標から算出される画面座標の位置にカーソル93を表示するものとする。   Although various control methods in the camera position control process can be considered, four types of control methods will be described below as an example. FIG. 25 is a diagram illustrating examples of first to fourth control methods relating to position control of the virtual camera. In FIG. 25, the CPU 10 displays the cursor 93 at the position of the screen coordinates calculated from the virtual plane coordinates.

第1の制御方法は、仮想面座標の移動量および移動方向に応じて仮想カメラの位置を制御する方法である。第1の制御方法では、仮想面座標の(所定の期間における)移動量に応じた量で、かつ、仮想面座標の移動方向に応じた方向へ仮想カメラを移動させる。なお、本実施形態においては、ユーザが指定した期間(例えば、ユーザが入力装置8の所定のボタンを押下している期間)のみ、第1の制御方法による仮想カメラの移動が行われるものとする。第1の制御方法によれば、図25の上段に示されるように、ユーザがある時点において所定のボタンを押下し、所定のボタンを押下したままカーソル93を左に移動させた(仮想面座標をX’軸負方向に移動させた)場合、画面に表示される画像がカーソル93とともに移動される(つまり、表示範囲が右に移動する)。このとき、本実施形態では、カーソル93が指し示す表示対象の位置(図25では、「D」の文字の位置)が表示範囲の移動前後で変化しないように、仮想カメラの位置が制御される。つまり、本実施形態では、カーソル93の指し示す表示対象の位置を固定したまま、表示範囲を移動させることができる。   The first control method is a method of controlling the position of the virtual camera in accordance with the movement amount and movement direction of the virtual plane coordinates. In the first control method, the virtual camera is moved in an amount corresponding to the moving amount of the virtual surface coordinates (in a predetermined period) and in a direction corresponding to the moving direction of the virtual surface coordinates. In the present embodiment, it is assumed that the virtual camera is moved by the first control method only during a period designated by the user (for example, a period during which the user presses a predetermined button of the input device 8). . According to the first control method, as shown in the upper part of FIG. 25, the user presses a predetermined button at a certain point in time, and moves the cursor 93 to the left while pressing the predetermined button (virtual plane coordinates). Is moved in the negative direction of the X ′ axis), the image displayed on the screen is moved together with the cursor 93 (that is, the display range is moved to the right). At this time, in this embodiment, the position of the virtual camera is controlled so that the position of the display target pointed by the cursor 93 (the position of the character “D” in FIG. 25) does not change before and after the movement of the display range. That is, in the present embodiment, the display range can be moved while the position of the display target pointed by the cursor 93 is fixed.

第2の制御方法は、所定の基準位置から仮想面座標への方向に応じた方向へ仮想カメラを継続的に移動させる方法である。第2の制御方法では、上記基準位置から仮想面座標が示す位置への方向に応じて仮想カメラの移動方向を制御する。また、本実施形態においては、上記基準位置から仮想面座標が示す位置までの距離(図25に示す矢印94参照)に応じて仮想カメラの移動速度を制御する。なお、所定の基準位置は、例えば、ユーザが入力装置8の所定のボタンを押下した(あるいは押下し始めた)時点における仮想面座標の位置である。ただし、所定の基準位置は、どのような位置であってもよく、例えば予め定められた位置でもよい。第2の制御方法によれば、ユーザがある時点において所定のボタンを押下し、その後、カーソル93を右に移動させると、表示範囲は右に継続的に移動していく(図25の上段参照)。なお、本実施形態では、上記長さが長いほど移動速度が大きくなる。また、本実施形態では、第1の制御方法と同様、ユーザが指定した期間のみ、第2の制御方法による仮想カメラの移動が行われるものとする。   The second control method is a method of continuously moving the virtual camera in a direction corresponding to the direction from the predetermined reference position to the virtual plane coordinates. In the second control method, the moving direction of the virtual camera is controlled according to the direction from the reference position to the position indicated by the virtual plane coordinates. In the present embodiment, the moving speed of the virtual camera is controlled according to the distance from the reference position to the position indicated by the virtual plane coordinates (see arrow 94 shown in FIG. 25). The predetermined reference position is, for example, the position of the virtual plane coordinates when the user presses (or starts to press) a predetermined button of the input device 8. However, the predetermined reference position may be any position, for example, a predetermined position. According to the second control method, when the user presses a predetermined button at a certain time and then moves the cursor 93 to the right, the display range continuously moves to the right (see the upper part of FIG. 25). ). In the present embodiment, the moving speed increases as the length increases. In the present embodiment, as in the first control method, the virtual camera is moved by the second control method only during a period specified by the user.

第3および第4の制御方法は、仮想面座標が上記所定領域Ar外になった場合にカメラを移動させる方法である。本実施形態では、仮想カメラは、所定領域Arから仮想面座標が示す位置までの方向に応じた方向に移動される。第3および第4の制御方法によれば、入力装置8が指し示す位置を画面内から画面外へ移動させた場合、表示範囲は、当該位置が画面外へ出た方向に移動する。例えば、図25の下段に示されるように、入力装置8が指し示す位置を画面の右側へ移動させた場合、表示範囲は右へ移動する。   The third and fourth control methods are methods of moving the camera when the virtual plane coordinates are outside the predetermined area Ar. In the present embodiment, the virtual camera is moved in a direction corresponding to the direction from the predetermined area Ar to the position indicated by the virtual plane coordinates. According to the third and fourth control methods, when the position pointed to by the input device 8 is moved from the inside of the screen to the outside of the screen, the display range moves in the direction in which the position goes out of the screen. For example, as shown in the lower part of FIG. 25, when the position indicated by the input device 8 is moved to the right side of the screen, the display range moves to the right.

なお、第3の制御方法と第4の制御方法との違いは、仮想カメラの移動速度を算出する方法にある。すなわち、第3の制御方法においては、仮想カメラの移動速度は、仮想面座標が所定領域Arから離れている度合に基づいて算出される。一方、第4の制御方法においては、仮想カメラの移動速度は、仮想面座標が所定領域Arの外側に位置する間における仮想面座標の速度に基づいて算出される。   Note that the difference between the third control method and the fourth control method is in the method of calculating the moving speed of the virtual camera. That is, in the third control method, the moving speed of the virtual camera is calculated based on the degree to which the virtual plane coordinates are away from the predetermined area Ar. On the other hand, in the fourth control method, the moving speed of the virtual camera is calculated based on the speed of the virtual plane coordinates while the virtual plane coordinates are located outside the predetermined area Ar.

次に、図26を参照して、上記第1の制御方法の詳細について説明する。図26は、第1の制御方法を採用する場合におけるカメラ位置制御処理(ステップS42)の流れを示すフローチャートである。この場合、まずステップS51において、CPU10は、現時点が、カメラ位置を移動すべき所定期間であるか否かを判定する。所定期間は、ユーザによって指定される期間であり、本実施形態では、入力装置8のBボタン32iが押下されている間の期間とする。すなわち、CPU10は、メインメモリに記憶されている操作ボタンデータ66を参照し、Bボタン32iが押下されているか否かを判定する。ステップS51の判定結果が肯定である場合、ステップS52およびS53の処理が実行される。一方、ステップS51の判定結果が否定である場合、CPU10はカメラ位置制御処理を終了する。つまり、Bボタン32iが押下されていない場合、仮想カメラの位置は移動されない。このように、本実施形態においては、CPU10は、ユーザが入力装置8を用いて指定した期間においてのみ、仮想面座標に基づく表示範囲の移動を行う。   Next, the details of the first control method will be described with reference to FIG. FIG. 26 is a flowchart showing the flow of the camera position control process (step S42) when the first control method is adopted. In this case, first, in step S51, the CPU 10 determines whether or not the current time is a predetermined period for moving the camera position. The predetermined period is a period specified by the user. In the present embodiment, the predetermined period is a period during which the B button 32i of the input device 8 is pressed. That is, the CPU 10 refers to the operation button data 66 stored in the main memory, and determines whether or not the B button 32i is pressed. If the determination result of step S51 is affirmative, the processes of steps S52 and S53 are executed. On the other hand, if the determination result of step S51 is negative, the CPU 10 ends the camera position control process. That is, when the B button 32i is not pressed, the position of the virtual camera is not moved. As described above, in the present embodiment, the CPU 10 moves the display range based on the virtual plane coordinates only during a period designated by the user using the input device 8.

ステップS52において、CPU10は、仮想面座標の移動量・移動方向を算出する。この移動量・移動方向は、仮想面座標の速度を意味し、今回のステップS3〜S9の処理ループにおける仮想面座標と、前回の処理ループにおける仮想面座標との差分として算出される。すなわち、CPU10は、前回の仮想面座標を始点とし今回の仮想面座標を終点とする速度ベクトルを算出する。ステップS52の次にステップS53の処理が実行される。   In step S52, the CPU 10 calculates the movement amount / movement direction of the virtual plane coordinates. This movement amount / movement direction means the speed of the virtual surface coordinates, and is calculated as a difference between the virtual surface coordinates in the current processing loop of steps S3 to S9 and the virtual surface coordinates in the previous processing loop. That is, the CPU 10 calculates a velocity vector having the previous virtual plane coordinate as the start point and the current virtual plane coordinate as the end point. Following step S52, the process of step S53 is executed.

ステップS53において、CPU10は、仮想面座標の移動量・移動方向に応じて仮想カメラを移動させる。本実施形態では、CPU10は、カーソル93が指し示す表示対象の位置が仮想カメラの移動前後で変化しないようにする。具体的には、まず、仮想カメラを移動すべき移動量および移動方向を表すベクトル(移動ベクトル)Cvが算出される。上記ステップS52で算出された速度ベクトルを(Vrx,Vry)とすると、上記移動ベクトルCv=(Cvx,Cvy)は、次の式(18)に従って算出される。
Cvx=Vrx
Cvy=Vry …(18)
上式(18)に示されるように、ここでは、第1の仮想空間の平面QにおけるX’軸と第2の仮想空間におけるx”軸とが対応し、第1の仮想空間の平面QにおけるY’軸と第2の仮想空間におけるy”軸とが対応するように仮想カメラを移動させている。なお、ここでは、平面QにおけるX’Y’座標系と第2の仮想空間におけるx”y”z”座標系との大きさが等しい(X’Y’座標系における長さ1が、x”y”z”座標系における長さ1に相当する)ものとする。
In step S53, the CPU 10 moves the virtual camera according to the movement amount / movement direction of the virtual plane coordinates. In the present embodiment, the CPU 10 prevents the position of the display target indicated by the cursor 93 from changing before and after the movement of the virtual camera. Specifically, first, a vector (movement vector) Cv representing the amount and direction of movement of the virtual camera to be moved is calculated. When the velocity vector calculated in step S52 is (Vrx, Vry), the movement vector Cv = (Cvx, Cvy) is calculated according to the following equation (18).
Cvx = Vrx
Cvy = Vry (18)
As shown in the above equation (18), here, the X ′ axis in the plane Q of the first virtual space and the x ″ axis in the second virtual space correspond to each other in the plane Q of the first virtual space. The virtual camera is moved so that the Y ′ axis corresponds to the y ″ axis in the second virtual space. Here, the X′Y ′ coordinate system in the plane Q and the x ″ y ″ z ″ coordinate system in the second virtual space have the same size (the length 1 in the X′Y ′ coordinate system is x ″). y "z" coordinate system).

上記移動ベクトルCvが算出されると、次に、移動ベクトルCvに従って仮想カメラが移動される。すなわち、CPU10は、メインメモリからカメラ位置データ80を読み出し、カメラ位置データが示す位置を、上記移動ベクトルCvだけ移動させた位置を算出する。算出された位置が移動後の仮想カメラの位置となる。算出された位置を示すデータは、新たなカメラ位置データ80としてメインメモリに記憶される。以上のステップS53の後、CPU10はカメラ位置制御処理を終了する。   Once the movement vector Cv is calculated, the virtual camera is then moved according to the movement vector Cv. That is, the CPU 10 reads the camera position data 80 from the main memory, and calculates a position obtained by moving the position indicated by the camera position data by the movement vector Cv. The calculated position becomes the position of the virtual camera after movement. Data indicating the calculated position is stored in the main memory as new camera position data 80. After step S53 described above, the CPU 10 ends the camera position control process.

上記ステップS51〜S53の処理によれば、仮想面座標の移動量・移動方向に応じた移動量・移動方向だけ仮想カメラが移動される。したがって、第1の制御方法によれば、ユーザは、入力装置8の姿勢を変化させた方向へ、変化させた角度に応じた量だけ、表示範囲を移動させることができる(図25)。第1の制御方法では、入力装置8の変化量が表示範囲の移動量に対応するので、第1の制御方法を採用する場合には、ユーザは表示範囲の移動量を細かく制御することが容易である。したがって、表示範囲の移動量を細かく操作し、表示範囲の位置を精度良く操作する必要がある場合には、第1の制御方法は特に有効である。   According to the processing of steps S51 to S53, the virtual camera is moved by the movement amount / movement direction corresponding to the movement amount / movement direction of the virtual plane coordinates. Therefore, according to the first control method, the user can move the display range in the direction in which the attitude of the input device 8 is changed by an amount corresponding to the changed angle (FIG. 25). In the first control method, the amount of change of the input device 8 corresponds to the amount of movement of the display range. Therefore, when the first control method is adopted, the user can easily control the amount of movement of the display range. It is. Therefore, the first control method is particularly effective when the amount of movement of the display range needs to be finely manipulated and the position of the display range needs to be manipulated with high accuracy.

また、本実施形態においては、カーソル93が指し示す表示対象の位置は、上記処理によって変化しないので、上記処理によれば、カーソル93が指し示す対象を変化させずに表示範囲を移動させることができる。なお、他の実施形態においては、カーソル93が指し示す表示対象の位置は、仮想カメラの移動前後で変化してもよい。   Further, in the present embodiment, the position of the display target pointed to by the cursor 93 does not change by the above processing, so that the display range can be moved without changing the target pointed to by the cursor 93 according to the above processing. In other embodiments, the position of the display target indicated by the cursor 93 may change before and after the movement of the virtual camera.

また、本実施形態では、CPU10は、ユーザが指定する上記所定期間のみ仮想カメラの移動処理を行うので、所定期間以外の期間では仮想カメラは移動されない。したがって、詳細は後述するが、所定期間以外の期間では、画面上のカーソルの位置のみが入力装置8に対する操作に応じて制御されることになる。そのため、本実施形態によれば、入力装置8に対する操作を、仮想カメラの制御(表示範囲の移動制御)と、カーソルの制御との両方に用いることができる。ユーザは、入力装置8を用いて、カーソルの移動と表示範囲の移動との両方を行うことができるので、本実施形態によれば非常に操作しやすい操作方法を提供することができる。   Further, in the present embodiment, the CPU 10 performs the virtual camera movement process only during the predetermined period specified by the user, so the virtual camera is not moved during a period other than the predetermined period. Therefore, although details will be described later, only the position of the cursor on the screen is controlled in accordance with an operation on the input device 8 during a period other than the predetermined period. Therefore, according to the present embodiment, the operation on the input device 8 can be used for both control of the virtual camera (display range movement control) and control of the cursor. Since the user can perform both the movement of the cursor and the movement of the display range using the input device 8, according to the present embodiment, an operation method that is very easy to operate can be provided.

なお、上記ステップS51では、上記所定期間は、入力装置8のBボタン32iが押下されている間の期間であったが、他の実施形態においては、ユーザによって指定される期間であればよい。例えば、所定期間は、ユーザによってある操作が行われてから、その後にさらに操作が行われるまでの期間(例えば、Bボタン32iが押下されてから、次にBボタン32iが押下されるまでの期間)であってもよいし、ユーザによってある操作が行われてから予め定められた所定時間が経過するまでの期間であってもよい。   In step S51, the predetermined period is a period during which the B button 32i of the input device 8 is pressed. In other embodiments, the predetermined period may be a period specified by the user. For example, the predetermined period is a period from when an operation is performed by the user until a further operation is performed thereafter (for example, a period from when the B button 32i is pressed until the next B button 32i is pressed) ), Or a period until a predetermined time elapses after a certain operation is performed by the user.

次に、図27を参照して、上記第2の制御方法の詳細について説明する。図27は、第2の制御方法を採用する場合におけるカメラ位置制御処理(ステップS42)の流れを示すフローチャートである。この場合、まずステップS55において、CPU10は、現時点が、カメラ位置を移動すべき所定期間であるか否かを判定する。ステップS55の処理は上記ステップS51と同じである。ステップS55の判定結果が肯定である場合、ステップS56およびS57の処理が実行される。一方、ステップS55の判定結果が否定である場合、CPU10はカメラ位置制御処理を終了する。   Next, the details of the second control method will be described with reference to FIG. FIG. 27 is a flowchart showing the flow of the camera position control process (step S42) when the second control method is adopted. In this case, first, in step S55, the CPU 10 determines whether or not the current time is a predetermined period for moving the camera position. The process in step S55 is the same as that in step S51. If the determination result of step S55 is affirmative, the processes of steps S56 and S57 are executed. On the other hand, when the determination result of step S55 is negative, the CPU 10 ends the camera position control process.

ステップS56において、CPU10は、所定期間が開始したか否かを判定する。ステップS56の判定は、前回の処理ループにおけるステップS55の判定結果を参照することによって行うことができる。すなわち、前回の処理ループにおけるステップS55の判定結果が否定であった場合、今回の処理ループにおいて所定期間が開始したと判断することができる。ステップS56の判定結果が肯定である場合、ステップS57の処理が実行される。一方、ステップS56の判定結果が否定である場合、ステップS57の処理がスキップされてステップS58の処理が実行される。   In step S56, the CPU 10 determines whether or not the predetermined period has started. The determination in step S56 can be made by referring to the determination result in step S55 in the previous processing loop. That is, if the determination result of step S55 in the previous processing loop is negative, it can be determined that the predetermined period has started in the current processing loop. If the determination result of step S56 is affirmative, the process of step S57 is executed. On the other hand, when the determination result of step S56 is negative, the process of step S57 is skipped and the process of step S58 is executed.

ステップS57において、CPU10は、上記ステップS7で算出された仮想面座標を、所定の基準位置を示す座標としてメインメモリに記憶する。このように、本実施形態においては、上記所定期間が開始した時点における仮想面座標の位置が所定の基準位置となる。なお、他の実施形態においては、所定の基準位置は、予め定められていてもよく、例えば、上述した投影点Tの位置を所定の基準位置としてもよい。ステップS57の次にステップS58の処理が実行される。   In step S57, the CPU 10 stores the virtual plane coordinates calculated in step S7 in the main memory as coordinates indicating a predetermined reference position. Thus, in the present embodiment, the position of the virtual plane coordinates at the time when the predetermined period starts is the predetermined reference position. In another embodiment, the predetermined reference position may be determined in advance. For example, the position of the projection point T described above may be set as the predetermined reference position. Following step S57, the process of step S58 is executed.

ステップS58において、CPU10は、所定の基準位置と仮想面座標が示す位置までの差分を算出する。具体的には、CPU10は、ステップS57で記憶される所定の基準位置を示すデータと、仮想面座標データ77とをメインメモリから読み出す。そして、仮想面座標の値から所定の基準位置を表す座標値を減算することで、上記差分を算出する。ステップS58の次にステップS59の処理が実行される。   In step S58, the CPU 10 calculates a difference between the predetermined reference position and the position indicated by the virtual plane coordinates. Specifically, the CPU 10 reads data indicating the predetermined reference position stored in step S57 and the virtual plane coordinate data 77 from the main memory. Then, the difference is calculated by subtracting a coordinate value representing a predetermined reference position from the value of the virtual surface coordinates. Following step S58, the process of step S59 is executed.

ステップS59において、CPU10は、ステップS58で算出された差分に応じて仮想カメラを移動させる。具体的には、まず、上記ステップS53と同様の移動ベクトルCvが算出される。第2の制御方法においては、移動ベクトルCv=(Cvx,Cvy)は、次の式(19)に従って算出される。
Cvx=Δx×K2
Cvy=Δy×K2 …(19)
上式(19)において、変数Δxは上記差分のX’成分であり、変数Δyは上記差分のY’成分である。定数K2は予め定められる。なお、定数K2を大きくすると仮想カメラの移動速度が大きくなる。なお、上式(19)によれば、上記差分が大きくなりすぎると、移動ベクトルCvが大きくなりすぎる結果、表示範囲の移動が速くなりすぎるおそれがある。そのため、他の実施形態においては、CPU10は、移動ベクトルCvの大きさに上限値を設けておき、上限値を超えないように移動ベクトルCvを補正するようにしてもよい。
In step S59, the CPU 10 moves the virtual camera according to the difference calculated in step S58. Specifically, first, a movement vector Cv similar to that in step S53 is calculated. In the second control method, the movement vector Cv = (Cvx, Cvy) is calculated according to the following equation (19).
Cvx = Δx × K2
Cvy = Δy × K2 (19)
In the above equation (19), the variable Δx is the X ′ component of the difference, and the variable Δy is the Y ′ component of the difference. The constant K2 is predetermined. If the constant K2 is increased, the moving speed of the virtual camera is increased. According to the above equation (19), if the difference becomes too large, the movement vector Cv becomes too large, and as a result, the display range may move too quickly. Therefore, in another embodiment, the CPU 10 may provide an upper limit value for the magnitude of the movement vector Cv and correct the movement vector Cv so as not to exceed the upper limit value.

上記移動ベクトルCvが算出されると、次に、移動ベクトルCvに従って仮想カメラが移動される。移動ベクトルCvに基づいて仮想カメラの移動後の位置を算出する方法は、ステップS59においても上記ステップS53と同様である。算出された移動後の仮想カメラの位置を示すデータは、新たなカメラ位置データ80としてメインメモリに記憶される。以上のステップS59の後、CPU10はカメラ位置制御処理を終了する。   Once the movement vector Cv is calculated, the virtual camera is then moved according to the movement vector Cv. The method for calculating the position after movement of the virtual camera based on the movement vector Cv is the same as in step S53 in step S59. Data indicating the calculated position of the virtual camera after movement is stored in the main memory as new camera position data 80. After the above step S59, the CPU 10 ends the camera position control process.

上記ステップS55〜S59の処理によれば、所定の基準位置と仮想面座標との差分に応じた移動量・移動方向だけ仮想カメラが移動される。したがって、第2の制御方法によれば、ユーザは、上記基準位置に対応する(入力装置8の)基準姿勢から入力装置8の姿勢を変化させた方向へ、変化させた量に応じた速度で、表示範囲を移動させることができる(図25)。第2の制御方法では、ユーザは、基準姿勢から傾いた状態にしていれば、入力装置8を静止させていても表示範囲を移動させることができる。そのため、表示対象が非常に大きいために表示範囲を大きく移動させる必要がある場合には、第2の制御方法は特に有効である。   According to the processing of steps S55 to S59, the virtual camera is moved by the movement amount / movement direction according to the difference between the predetermined reference position and the virtual plane coordinates. Therefore, according to the second control method, the user moves from the reference posture (of the input device 8) corresponding to the reference position to the direction in which the posture of the input device 8 is changed at a speed corresponding to the changed amount. The display range can be moved (FIG. 25). In the second control method, the user can move the display range even when the input device 8 is stationary as long as the user is tilted from the reference posture. Therefore, the second control method is particularly effective when the display range needs to be moved greatly because the display target is very large.

また、本実施形態では、第2の制御方法においても第1の制御方法と同様、CPU10は、ユーザが指定する上記所定期間のみ仮想カメラの移動処理を行う。したがって、第2の制御方法を採用する場合においても、ユーザは、入力装置8を用いてカーソルの移動と表示範囲の移動との両方を行うことができ、操作しやすい操作方法を提供することができる。   In this embodiment, also in the second control method, as in the first control method, the CPU 10 performs the movement process of the virtual camera only for the predetermined period specified by the user. Therefore, even when the second control method is employed, the user can perform both the movement of the cursor and the movement of the display range by using the input device 8, and an operation method that is easy to operate can be provided. it can.

次に、図28を参照して、第3の制御方法の詳細について説明する。図28は、第3の制御方法を採用する場合におけるカメラ位置制御処理(ステップS42)の流れを示すフローチャートである。この場合、まずステップS61において、CPU10は、仮想面座標は所定領域Arの外にあるか否かを判定する。ステップS61の処理は上述したステップS46の処理と同じである。ステップS61の判定結果が肯定である場合、ステップS62の処理が実行される。ステップS61の判定結果が否定である場合、CPU10はカメラ位置制御処理を終了する。つまり、第3の制御方法においても、上記仮想カメラ向き制御処理(ステップS46〜S48)と同様、仮想面座標が所定領域Ar外となった場合にのみ、仮想カメラが制御されて表示範囲が移動する。   Next, details of the third control method will be described with reference to FIG. FIG. 28 is a flowchart showing the flow of the camera position control process (step S42) when the third control method is adopted. In this case, first, in step S61, the CPU 10 determines whether or not the virtual plane coordinates are outside the predetermined area Ar. The process in step S61 is the same as the process in step S46 described above. If the determination result of step S61 is affirmative, the process of step S62 is executed. When the determination result of step S61 is negative, the CPU 10 ends the camera position control process. That is, also in the third control method, as in the virtual camera orientation control process (steps S46 to S48), the virtual camera is controlled to move the display range only when the virtual plane coordinates are outside the predetermined area Ar. To do.

ステップS62において、CPU10ははみ出しベクトルVdを算出する。ステップS62の処理はステップS47の処理と同じである。ステップS62の次のステップS63において、CPU10は、はみ出しベクトルVdに基づいて仮想カメラの位置を制御する。第3の制御方法においては、仮想カメラは、はみ出しベクトルVdの方向に応じた方向へ、はみ出しベクトルVdの大きさに応じた速さ(移動量)で、移動される。具体的には、CPU10は、移動ベクトルCv=(Cvx,Cvy)を、下記の式(20)に従って算出する。
Cvx=dx×K3
Cvy=dy×K3 …(20)
上式(20)において、変数dxおよびdyは、はみ出しベクトルVdのX’成分およびY’成分である。また、定数K3は予め定められる。なお、定数K3を大きくすると仮想カメラの移動速度が大きくなる。
In step S62, the CPU 10 calculates a protrusion vector Vd. The process of step S62 is the same as the process of step S47. In step S63 subsequent to step S62, the CPU 10 controls the position of the virtual camera based on the protrusion vector Vd. In the third control method, the virtual camera is moved in a direction corresponding to the direction of the protrusion vector Vd at a speed (movement amount) corresponding to the magnitude of the protrusion vector Vd. Specifically, the CPU 10 calculates the movement vector Cv = (Cvx, Cvy) according to the following equation (20).
Cvx = dx × K3
Cvy = dy × K3 (20)
In the above equation (20), the variables dx and dy are the X ′ component and the Y ′ component of the protrusion vector Vd. The constant K3 is determined in advance. If the constant K3 is increased, the moving speed of the virtual camera is increased.

上記移動ベクトルCvを算出した後、CPU10は、移動ベクトルCvに従って仮想カメラを移動する。移動ベクトルCvに基づいて仮想カメラの移動後の位置を算出する方法は、上記ステップS53等と同様である。算出された移動後の仮想カメラの位置を示すデータは、新たなカメラ位置データ80としてメインメモリに記憶される。ステップS63の後、CPU10はカメラ位置制御処理を終了する。   After calculating the movement vector Cv, the CPU 10 moves the virtual camera according to the movement vector Cv. The method for calculating the position after movement of the virtual camera based on the movement vector Cv is the same as in step S53 and the like. Data indicating the calculated position of the virtual camera after movement is stored in the main memory as new camera position data 80. After step S63, the CPU 10 ends the camera position control process.

以上のように、上記ステップS61〜S63の処理によれば、仮想面座標が上記所定領域Ar外になった場合に、所定領域Arから仮想面座標までの方向に応じた方向に仮想カメラが移動される。したがって、上記第3の制御方法においても上記仮想カメラ向き制御処理(ステップS46〜S48)と同様、ユーザは、入力装置8の向きをテレビ2の画面から外すように操作することによって、表示範囲を移動させることができる(図25参照)。   As described above, according to the processes in steps S61 to S63, when the virtual plane coordinates are outside the predetermined area Ar, the virtual camera moves in a direction corresponding to the direction from the predetermined area Ar to the virtual plane coordinates. Is done. Therefore, also in the third control method, as in the virtual camera direction control process (steps S46 to S48), the user operates the input device 8 so as to remove the direction of the input device 8 from the screen of the television 2, thereby setting the display range. It can be moved (see FIG. 25).

また、上記ステップS61〜S63の処理によれば、仮想カメラの移動量(移動ベクトルCvの大きさ)は、所定領域Arから仮想面座標までの距離(はみ出しベクトルVdの大きさ)に応じて決定される。そのため、仮想面座標が停止していても仮想カメラは移動するので、ユーザは、(入力装置8の向きを画面から外していれば)入力装置8を動かしていない時でも表示範囲を移動させることができる。したがって、第3の制御方法は第2の制御方法と同様、表示対象が非常に大きいために表示範囲を大きく移動させる必要がある場合等に特に有効である。   Further, according to the processing of steps S61 to S63, the movement amount of the virtual camera (the magnitude of the movement vector Cv) is determined according to the distance from the predetermined area Ar to the virtual plane coordinates (the magnitude of the protrusion vector Vd). Is done. Therefore, since the virtual camera moves even if the virtual plane coordinates are stopped, the user can move the display range even when the input device 8 is not moved (if the orientation of the input device 8 is off the screen). Can do. Therefore, like the second control method, the third control method is particularly effective when the display range needs to be moved greatly because the display target is very large.

なお、本実施形態における第3の制御方法では、CPU10は、仮想面座標が所定領域Arから離れている度合に基づいて表示範囲の速さ(単位時間当たりの移動量)を決定した。ここで、他の実施形態においては、CPU10は、上記度合に基づいて表示範囲の移動量を決定するようにしてもよい。すなわち、CPU10は、仮想面座標が所定領域Arの外へ出た場合、上記度合に応じた量だけ表示範囲を移動させ、仮想面座標が停止した場合には表示範囲を停止させるようにしてもよい。   In the third control method in the present embodiment, the CPU 10 determines the speed of the display range (the amount of movement per unit time) based on the degree to which the virtual plane coordinates are away from the predetermined area Ar. Here, in another embodiment, the CPU 10 may determine the amount of movement of the display range based on the above degree. That is, the CPU 10 moves the display range by an amount corresponding to the above degree when the virtual plane coordinates go out of the predetermined area Ar, and stops the display range when the virtual plane coordinates stop. Good.

次に、図29〜図31を参照して、第4の制御方法の詳細について説明する。図29は、第4の制御方法を採用する場合においてゲーム装置3のメインメモリに記憶されるゲーム処理用データ67を示す図である。なお、図29においては、図13に示すデータについては記載を省略しているが、第4の制御方法を採用する場合においても図13に示すデータはメインメモリに記憶されている。   Next, details of the fourth control method will be described with reference to FIGS. 29 to 31. FIG. 29 is a diagram showing game processing data 67 stored in the main memory of the game apparatus 3 when the fourth control method is employed. In FIG. 29, the description of the data shown in FIG. 13 is omitted, but the data shown in FIG. 13 is stored in the main memory even when the fourth control method is adopted.

図29に示すように、第4の制御方法を採用する場合、ゲーム処理用データ67は、図13に示すデータの他、スクロール成分速度データ83、速度最大値データ84、および速度最小値データ85をさらに含む。   As shown in FIG. 29, when the fourth control method is adopted, the game processing data 67 includes scroll component speed data 83, maximum speed data 84, and minimum speed data 85 in addition to the data shown in FIG. Further includes.

スクロール成分速度データ83は、仮想面座標のスクロール成分速度Sを示すデータである。ここで、仮想面座標のスクロール成分速度Sは、仮想面座標の速度のうち、上記所定領域Arから仮想面座標への方向の成分(スクロール成分と呼ぶ)の大きさを表す(図31参照)。詳細は後述するが、本実施形態では、所定領域Arから仮想面座標への方向が、表示範囲の移動方向、すなわち、画像のスクロール方向と対応することになる。そのため、以下では、所定領域Arから仮想面座標への方向を「スクロール方向」と呼ぶ。   The scroll component speed data 83 is data indicating the scroll component speed S of the virtual plane coordinates. Here, the scroll component speed S of the virtual surface coordinates represents the magnitude of the component (referred to as a scroll component) in the direction from the predetermined area Ar to the virtual surface coordinates among the speeds of the virtual surface coordinates (see FIG. 31). . Although details will be described later, in this embodiment, the direction from the predetermined area Ar to the virtual plane coordinates corresponds to the moving direction of the display range, that is, the scroll direction of the image. Therefore, hereinafter, the direction from the predetermined area Ar to the virtual plane coordinates is referred to as “scroll direction”.

速度最大値データ84は、仮想面座標が所定領域Ar外となっている期間における、上記スクロール成分速度Sの最大値を示す。また、速度最小値データ85は、上記期間におけるスクロール成分速度Sの最小値を示す。なお、これらの最大値および最小値は、仮想面座標が所定領域Arの内側に入った時点で消去(リセット)される。   The maximum velocity data 84 indicates the maximum value of the scroll component velocity S during the period when the virtual plane coordinates are outside the predetermined area Ar. Further, the minimum speed value data 85 indicates the minimum value of the scroll component speed S in the period. Note that these maximum and minimum values are erased (reset) when the virtual plane coordinates enter the inside of the predetermined area Ar.

図30は、第4の制御方法を採用する場合におけるカメラ位置制御処理(ステップS42)の流れを示すフローチャートである。この場合、まずステップS71において、CPU10は、仮想面座標は所定領域Arの外にあるか否かを判定する。ステップS71の処理は上述したステップS46の処理と同じである。ステップS71の判定結果が否定である場合、ステップS72の処理が実行される。一方、ステップS71の判定結果が肯定である場合、後述するステップS73の処理が実行される。   FIG. 30 is a flowchart showing the flow of the camera position control process (step S42) when the fourth control method is adopted. In this case, first, in step S71, the CPU 10 determines whether or not the virtual plane coordinates are outside the predetermined area Ar. The process of step S71 is the same as the process of step S46 described above. If the determination result of step S71 is negative, the process of step S72 is executed. On the other hand, when the determination result of step S71 is affirmative, the process of step S73 described later is executed.

ステップS72においては、CPU10は、スクロール成分速度の最大値Smaxおよび最小値Sminをリセットする。具体的には、CPU10は、速度最大値データ84として“0”を示すデータをメインメモリに記憶させ、速度最小値データ85として“0”を示すデータをメインメモリに記憶させる。なお、前回の処理ループにおいてもステップS72が実行されている場合(速度最大値データ84および速度最小値データ85が示す値がすでに“0”である場合)には、今回の処理ループにおけるステップS72の処理は省略されてもよい。   In step S72, the CPU 10 resets the maximum value Smax and the minimum value Smin of the scroll component speed. Specifically, the CPU 10 stores data indicating “0” as the maximum speed value data 84 in the main memory, and stores data indicating “0” as the minimum speed value data 85 in the main memory. In addition, when step S72 is executed also in the previous processing loop (when the values indicated by the maximum speed data 84 and the minimum speed data 85 are already “0”), step S72 in the current processing loop. This process may be omitted.

上記ステップS72の後、CPU10はカメラ位置制御処理を終了する。つまり、仮想面座標が所定領域Ar内となる場合には、仮想カメラの位置を制御する処理(ステップS78)は実行されず、表示範囲は移動しない。このように、第4の制御方法においても、上記仮想カメラ向き制御処理(ステップS46〜S48)と同様、仮想面座標が所定領域Ar外となった場合にのみ、仮想カメラが制御されて表示範囲が移動する。   After step S72, the CPU 10 ends the camera position control process. That is, when the virtual plane coordinates are within the predetermined area Ar, the process of controlling the position of the virtual camera (step S78) is not executed, and the display range does not move. As described above, also in the fourth control method, the virtual camera is controlled to display the display range only when the virtual plane coordinates are outside the predetermined area Ar, as in the virtual camera orientation control process (steps S46 to S48). Move.

一方、ステップS73においては、CPU10は上記スクロール成分速度Sを算出する。スクロール成分速度Sは、仮想面座標の位置、仮想面座標の速度、および所定領域Arに基づいて算出される。以下、図31を参照して、スクロール成分速度Sの算出方法を説明する。   On the other hand, in step S73, the CPU 10 calculates the scroll component speed S. The scroll component speed S is calculated based on the position of the virtual plane coordinates, the speed of the virtual plane coordinates, and the predetermined area Ar. Hereinafter, a method for calculating the scroll component speed S will be described with reference to FIG.

図31は、平面Qにおけるスクロール成分速度Sを示す図である。なお、図31において、ベクトルVnは上記スクロール方向を表し、ベクトルVrは仮想面座標の速度を表す。上記ステップS73においては、まず、スクロール方向ベクトルVnが算出される。スクロール方向ベクトルVnは、点P10(投影点Tであり、X’Y’座標系の原点である)から仮想面座標が表す点Rへの方向を向く単位ベクトルである。なお、スクロール方向ベクトルVnは、所定領域Arに対する仮想面座標の方向を表すものであればよい。例えば、他の実施形態においては、スクロール方向ベクトルVnは、所定領域Arの4辺のうちで仮想面座標に最も近い辺の中点から仮想面座標への方向を表すように算出されてもよい。   FIG. 31 is a diagram showing the scroll component speed S in the plane Q. As shown in FIG. In FIG. 31, vector Vn represents the scroll direction, and vector Vr represents the speed of the virtual plane coordinates. In step S73, first, the scroll direction vector Vn is calculated. The scroll direction vector Vn is a unit vector that points in the direction from the point P10 (the projection point T and the origin of the X′Y ′ coordinate system) to the point R represented by the virtual plane coordinates. The scroll direction vector Vn only needs to represent the direction of the virtual plane coordinates with respect to the predetermined area Ar. For example, in another embodiment, the scroll direction vector Vn may be calculated so as to represent the direction from the midpoint of the side closest to the virtual plane coordinate among the four sides of the predetermined area Ar to the virtual plane coordinate. .

スクロール方向ベクトルVnが算出されると次に、スクロール成分速度Sが算出される。図31に示すように、スクロール成分速度Sは、仮想面座標の速度(ベクトルVr)のうち、上記スクロール方向(ベクトルVnの方向)の成分の大きさである。すなわち、上記スクロール方向ベクトルVn=(nx,ny)とし、仮想面座標の速度Vr=(Vrx,Vry)とすると、スクロール成分速度Sは、次の式(21)に従って算出される。
S=nx×Vrx+ny×Vry …(21)
上式(21)に従って算出されたスクロール成分速度Sを示すデータは、スクロール成分速度データ83としてメインメモリに記憶される。なお、図31および上式(21)から明らかなように、スクロール成分速度Sは、仮想面座標が所定領域Arから離れる方向に移動している場合に正の値となり、仮想面座標が所定領域Arに近づく方向に移動している場合に負の値となる。ステップS73の次にステップS74の処理が実行される。
Once the scroll direction vector Vn is calculated, the scroll component speed S is then calculated. As shown in FIG. 31, the scroll component speed S is the magnitude of the component in the scroll direction (the direction of the vector Vn) out of the virtual surface coordinate speed (the vector Vr). That is, assuming that the scroll direction vector Vn = (nx, ny) and the virtual surface coordinate speed Vr = (Vrx, Vry), the scroll component speed S is calculated according to the following equation (21).
S = nx × Vrx + ny × Vry (21)
Data indicating the scroll component speed S calculated according to the above equation (21) is stored in the main memory as scroll component speed data 83. As is clear from FIG. 31 and the above equation (21), the scroll component speed S becomes a positive value when the virtual plane coordinate moves in a direction away from the predetermined area Ar, and the virtual plane coordinate is the predetermined area. A negative value is obtained when moving in a direction approaching Ar. Following step S73, the process of step S74 is executed.

ステップS74において、CPU10は、ステップS73で算出されたスクロール成分速度Sが、最大値Smaxを超えたか否かを判定する。すなわち、CPU10は、スクロール成分速度データ83および速度最大値データ84をメインメモリから読み出し、スクロール成分速度Sと最大値Smaxの大きさを比較する。ステップS73の判定結果が肯定である場合、ステップS75の処理が実行される。一方、ステップS73の判定結果が否定である場合、ステップS75の処理がスキップされてステップS76の処理が実行される。   In step S74, the CPU 10 determines whether or not the scroll component speed S calculated in step S73 has exceeded the maximum value Smax. That is, the CPU 10 reads the scroll component speed data 83 and the maximum speed data 84 from the main memory, and compares the scroll component speed S and the maximum value Smax. If the determination result of step S73 is affirmative, the process of step S75 is executed. On the other hand, when the determination result of step S73 is negative, the process of step S75 is skipped and the process of step S76 is executed.

ステップS75において、CPU10は、スクロール成分速度Sの最大値Smaxを更新する。すなわち、最大値Smaxは、今回の処理ループで算出されたスクロール成分速度Sの値へと更新される。具体的には、CPU10は、スクロール成分速度データ83と同じ値を示すデータを新たな速度最大値データ84としてメインメモリに記憶する。ステップS75の次にステップS76の処理が実行される。   In step S75, the CPU 10 updates the maximum value Smax of the scroll component speed S. That is, the maximum value Smax is updated to the value of the scroll component speed S calculated in the current processing loop. Specifically, the CPU 10 stores data indicating the same value as the scroll component speed data 83 as new speed maximum value data 84 in the main memory. Following step S75, the process of step S76 is executed.

ステップS76において、CPU10は、ステップS73で算出されたスクロール成分速度Sが、最小値Sminを下回ったか否かを判定する。すなわち、CPU10は、スクロール成分速度データ83および速度最小値データ85をメインメモリから読み出し、スクロール成分速度Sと最小値Sminの大きさを比較する。ステップS76の判定結果が肯定である場合、ステップS77の処理が実行される。一方、ステップS76の判定結果が否定である場合、ステップS77の処理がスキップされてステップS78の処理が実行される。   In step S76, the CPU 10 determines whether or not the scroll component speed S calculated in step S73 is less than the minimum value Smin. That is, the CPU 10 reads the scroll component speed data 83 and the speed minimum value data 85 from the main memory, and compares the scroll component speed S and the minimum value Smin. If the determination result of step S76 is affirmative, the process of step S77 is executed. On the other hand, when the determination result of step S76 is negative, the process of step S77 is skipped and the process of step S78 is executed.

ステップS77において、CPU10は、スクロール成分速度Sの最小値Sminを更新する。すなわち、最小値Sminは、今回の処理ループで算出されたスクロール成分速度Sの値へと更新される。具体的には、CPU10は、スクロール成分速度データ83と同じ値を示すデータを新たな速度最小値データ85としてメインメモリに記憶する。ステップS77の次にステップS78の処理が実行される。   In step S77, the CPU 10 updates the minimum value Smin of the scroll component speed S. That is, the minimum value Smin is updated to the value of the scroll component speed S calculated in the current processing loop. Specifically, the CPU 10 stores data indicating the same value as the scroll component speed data 83 in the main memory as new speed minimum value data 85. Following step S77, the process of step S78 is executed.

ステップS78において、CPU10は、上記最大値Smaxおよび最小値Sminに基づいて仮想カメラを移動させる。第4の制御方法においては、仮想カメラは、上記スクロール方向に応じた方向へ、上記最大値Smaxと最小値Sminとの和に応じた速さ(移動量)で、移動される。すなわち、第4の制御方法においては、移動ベクトルCv=(Cvx,Cvy)は、下記の式(22)に従って算出される。
Cvx=nx×(Smax+Smin)
Cvy=ny×(Smax+Smin) …(22)
上式(22)から明らかなように、移動ベクトルCvは、スクロール方向ベクトルVn=(nx,ny)に対応する方向をむき、最大値Smaxと最小値Sminとの和に対応した大きさとなる。なお、他の実施形態においては、移動ベクトルCvの方向を、仮想面座標の移動方向と一致するようにしてもよい。ただし、移動ベクトルCvの方向を、仮想面座標の移動方向とする場合は、画面に対する入力装置8の向きと、表示範囲の移動方向とが一致しなくなるので、ユーザが違和感を抱くおそれがある。これに対して、本実施形態によれば、所定領域Arに対する仮想面座標の方向に応じた方向へ表示範囲を移動させることによって、画面に対する入力装置8の向きと表示範囲の移動方向とを対応させることができ、操作性を向上することができる。
In step S78, the CPU 10 moves the virtual camera based on the maximum value Smax and the minimum value Smin. In the fourth control method, the virtual camera is moved in a direction corresponding to the scroll direction at a speed (movement amount) corresponding to the sum of the maximum value Smax and the minimum value Smin. That is, in the fourth control method, the movement vector Cv = (Cvx, Cvy) is calculated according to the following equation (22).
Cvx = nx × (Smax + Smin)
Cvy = ny × (Smax + Smin) (22)
As is apparent from the above equation (22), the movement vector Cv has a size corresponding to the sum of the maximum value Smax and the minimum value Smin, with a direction corresponding to the scroll direction vector Vn = (nx, ny). In other embodiments, the direction of the movement vector Cv may coincide with the movement direction of the virtual plane coordinates. However, when the direction of the movement vector Cv is the movement direction of the virtual plane coordinates, the direction of the input device 8 with respect to the screen does not match the movement direction of the display range, and the user may feel uncomfortable. On the other hand, according to the present embodiment, the display range is moved in a direction corresponding to the direction of the virtual plane coordinates with respect to the predetermined area Ar, thereby matching the direction of the input device 8 with respect to the screen and the moving direction of the display range. Therefore, operability can be improved.

上記移動ベクトルCvを算出した後、CPU10は、移動ベクトルCvに従って仮想カメラを移動する。移動ベクトルCvに基づいて仮想カメラの移動後の位置を算出する方法は、上記ステップS53およびS59と同様である。算出された移動後の仮想カメラの位置を示すデータは、新たなカメラ位置データ80としてメインメモリに記憶される。ステップS78の後、CPU10はカメラ位置制御処理を終了する。   After calculating the movement vector Cv, the CPU 10 moves the virtual camera according to the movement vector Cv. The method for calculating the position of the virtual camera after the movement based on the movement vector Cv is the same as in steps S53 and S59. Data indicating the calculated position of the virtual camera after movement is stored in the main memory as new camera position data 80. After step S78, the CPU 10 ends the camera position control process.

以上のように、上記ステップS71〜S78の処理によれば、仮想面座標が上記所定領域Ar外になった場合に、所定領域Arから仮想面座標までの方向に応じた方向に仮想カメラが移動される。したがって、上記第4の制御方法においては、上記仮想カメラ向き制御処理(ステップS46〜S48)と同様、ユーザは、入力装置8の向きをテレビ2の画面から外すように操作することによって、表示範囲を移動させることができる(図25参照)。   As described above, according to the processes in steps S71 to S78, when the virtual plane coordinates are outside the predetermined area Ar, the virtual camera moves in a direction corresponding to the direction from the predetermined area Ar to the virtual plane coordinates. Is done. Therefore, in the fourth control method, similarly to the virtual camera orientation control process (steps S46 to S48), the user operates the input device 8 so as to remove the orientation of the input device 8 from the screen of the television 2, thereby displaying the display range. Can be moved (see FIG. 25).

なお、上記ステップS78における上式(22)によれば、上記和が負の値となる場合には、移動ベクトルCvはスクロール方向ベクトルVnと逆向きとなるので、上記和が正の値となる場合に対して表示範囲の移動方向が逆向きとなる。つまり、上記和が負の値となる場合には、入力装置8の向き(テレビ2への方向を正面方向とした場合の向き)と、表示範囲の移動方向とが逆向きとなってしまう。例を挙げて説明すると、ユーザが入力装置8を画面の右側に向けているのに対して、表示範囲が左に移動することになるのである。したがって、上記和が負の値となる場合には、ユーザが操作に違和感を抱くおそれがある。そこで、上記ステップS78においては、CPU10は、上記和が負の値となる場合には移動ベクトルCvを“0”としてもよい。つまり、上記和が負の値となる場合には表示範囲を停止するようにしてもよい。これによれば、入力装置8の向きと表示範囲の移動方向とが逆向きとなってしまうことがないので、ユーザが操作に違和感を抱くことを防止することができる。   According to the above equation (22) in step S78, when the sum is a negative value, the movement vector Cv is opposite to the scroll direction vector Vn, so the sum is a positive value. The moving direction of the display range is opposite to the case. That is, when the sum is a negative value, the direction of the input device 8 (the direction when the direction toward the television 2 is the front direction) and the moving direction of the display range are reversed. For example, while the user points the input device 8 toward the right side of the screen, the display range moves to the left. Therefore, when the sum is a negative value, the user may feel uncomfortable with the operation. Therefore, in step S78, the CPU 10 may set the movement vector Cv to “0” when the sum is a negative value. That is, when the sum is a negative value, the display range may be stopped. According to this, since the direction of the input device 8 and the moving direction of the display range are not reversed, it is possible to prevent the user from feeling uncomfortable with the operation.

また、上記ステップS71〜S78の処理によれば、仮想カメラの移動量(移動ベクトルCvの大きさ)は、仮想面座標の速度そのものではなく、上記スクロール成分速度Sの最大値Smaxと最小値Sminと和に応じて決定された。そのため、仮想面座標が停止していても仮想カメラは移動するので、ユーザは、(入力装置8の向きを画面から外していれば)入力装置8を動かしていない時でも表示範囲を移動させることができる。したがって、第4の制御方法は第2の制御方法と同様、表示対象が非常に大きいために表示範囲を大きく移動させる必要がある場合等に特に有効である。   Further, according to the processing in steps S71 to S78, the movement amount of the virtual camera (the magnitude of the movement vector Cv) is not the virtual plane coordinate speed itself, but the maximum value Smax and the minimum value Smin of the scroll component speed S. And decided according to the sum. Therefore, since the virtual camera moves even if the virtual plane coordinates are stopped, the user can move the display range even when the input device 8 is not moved (if the orientation of the input device 8 is off the screen). Can do. Therefore, like the second control method, the fourth control method is particularly effective when the display range needs to be moved greatly because the display target is very large.

なお、上記ステップS71〜S78の処理においては、仮想面座標が所定領域Arの外側へ出たか否かの判定を、X’Y’座標系の2次元平面上で行った。ここで、他の実施形態においては、上記判定をX’軸とY’軸とで別々に行ってもよい。例えば、仮想面座標がX’軸方向に関しては所定領域Arの外側であり、X’軸方向に関しては所定領域Arの内側である場合には、CPU10は、X’軸方向に対応する方向(x”軸方向)にのみ仮想カメラを移動させ、Y’軸方向に対応する方向(y”軸方向)には仮想カメラを移動させないようにしてもよい。   In the processes of steps S71 to S78, it is determined on the two-dimensional plane of the X′Y ′ coordinate system whether or not the virtual plane coordinates are outside the predetermined area Ar. Here, in another embodiment, the determination may be performed separately for the X ′ axis and the Y ′ axis. For example, when the virtual plane coordinates are outside the predetermined area Ar with respect to the X′-axis direction and within the predetermined area Ar with respect to the X′-axis direction, the CPU 10 determines the direction (x The virtual camera may be moved only in the “axis direction” and may not be moved in the direction corresponding to the Y′-axis direction (y ”-axis direction).

ここで、上記第3の制御方法においては、表示範囲の移動速度は、所定領域Arから仮想面座標までの距離に応じた速度となる。そのため、表示範囲の移動が開始される時点(すなわち、仮想面座標が所定領域Arの外へ出た直後の時点)においては、移動速度は必ず0に近い値となる。したがって、ユーザが入力装置8を速く動かしていた場合には、入力装置8の動きの速さと表示範囲の移動速度との間にギャップが生じるために、表示範囲の動きだしの際にユーザが違和感を抱くおそれがある。   Here, in the third control method, the moving speed of the display range is a speed corresponding to the distance from the predetermined area Ar to the virtual plane coordinates. For this reason, at the time when the movement of the display range is started (that is, the time immediately after the virtual plane coordinate goes out of the predetermined area Ar), the moving speed is always a value close to zero. Accordingly, when the user moves the input device 8 quickly, a gap is generated between the speed of movement of the input device 8 and the moving speed of the display range. There is a risk of embrace.

これに対して、第4の制御方法によれば、表示範囲の移動が開始される時点において、表示範囲の移動速度は、概ね、その時点での仮想面座標の速度となる。つまり、表示範囲を移動させる際に、ユーザが入力装置8を速く動かしていれば表示範囲も速く移動し、ユーザが入力装置8をゆっくりと動かしていれば表示範囲もゆっくりと移動する。したがって、入力装置8の動きの速さと表示範囲の移動速度との間にギャップが生じないので、表示範囲の動きだしの際にユーザが違和感を抱くことがない。このように、第4の制御方法によれば、より操作性の良い操作方法を提供することができる。特に、本実施形態のように、仮想面座標に応じた画面上の位置にカーソルを表示する(後述するステップS43)場合には、表示範囲の移動開始前におけるカーソルの移動速度と、移動開始後における表示範囲の移動速度とが等しくなる。そのため、カーソルが画面上を移動する状態から表示範囲が移動する状態への切り替わりがユーザにとっては違和感なくスムーズに感じられ、良好な操作感覚をユーザに抱かせることができる。   On the other hand, according to the fourth control method, when the movement of the display range is started, the movement speed of the display range is approximately the speed of the virtual plane coordinates at that time. That is, when moving the display range, if the user moves the input device 8 quickly, the display range also moves fast. If the user moves the input device 8 slowly, the display range also moves slowly. Therefore, there is no gap between the speed of movement of the input device 8 and the moving speed of the display range, so that the user does not feel uncomfortable when starting to move the display range. Thus, according to the fourth control method, an operation method with better operability can be provided. In particular, as in the present embodiment, when the cursor is displayed at a position on the screen according to the virtual plane coordinates (step S43 to be described later), the movement speed of the cursor before the start of movement of the display range, and after the movement starts. The moving speed of the display range at becomes equal. Therefore, the switching from the state in which the cursor moves on the screen to the state in which the display range moves can be smoothly felt without discomfort for the user, and the user can have a good operational feeling.

また、上記第3の制御方法においては、ユーザが表示範囲を低速で移動させたい場合には、仮想面座標が所定領域Arの周よりもやや外側となる姿勢で入力装置8を静止しなければならないので、操作が困難である。これに対して、第4の制御方法によれば、ユーザが表示範囲を低速で移動させたい場合には、ユーザは入力装置8の姿勢をゆっくりと変化させるだけでよく、表示範囲を容易に低速で移動させることができる。   In the third control method, when the user wants to move the display range at a low speed, the input device 8 must be stationary with the posture in which the virtual plane coordinates are slightly outside the circumference of the predetermined area Ar. It is difficult to operate. On the other hand, according to the fourth control method, when the user wants to move the display range at a low speed, the user only has to change the posture of the input device 8 slowly, and the display range can be easily reduced in speed. It can be moved with.

なお、本実施形態における第4の制御方法では、CPU10は、上記スクロール成分速度Sに基づいて表示範囲の速度を決定した。ここで、他の実施形態においては、CPU10は、スクロール成分速度Sに基づいて表示範囲の移動量を決定するようにしてもよい。すなわち、CPU10は、仮想面座標が所定領域Arの外へ出た場合、上記スクロール成分速度Sの最大値Smaxおよび最小値Sminの和に応じた量だけ表示範囲を移動させ、仮想面座標が停止した場合には表示範囲を停止させるようにしてもよい。   In the fourth control method in the present embodiment, the CPU 10 determines the speed of the display range based on the scroll component speed S. Here, in another embodiment, the CPU 10 may determine the amount of movement of the display range based on the scroll component speed S. That is, when the virtual plane coordinates go out of the predetermined area Ar, the CPU 10 moves the display range by an amount corresponding to the sum of the maximum value Smax and the minimum value Smin of the scroll component speed S, and the virtual plane coordinates are stopped. In such a case, the display range may be stopped.

また、本実施形態における第4の制御方法では、CPU10は、表示範囲を変化させる度合(表示範囲の移動速度)を上記スクロール成分速度Sに基づいて決定した。ここで、他の実施形態においては、CPU10は、仮想面座標が所定領域Arの外側に位置する場合における当該仮想面座標の速度に基づいて決定するものであれば、どのような方法で上記度合を決定してもよい。例えば、上記度合は、上記スクロール成分速度Sの最大値Smaxに応じて決定されてもよい。また、上記度合は、上記スクロール成分速度Sに応じて、あるいは、仮想面座標の速度に応じて決定されてもよい(このとき、仮想面座標が停止した場合には表示範囲は停止する)。   Further, in the fourth control method in the present embodiment, the CPU 10 determines the degree of changing the display range (the moving speed of the display range) based on the scroll component speed S. Here, in another embodiment, the CPU 10 determines the above degree by any method as long as it is determined based on the speed of the virtual surface coordinates when the virtual surface coordinates are located outside the predetermined area Ar. May be determined. For example, the degree may be determined according to the maximum value Smax of the scroll component speed S. The degree may be determined according to the scroll component speed S or according to the speed of the virtual plane coordinates (at this time, when the virtual plane coordinates are stopped, the display range is stopped).

また、本実施形態における第4の制御方法では、CPU10は、仮想面座標が所定領域Ar外となっている期間における上記スクロール成分速度Sの最大値および最小値に応じて表示範囲の速度を決定した。ここで、上記スクロール成分速度Sの最大値および最小値を決定する期間は、仮想面座標が所定領域Ar外となっている期間の全部である必要はなく、当該期間の一部の期間のみであってもよい。例えば、CPU10は、仮想面座標が所定領域Arの外側に出てからの(予め定められた)一定期間における上記スクロール成分速度Sのうちから最大値および最小値を決定するようにしてもよい。これによっても、上記実施形態と同様、入力装置8の動きの速さと表示範囲の移動速度との間にギャップが生じないので、表示範囲の動きだしの際にユーザが違和感を抱くことを防止することができる。   In the fourth control method according to the present embodiment, the CPU 10 determines the speed of the display range according to the maximum value and the minimum value of the scroll component speed S during the period when the virtual plane coordinates are outside the predetermined area Ar. did. Here, the period for determining the maximum value and the minimum value of the scroll component speed S does not have to be the entire period in which the virtual plane coordinates are outside the predetermined area Ar, but only a part of the period. There may be. For example, the CPU 10 may determine the maximum value and the minimum value from the scroll component speed S in a certain period (predetermined) after the virtual surface coordinates are outside the predetermined area Ar. This also prevents the user from feeling uncomfortable when starting the movement of the display range because there is no gap between the speed of movement of the input device 8 and the moving speed of the display range, as in the above embodiment. Can do.

以上、ステップS42におけるカメラ位置制御処理の例として、4つの制御方法を説明したが、仮想カメラの位置を制御する方法はこれらの制御方法に限らない。カメラ位置制御処理は、仮想面座標を用いて仮想カメラの位置を制御する方法であればどのようなものであってもよい。   As described above, four control methods have been described as examples of the camera position control process in step S42. However, the method for controlling the position of the virtual camera is not limited to these control methods. The camera position control process may be any method that controls the position of the virtual camera using the virtual plane coordinates.

また、上記実施形態においては、仮想カメラの向きおよび位置の両方を制御する(ステップS41およびS42)ものとしたが、他の実施形態においては、仮想カメラの向きおよび位置のいずれか一方のみを制御するようにしてもよい。つまり、CPU10は、上記ステップS41およびS42のいずれか一方のみを実行してもよい。   In the above embodiment, both the orientation and position of the virtual camera are controlled (steps S41 and S42). In other embodiments, only one of the orientation and position of the virtual camera is controlled. You may make it do. That is, the CPU 10 may execute only one of steps S41 and S42.

また、上記実施形態においては、カメラ向き制御処理(ステップS41)においては、CPU10は、仮想面座標が所定領域Arから離れている度合に基づいて仮想カメラの向きを制御したが、他の実施形態においては、仮想面座標に関する他の情報に基づいて仮想カメラの向きを制御してもよい。仮想カメラの向きは、例えば、上記第1の制御方法のように、仮想面座標の移動量および移動方向に応じて制御されてもよいし、上記第2の制御方法のように、所定の基準位置から仮想面座標が示す位置までの差分に応じて制御されてもよいし、上記第4の制御方法のように、仮想面座標が所定領域Arの外側に位置する場合における当該仮想面座標の速度に基づいて制御されてもよい。つまり、他の実施形態においては、上記第1、第2、および第4の制御方法において仮想カメラの位置を制御したことに代えて、仮想カメラの向きを制御することによって、表示範囲を変化させるようにしてもよい。   In the above-described embodiment, in the camera orientation control process (step S41), the CPU 10 controls the orientation of the virtual camera based on the degree to which the virtual plane coordinates are away from the predetermined area Ar. The orientation of the virtual camera may be controlled based on other information related to the virtual plane coordinates. The orientation of the virtual camera may be controlled according to the amount and direction of movement of the virtual plane coordinates, for example, as in the first control method, or a predetermined reference, as in the second control method. It may be controlled according to the difference from the position to the position indicated by the virtual surface coordinates, or the virtual surface coordinates in the case where the virtual surface coordinates are located outside the predetermined area Ar as in the fourth control method. It may be controlled based on the speed. That is, in another embodiment, the display range is changed by controlling the orientation of the virtual camera instead of controlling the position of the virtual camera in the first, second, and fourth control methods. You may do it.

また、上記実施形態においては、CPU10は、入力装置8の姿勢(仮想面座標)のみを用いて表示範囲を制御するようにしたが、他の実施形態においては、入力装置8の姿勢の情報に加え、他の入力方法によって得られた情報を用いて表示範囲を制御してもよい。例えば、CPU10は、入力装置8の十字ボタン32aに関する操作データをさらに用いて表示範囲を制御してもよい。具体的には、図20に示す表示制御処理においては、ステップS42におけるカメラ位置制御処理に代えて、十字ボタン32aを用いた方向指示に従って仮想カメラの位置を制御する処理が実行されてもよい。より具体的には、上記処理において、CPU10は、十字ボタン32aの上下左右の各部のうちで押下された部分に従った方向へ表示範囲が移動するように、仮想カメラの位置を制御してもよい。これによれば、ユーザは、十字ボタン32aを用いて仮想カメラの位置を変更することができるとともに、入力装置8の向きを変えることによって仮想カメラの向きを変更することができる。すなわち、2種類の方法で表示範囲を変更することができるので、表示範囲をより自由に操作することができ、操作性を向上することができる。   In the above embodiment, the CPU 10 controls the display range using only the attitude (virtual plane coordinates) of the input device 8, but in other embodiments, the CPU 10 includes information on the attitude of the input device 8. In addition, the display range may be controlled using information obtained by other input methods. For example, the CPU 10 may control the display range by further using operation data related to the cross button 32 a of the input device 8. Specifically, in the display control process shown in FIG. 20, instead of the camera position control process in step S42, a process for controlling the position of the virtual camera according to a direction instruction using the cross button 32a may be executed. More specifically, in the above processing, the CPU 10 may control the position of the virtual camera so that the display range moves in the direction according to the pressed part of the upper, lower, left, and right parts of the cross button 32a. Good. According to this, the user can change the position of the virtual camera by using the cross button 32 a and can change the direction of the virtual camera by changing the direction of the input device 8. That is, since the display range can be changed by two kinds of methods, the display range can be operated more freely and the operability can be improved.

なお、入力装置8の姿勢を用いた入力方法とともに表示範囲の制御に用いる入力方法は、十字ボタン32aを用いた入力方法に限らず、他の入力方法であってもよい。ただし、入力装置8に設けられた操作手段を用いた入力方法であることが好ましい。これによれば、ユーザは、入力装置8の姿勢を変化させる操作と、当該操作手段に対する操作との両方の操作を片手で行うことができるからである。例えば、入力装置8は、十字ボタン32aに代えて、スティックやタッチパッド等の操作手段を備えていてもよく、CPU10は、これらの操作手段に対する方向指示に従って表示範囲を制御してもよい。また、他の実施形態においては、CPU10は、仮想面座標に基づいて仮想カメラの位置を制御し、上記操作手段を用いた方向指示に従って仮想カメラの向きを制御してもよい。   The input method used for controlling the display range together with the input method using the attitude of the input device 8 is not limited to the input method using the cross button 32a, and may be another input method. However, an input method using an operating means provided in the input device 8 is preferable. This is because the user can perform both operations for changing the posture of the input device 8 and operations for the operation means with one hand. For example, the input device 8 may include an operation unit such as a stick or a touch pad instead of the cross button 32a, and the CPU 10 may control the display range in accordance with a direction instruction to these operation units. In another embodiment, the CPU 10 may control the position of the virtual camera based on the virtual plane coordinates, and may control the orientation of the virtual camera according to a direction instruction using the operation unit.

図20の説明に戻り、ステップS43において、CPU10は、仮想面座標に基づいてテレビ2の画面上においてカーソルを表示する位置(カーソル位置)を算出する。本実施形態においては、カーソル位置は、第1の仮想空間における平面Q上の所定領域Arとテレビ2の画面の領域とが対応するように算出される。つまり、CPU10は、所定領域Arに対する仮想面座標の位置関係と、画面の領域に対するカーソル位置の位置関係とが同じになるように、カーソル位置を算出する。なお、仮想面座標が所定領域Arの外となる場合には、CPU10は、所定領域Arの周のうちで仮想面座標に最も近い位置を特定し、当該位置に対応する画面の端の位置をカーソル位置として算出してもよい。算出されたカーソル位置を示すデータは、カーソル位置データ81としてメインメモリに記憶される。ステップS43の次にステップS44の処理が実行される。   Returning to the description of FIG. 20, in step S43, the CPU 10 calculates a position (cursor position) at which the cursor is displayed on the screen of the television 2 based on the virtual plane coordinates. In the present embodiment, the cursor position is calculated so that the predetermined area Ar on the plane Q in the first virtual space corresponds to the area of the screen of the television 2. That is, the CPU 10 calculates the cursor position so that the positional relationship of the virtual plane coordinates with respect to the predetermined region Ar is the same as the positional relationship of the cursor position with respect to the screen region. When the virtual surface coordinates are outside the predetermined area Ar, the CPU 10 specifies the position closest to the virtual surface coordinates in the circumference of the predetermined area Ar, and determines the position of the edge of the screen corresponding to the position. You may calculate as a cursor position. Data indicating the calculated cursor position is stored in the main memory as cursor position data 81. Following step S43, the process of step S44 is executed.

ステップS44において、CPU10は、テレビ2に表示すべき表示対象の画像を仮想カメラの位置および向きに基づいて生成する。具体的には、CPU10は、仮想カメラの位置を視点位置とし、仮想カメラの向きを視線方向として表示対象に対して透視投影変換等の変換処理を行うことによって、表示対象の画像を生成する。これによって、表示対象のうちの一部を表す画像が生成されるので、仮想カメラを用いて表示範囲が決定されたこととなる。ステップS44で生成された画像は、テレビ2の画面に表示される。   In step S44, the CPU 10 generates an image to be displayed to be displayed on the television 2 based on the position and orientation of the virtual camera. Specifically, the CPU 10 generates a display target image by performing conversion processing such as perspective projection conversion on the display target with the position of the virtual camera as the viewpoint position and the direction of the virtual camera as the viewing direction. As a result, an image representing a part of the display target is generated, and the display range is determined using the virtual camera. The image generated in step S44 is displayed on the screen of the television 2.

また、CPU10は、表示対象の画像に重ねて、上記カーソル位置にカーソルの画像を表示する。入力装置8の姿勢に対応した位置にカーソルが表示されるので、プレイヤは、入力装置8の姿勢を変化させることによってカーソルを動かす操作が可能となる。なお、仮想面座標が所定領域Arの外となる場合、CPU10は、カーソルを表示してもよいし表示しなくてもよい。例えば、上記ステップS42の処理において上記第2〜第4の制御方法を採用する場合には、表示範囲の移動方向をユーザが認識しやすくなるように、CPU10は、画面の端の位置にカーソルを表示するようにしてもよい。一方、上記ステップS42の処理において上記第1の制御方法を採用する場合には、仮想面座標が所定領域Arの外となった時に画面の端にカーソルを表示すると、カーソルが指し示す表示対象の位置が変化してしまう。そのため、この場合には、CPU10はカーソルを表示しない(カーソルを画面外に出たように見せる)ようにしてもよい。なお、ステップS42の処理において上記第2の制御方法を採用する場合には、CPU10は、表示範囲の移動方向ユーザがより認識しやすくなるように、基準位置と仮想面座標との差分を表すベクトル(図25に示す矢印94)を表示するようにしてもよい。以上のステップS44の次にステップS45の処理が実行される。   Further, the CPU 10 displays the cursor image at the cursor position so as to overlap the display target image. Since the cursor is displayed at a position corresponding to the posture of the input device 8, the player can perform an operation of moving the cursor by changing the posture of the input device 8. If the virtual plane coordinates are outside the predetermined area Ar, the CPU 10 may or may not display the cursor. For example, when the second to fourth control methods are employed in the process of step S42, the CPU 10 moves the cursor to the position of the edge of the screen so that the user can easily recognize the moving direction of the display range. You may make it display. On the other hand, when the first control method is adopted in the process of step S42, when the cursor is displayed at the edge of the screen when the virtual plane coordinates are outside the predetermined area Ar, the position of the display target indicated by the cursor Will change. Therefore, in this case, the CPU 10 may not display the cursor (ie, the cursor appears to have gone out of the screen). When the second control method is adopted in the process of step S42, the CPU 10 represents a difference between the reference position and the virtual plane coordinates so that the user in the moving direction of the display range can easily recognize. (Arrow 94 shown in FIG. 25) may be displayed. Following step S44, the process of step S45 is executed.

ステップS45において、CPU10は、カーソル位置に基づくゲーム処理を実行する。例えば、所定の指示を表すボタン画像がカーソルによって指し示されている状態で所定の操作(例えば入力装置8の所定のボタンが押下される操作)が行われた場合、CPU10は、当該所定の指示に従ったゲーム処理を実行する。なお、ステップS45におけるゲーム処理は、カーソル位置をユーザの入力として用いる処理であればどのような処理でもよい。例えば、上記ゲーム処理は、カーソル位置が移動した軌跡に沿って線を描画する処理であってもよい。上記ステップS45によって、ユーザは、入力装置8を画面上の位置を指定するポインティングデバイスとして使用することができる。   In step S45, the CPU 10 executes a game process based on the cursor position. For example, when a predetermined operation (for example, an operation of pressing a predetermined button of the input device 8) is performed in a state where a button image representing a predetermined instruction is pointed by the cursor, the CPU 10 The game process according to the above is executed. The game process in step S45 may be any process as long as the cursor position is used as a user input. For example, the game process may be a process of drawing a line along a locus along which the cursor position has moved. Through step S45, the user can use the input device 8 as a pointing device for designating a position on the screen.

なお、他の実施形態においては、ステップS45におけるゲーム処理は、上記2次元座標を入力値としてゲーム結果に反映させる処理であればどのような処理であってもよい。例えば、仮想のゲーム空間内のオブジェクトを2次元座標に対応するゲーム空間内の位置に移動させる処理であってもよいし、上記2次元座標により表される2次元ベクトルの大きさおよび方向に応じた速度で上記オブジェクトを移動させるように制御して表示する処理であってもよい。ステップS45の後、CPU10は図20に示す表示制御処理を終了する。   In other embodiments, the game process in step S45 may be any process as long as the two-dimensional coordinates are reflected in the game result as an input value. For example, it may be a process of moving an object in the virtual game space to a position in the game space corresponding to the two-dimensional coordinates, or depending on the size and direction of the two-dimensional vector represented by the two-dimensional coordinates. It may be a process of controlling and displaying the object so as to move at a high speed. After step S45, the CPU 10 ends the display control process shown in FIG.

表示制御処理(ステップS8)の次のステップS9において、CPU10は、ゲームを終了するか否かを判定する。ステップS9の判定は、例えば、ゲームがクリアされたか否か、ゲームオーバーとなったか否か、プレイヤがゲームを中止する指示を行ったか否か等によって行われる。ステップS9の判定結果が否定である場合、ステップS3の処理が再度実行される。以降、ステップS9でゲームを終了すると判定されるまで、ステップS3〜S9の処理ループが繰り返し実行される。一方、ステップS9の判定結果が肯定である場合、CPU10は、図14に示すゲーム処理を終了する。以上で、ゲーム処理の説明を終了する。   In step S9 following the display control process (step S8), the CPU 10 determines whether or not to end the game. The determination in step S9 is made based on, for example, whether or not the game has been cleared, whether or not the game is over, and whether or not the player has given an instruction to stop the game. If the determination result of step S9 is negative, the process of step S3 is executed again. Thereafter, the processing loop of steps S3 to S9 is repeatedly executed until it is determined in step S9 that the game is to be ended. On the other hand, if the determination result of step S9 is affirmative, the CPU 10 ends the game process shown in FIG. This is the end of the description of the game process.

以上のように、本実施形態においては、ジャイロセンサ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 gyro sensors 55 and 56 (step S4), and the first posture is subjected to the first correction process (S5). And it corrected by the 2nd correction process (S6). Since the game process is executed using the corrected first attitude (steps S7 and S8), the CPU 10 can execute the game process based on the accurate attitude of the input device 8. According to this, for example, since the posture of the input device 8 can be accurately reflected on the position of the cursor on the screen, the operability of the game operation can be improved.

[座標を算出する第2の方法]
以下、図32〜図37を参照して、入力装置8の姿勢から画面上における位置を算出する第2の方法について説明する。なお、上記実施形態においては、上述した第1の方法に代えて以下に示す第2の方法を用いてゲーム処理を実行してもよい。また、以下の説明では、上記仮想空間における平面Q上の座標を「第1の座標」と呼び、第1の座標から算出される画面上の位置を表す座標を「画面座標」と呼び、マーカ座標から算出される画面上の位置を表す座標(詳細は後述する)を「第2の座標」と呼ぶ。
[Second method for calculating coordinates]
Hereinafter, a 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”.

図32は、第1の方法と第2の方法との比較を示す図である。図32においては、実空間において、テレビ2の画面の中心よりも下方に入力装置8が位置し、入力装置8のZ軸方向が指す画面上の位置(以下、「(入力装置の)指示位置」と呼ぶ。)が画面の中心となる場合を例として考える(図32の上行左欄参照)。   FIG. 32 is a diagram showing a comparison between the first method and the second method. 32, in real space, the input device 8 is positioned below the center of the screen of the television 2, and the position on the screen indicated by the Z-axis direction of the input device 8 (hereinafter referred to as “(input device) indicated position”). ”) Becomes the center of the screen as an example (see the upper left column in FIG. 32).

上述した第1の方法では、第1の座標の座標系(仮想空間における平面Q上のX’Y’座標系)は、入力装置8の位置を平面Qに投影させた投影点Tを常に原点Oとするものであった。つまり、第1の座標は、入力装置8のZ軸方向が水平方向を向く場合(Z軸方向が投影点Tを指す場合)に原点(0,0)の値を取るように算出された。したがって、図32に示すように入力装置8のZ軸方向がやや上方を向く場合には、第1の座標の位置Rは原点Oよりも上方になる(図32の上行中央欄参照)。その結果、第1の座標から算出される画面座標の位置Uは、画面の中心よりも上方となる(図32の上行右欄参照)。   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. 32, 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. 32). 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. 32).

図32に示す場合、第1の方法では、実際には(実空間では)入力装置8のZ軸方向は画面の中心を指しているのに対して、算出される画面上の位置は中心よりも上方の位置となってしまう。このように、第1の方法では、ユーザが入力装置8を用いて指し示した位置(入力装置の指示位置)と、算出される画面座標の位置との間にずれが生じてしまい、ユーザが違和感を抱くおそれがあった。   In the case shown in FIG. 32, 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 television 2 is installed (whether it is placed on the floor or on the stand, etc.) and the state of the user who uses the input device 8 (whether the input device 8 is used standing up) It is considered that the height of the input device 8 with respect to the screen varies depending on whether the user is sitting and using. If this height changes, the relationship between the indicated position and orientation of the input device 8 changes, and the orientation of the input device 8 when the indicated position of the input device 8 is at the center of the screen also changes. However, in the first method, since the position of the origin of the X′Y ′ coordinate system is fixed without taking the indicated position of the input device 8 into consideration, the position on the screen cannot be calculated appropriately, and the input The user may feel uncomfortable with the operation using the device 8.

そこで、第2の方法では、ゲーム装置3は、第1の方法で算出された第1の座標を、入力装置8のZ軸方向が画面の中心を指す姿勢である場合(指示位置が画面の中心となる場合)に所定値(具体的には、(0,0))となるように補正する。具体的には、ゲーム装置3は、まず、入力装置8のZ軸方向が画面の中心を指す姿勢となったか否かを判定する。この判定は、上述したマーカ座標を参照することで行うことができる。すなわち、ゲーム装置3は、画面上における上記指示位置を示す座標(第2の座標)をマーカ座標に基づいて算出し、第2の座標が画面の中心(中心付近)を表すか否かを判定する。   Therefore, in the second method, the game apparatus 3 uses the first coordinate calculated by the first method when the Z-axis direction of the input device 8 is in the posture pointing to the center of the screen (the indicated position is the screen position). Correction is performed so that a predetermined value (specifically, (0, 0)) is obtained at the center. Specifically, the game apparatus 3 first determines whether or not the Z-axis direction of the input apparatus 8 is in an attitude that points to the center of the screen. This determination can be made by referring to the marker coordinates described above. That is, the game apparatus 3 calculates the coordinates (second coordinates) indicating the indicated position on the screen based on the marker coordinates, and determines whether the second coordinates represent the center (near the center) of the screen. To do.

上記の判定の結果、第2の座標が画面の中心となった場合、ゲーム装置3は、第1の座標を補正するための補正量(オフセット量)を決定する。オフセット量は、第2の座標が画面の中心となった時点において(第1の方法で)算出された第1の座標に対応する画面座標の位置と、第2の座標の位置とが一致するように決定される。具体的には、オフセット量は、当該時点における第1の座標が原点の値(0,0)となるような補正量に決定される。なお、上記オフセット量を決定することは、平面Q上のX’Y’座標系を移動することを意味する。図32の例においては、入力装置8が水平方向よりも上方を向いているので、X’Y’座標系は、平面Q上において、投影点Tが原点となる位置(図32に示す点線の位置)から上方へ移動するように移動される(図32の下行中央欄参照)。以上のように第1の座標を原点の値とする結果、第1の座標に対応する画面上の位置Uは、画面の中心位置となる(図32の上行右欄参照)。したがって、入力装置8の指示位置(第2の座標の位置)と、算出される画面上の位置とが画面の中心で一致することになる。このように、第2の方法によれば、ユーザが入力装置8を用いて指した位置と、算出される位置との間のずれが生じることを防止することができ、ユーザが違和感を抱くことを防止することができる。   As a result of the above determination, when the second coordinate is the center of the screen, the game apparatus 3 determines a correction amount (offset amount) for correcting the first coordinate. As for the offset amount, the position of the screen coordinate corresponding to the first coordinate calculated by the first method when the second coordinate becomes the center of the screen matches the position of the second coordinate. To be determined. Specifically, the offset amount is determined to be a correction amount such that the first coordinate at the time point becomes the origin value (0, 0). Note that determining the offset amount means moving the X′Y ′ coordinate system on the plane Q. In the example of FIG. 32, since the input device 8 faces upward from the horizontal direction, the X′Y ′ coordinate system has a position on the plane Q where the projection point T is the origin (the dotted line shown in FIG. 32). The position is moved so as to move upward (see the lower middle column in FIG. 32). As described above, as a result of setting the first coordinate as the origin value, the position U on the screen corresponding to the first coordinate becomes the center position of the screen (see the upper right column in FIG. 32). Therefore, the indicated position (second coordinate position) of the input device 8 and the calculated position on the screen coincide with each other at the center of the screen. Thus, according to the second method, it is possible to prevent a deviation between the position pointed by the user using the input device 8 and the calculated position, and the user feels uncomfortable. Can be prevented.

また、本実施形態においては、ゲーム装置3は、X’Y’座標系のY’成分についてのみ第1の座標の補正を行う。つまり、第1の座標(および画面座標)は、画面の上下方向にのみ補正され、左右方向については補正されない。本実施形態では、画面に対する入力装置8の高さ(上下方向の位置)に関しては、入力装置8の姿勢のみからでは判別することができないのに対して、画面に対する入力装置8の左右方向の位置に関しては、入力装置8の姿勢のみからでも判別することができ、左右方向に関しては図32で説明したような「ずれ」は生じないからである。ただし、他の実施形態においては、左右方向に関しても上下方向と同じように第1の座標を補正するようにしてもよい。   In the present embodiment, the game apparatus 3 corrects the first coordinate only for the Y ′ component of the X′Y ′ coordinate system. That is, the first coordinates (and screen coordinates) are corrected only in the vertical direction of the screen, and are not corrected in the horizontal direction. In the present embodiment, the height (position in the vertical direction) of the input device 8 with respect to the screen cannot be determined only from the attitude of the input device 8, whereas the position of the input device 8 in the horizontal direction with respect to the screen. This is because it can be determined only from the attitude of the input device 8 and the “displacement” as described in FIG. 32 does not occur in the left-right direction. However, in other embodiments, the first coordinates may be corrected in the left-right direction as in the up-down direction.

次に、図33〜図37を参照して、第2の方法を採用する場合においてゲーム装置3が実行する処理の詳細について説明する。図33は、第2の方法を採用する場合においてゲーム装置3のメインメモリに記憶される主なデータを示す図である。なお、図33において、図13に示すデータと同じデータについては、図13と同じ参照符号を付し、詳細な説明を省略する。   Next, with reference to FIG. 33 to FIG. 37, details of processing executed by the game apparatus 3 when the second method is adopted will be described. FIG. 33 is a diagram showing main data stored in the main memory of the game apparatus 3 when the second method is adopted. In FIG. 33, the same data as the data shown in FIG. 13 is denoted by the same reference numerals as those in FIG.

図33に示すように、第2の方法においては、図13に示すデータに加えて、第1座標データ87、第2座標データ88、オフセット量データ89、および画面座標データ90がメインメモリに記憶される。   As shown in FIG. 33, in the second method, in addition to the data shown in FIG. 13, first coordinate data 87, second coordinate data 88, offset amount data 89, and screen coordinate data 90 are stored in the main memory. Is done.

第1座標データ87は、入力装置8の姿勢に基づいて算出される上記第1の座標を示す。すなわち、第1座標データ87は、上記仮想空間における平面Q上の位置の座標を示す。   The first coordinate data 87 indicates the first coordinates calculated based on the attitude of the input device 8. That is, the first coordinate data 87 indicates the coordinates of the position on the plane Q in the virtual space.

第2座標データ88は、マーカ座標に基づいて算出される、画面上の位置を表す座標(第2の座標)を示す。第2の座標は、入力装置8のZ軸方向が指し示す画面上の位置を表すものである。第2の座標は、理想的には、入力装置8のZ軸を延ばした直線と画面との交点の位置を表すものであるが、当該交点の位置付近を表すものであればよい。   The second coordinate data 88 indicates coordinates (second coordinates) representing a position on the screen calculated based on the marker coordinates. The second coordinate represents the position on the screen indicated by the Z-axis direction of the input device 8. The second coordinates ideally represent the position of the intersection of the straight line extending the Z axis of the input device 8 and the screen, but may be any as long as it represents the vicinity of the position of the intersection.

オフセット量データ79は、第1の座標を補正するためのオフセット量を示す。本実施形態では、第1の方法で算出された第1の座標をオフセット量だけ移動した座標が、補正後の第1の座標となる。   The offset amount data 79 indicates an offset amount for correcting the first coordinate. In the present embodiment, the coordinate obtained by moving the first coordinate calculated by the first method by the offset amount becomes the corrected first coordinate.

画面座標データ90は、第1の座標に基づいて算出される、画面上の位置を表す座標(画面座標)を示す。第2の方法では、画面座標は、オフセット量に従って補正された後の第1の座標に基づいて算出される。   The screen coordinate data 90 indicates coordinates (screen coordinates) representing a position on the screen calculated based on the first coordinates. In the second method, the screen coordinates are calculated based on the first coordinates after being corrected according to the offset amount.

図34は、第2の方法を採る場合においてゲーム装置3が実行する処理の流れを示すメインフローチャートである。なお、図34において、図14に示す処理ステップと同じ処理ステップについては、図13と同じステップ番号を付し、詳細な説明を省略する。   FIG. 34 is a main flowchart showing a flow of processing executed by the game apparatus 3 when the second method is adopted. In FIG. 34, the same processing steps as the processing steps shown in FIG. 14 are denoted by the same step numbers as in FIG.

第2の方法を採用する場合には、ステップS2の初期姿勢設定処理の次に、ステップS41の処理が実行される。ステップS81において、CPU10は、オフセット決定処理を実行する。オフセット決定処理は、第1の座標を補正するためのオフセット量を決定する処理である。以下、図35を参照して、オフセット決定処理の詳細を説明する。   When the second method is adopted, the process of step S41 is executed after the initial posture setting process of step S2. In step S81, the CPU 10 executes an offset determination process. The offset determination process is a process for determining an offset amount for correcting the first coordinates. Hereinafter, the details of the offset determination process will be described with reference to FIG.

図35は、図34に示すオフセット決定処理(ステップS81)の流れを示すフローチャートである。オフセット決定処理においては、まずステップS91において、CPU10は操作データを取得する。ステップS91の処理は、上述したステップS3の処理と同じである。ステップS91の次にステップS92の処理が実行される。   FIG. 35 is a flowchart showing the flow of the offset determination process (step S81) shown in FIG. In the offset determination process, first, in step S91, the CPU 10 acquires operation data. The process of step S91 is the same as the process of step S3 described above. Following step S91, the process of step S92 is executed.

ステップS92において、CPU10は、入力装置8の指示位置を表す第2の座標を算出する。第2の座標は、ステップS91で取得されたマーカ座標に基づいて算出される。すなわち、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座標データ88としてメインメモリに記憶させる。以上のステップS92の次にステップS93の処理が実行される。   In step S <b> 92, the CPU 10 calculates second coordinates representing the designated position of the input device 8. The second coordinates are calculated based on the marker coordinates acquired in step S91. That is, the CPU 10 reads the marker coordinate data 65 from the main memory, and calculates the second coordinates based on the marker coordinates. Any method may be used to calculate the second coordinates from the marker coordinates. For example, the coordinates (px, py) calculated in step S33 described above can be calculated from the marker coordinates, and the second coordinates can be calculated based on the coordinates (px, py). Specifically, the positive / negative of the x component of the coordinates (px, py) is reversed so that a predetermined ratio (for example, the length of the captured image in the x-axis direction matches the horizontal length of the screen of the television 2). By performing the scaling by the ratio), it is possible to obtain the indicated position in the horizontal direction of the screen. In addition, the sign of the y component of the coordinates (px, py) is reversed to a predetermined ratio (for example, the ratio of the length of the captured image in the y-axis direction to the length of the screen 2 of the television 2). By performing the scaling, it is possible to obtain a designated position in the vertical direction of the screen. Regarding the vertical direction, it is preferable to appropriately set the offset amount depending on whether the marker unit 6 is installed above or below the television 2. The CPU 10 stores data indicating the calculated second coordinates in the main memory as second coordinate data 88. Following step S92, the process of step S93 is executed.

ステップS93において、CPU10は、入力装置8の第1の姿勢を算出する。ステップS93の処理は、上述したステップS4〜S6の処理と同様である。なお、本実施形態では、第1の姿勢を算出する処理を毎フレーム(ステップS91〜S98の処理ループ毎に)実行することとするが、当該処理は、ステップS94の判定結果が肯定となる時点でのみ実行されてもよい。ステップS93の次にステップS94の処理が実行される。   In step S <b> 93, the CPU 10 calculates the first posture of the input device 8. The process of step S93 is the same as the process of steps S4 to S6 described above. In the present embodiment, the process for calculating the first posture is executed for each frame (for each process loop of steps S91 to S98). However, this process is performed when the determination result of step S94 is positive. It may be executed only in Following step S93, the process of step S94 is executed.

ステップS94において、CPU10は、所定の設定画面とカーソルとをテレビ2の画面に表示させる。設定画面は、ユーザが所定の指示を行うためのボタン画像を含む画面である。図36は、設定画面の一例を示す図である。図36においては所定の指示は、カーソルの速度調整(感度調整)を行う指示であり、カーソルの速度を上げる指示を表すボタン画像101と、カーソルの速度を下げる指示を表すボタン画像102とが表示される。なお、ここで調整対象となるカーソルは、現在表示されているカーソル103ではなく、後のゲーム操作で用いる、第1の座標(画面座標)に基づいて位置が決定されるカーソルである。また、上記所定の指示の内容はどのようなものであってもよく、カーソルに関する他の調整(例えば、入力装置8の操作に対するカーソルの追従性の調整や、カーソルに設定される遊びの調整や、手ぶれ防止機能の調整等)を行うための指示であってもよいし、設定画面での設定操作を終了する指示であってもよいし、ゲームを開始する指示であってもよい。   In step S <b> 94, the CPU 10 displays a predetermined setting screen and a cursor on the screen of the television 2. The setting screen is a screen including a button image for the user to give a predetermined instruction. FIG. 36 is a diagram illustrating an example of the setting screen. In FIG. 36, the predetermined instruction is an instruction for adjusting the cursor speed (sensitivity adjustment), and a button image 101 indicating an instruction for increasing the cursor speed and a button image 102 indicating an instruction for decreasing the cursor speed are displayed. Is done. Note that the cursor to be adjusted here is not the currently displayed cursor 103 but a cursor whose position is determined based on the first coordinates (screen coordinates) used in a later game operation. The contents of the predetermined instruction may be anything, and other adjustments relating to the cursor (for example, adjustment of the followability of the cursor to the operation of the input device 8, adjustment of play set for the cursor, For example, adjustment of a camera shake prevention function), an instruction to end a setting operation on the setting screen, or an instruction to start a game.

また、テレビ2の画面には、上記設定画面とともにカーソル103が表示される。すなわち、CPU10は、メインメモリから第2座標データ88を読み出し、第2の座標データ78が示す位置にカーソル103を表示させる。このように、ステップS94で表示されるカーソル103の位置は、マーカ座標に基づいて算出されるものであり、カーソル103はマーカ座標に基づく方法で制御されるものである。なお、図35では示していないが、CPU10は、上記ボタン画像101または102が指定された(カーソル103がボタン画像を指し示す状態で入力装置8の所定のボタンが押下された)場合に、指定されたボタン画像に応じた調整処理を行う。上記ステップS94の次に、ステップS95の処理が実行される。   A cursor 103 is displayed on the screen of the television 2 together with the setting screen. That is, the CPU 10 reads the second coordinate data 88 from the main memory, and displays the cursor 103 at the position indicated by the second coordinate data 78. Thus, the position of the cursor 103 displayed in step S94 is calculated based on the marker coordinates, and the cursor 103 is controlled by a method based on the marker coordinates. Although not shown in FIG. 35, the CPU 10 is designated when the button image 101 or 102 is designated (a predetermined button of the input device 8 is pressed while the cursor 103 points to the button image). Adjustment processing is performed according to the button image. Following step S94, the process of step S95 is executed.

図35の説明に戻り、ステップS95において、CPU10は、カーソル103が画面の上下方向に関して中央に位置しているか否かを判定する。この判定は、第2の座標を用いて行うことができる。具体的には、CPU10は、メインメモリから第2座標データ88を読み出し、第2座標データ88が示す位置が上記ボタン画像101または102の表示領域内であるか否かを判定する。つまり、CPU10は、上記ボタン画像101または102の表示領域内にカーソル103が位置しているか否かを判定する。ステップS95の判定結果が肯定である場合、ステップS96の処理が実行される。一方、ステップS95の判定結果が否定である場合、ステップS96およびS97の処理がスキップされて、後述するステップS98の処理が実行される。   Returning to the description of FIG. 35, in step S95, the CPU 10 determines whether or not the cursor 103 is positioned at the center in the vertical direction of the screen. This determination can be made using the second coordinates. Specifically, the CPU 10 reads the second coordinate data 88 from the main memory, and determines whether the position indicated by the second coordinate data 88 is within the display area of the button image 101 or 102. That is, the CPU 10 determines whether or not the cursor 103 is positioned within the display area of the button image 101 or 102. If the determination result of step S95 is affirmative, the process of step S96 is executed. On the other hand, if the determination result of step S95 is negative, the processes of steps S96 and S97 are skipped, and the process of step S98 described later is executed.

なお、上記ステップS95では、第2の座標(カーソル103)が厳密に画面の中心に位置しているか否かを判定するのではなく、中心付近に(ボタン画像の表示領域内に)第2の座標が位置しているか否かを判定している。これは、本発明では、ユーザに違和感を与えないようにすることが目的であり、入力装置の指示位置と画面座標の位置とを厳密に一致させる必要はないからである。また、ステップS95において第2の座標が画面の中心に位置するか否かを厳密に判定すると、ステップS95の判定結果が肯定となる可能性が低くなり、オフセット量が決定されなくなる可能性があるからである。   In step S95, it is not determined whether or not the second coordinate (cursor 103) is strictly located at the center of the screen, but the second coordinate (in the display area of the button image) is located near the center. 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 positioned at the center of the screen in step S95, the determination result in step S95 is less likely to be affirmative, and the offset amount may not be determined. Because.

ステップS96において、CPU10は、第1の姿勢に基づいて第1の座標を算出する。ステップS96における算出処理は、上述したステップS7の算出処理と同じである。すなわち、CPU10は、ステップS93で算出された第1の姿勢に基づいて、上記第1の方法に従って第1の座標を算出する。算出された第1の座標は、第1座標データ87としてメインメモリ32に記憶される。ステップS96の次にステップS97の処理が実行される。   In step S96, the CPU 10 calculates the first coordinates based on the first posture. The calculation process in step S96 is the same as the calculation process in step S7 described above. That is, the CPU 10 calculates the first coordinates according to the first method based on the first attitude calculated in step S93. The calculated first coordinates are stored in the main memory 32 as first coordinate data 87. Following step S96, the process of step S97 is performed.

ステップS97において、CPU10は、ステップS96で算出された第1の座標に基づいてオフセット量を決定する。図37は、オフセット量の決定方法を示す図である。なお、図37で示す入力装置8の姿勢は、入力装置8の指示位置が画面の上下方向に関して中央となった時点(ステップS95の判定結果がYesとなった時点)における姿勢である。また、原点Oは、第1の方法におけるX’Y’座標系の原点であり、上述した投影点Tの位置である。また、点Rは、ステップS96で算出された第1の座標の位置を示す。   In step S97, the CPU 10 determines an offset amount based on the first coordinates calculated in step S96. FIG. 37 is a diagram illustrating a method for determining an offset amount. The posture of the input device 8 shown in FIG. 37 is the posture at the time when the indicated position of the input device 8 becomes the center in the vertical direction of the screen (when the determination result in Step S95 is Yes). The origin O is the origin of the X′Y ′ coordinate system in the first method, and is the position of the projection point T described above. Point R indicates the position of the first coordinate calculated in step S96.

オフセット量は、上記時点における第1の座標のY’成分が原点の値(0)となるように決定される。すなわち、上下方向に関して、第1の座標の位置Rが原点の位置となるように決定される。したがって、オフセット量は、第1の座標のY’成分の値dの正負を反転した値“−d”に決定される(図37参照)。CPU10は、第1座標データ87をメインメモリから読み出し、第1座標データ87により示される第1の座標のY’成分の正負を反転した値をオフセット量として決定する。決定されたオフセット量を示すデータは、オフセット量データ89としてメインメモリに記憶される。なお、後述する第1の座標の補正処理(ステップS82)では、第1の方法で算出された第1の座標が上記オフセット量だけ移動した座標へと補正される。したがって、ステップS97のオフセット量を算出する処理は、X’Y’座標系をオフセット量だけ(オフセット量の符号を反転させた方向へ)移動させる処理と言うことができる。以上のステップS97の次にステップS98が実行される。   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. 37). The CPU 10 reads the first coordinate data 87 from the main memory, and determines a value obtained by inverting the sign of the Y ′ component of the first coordinate indicated by the first coordinate data 87 as the offset amount. Data indicating the determined offset amount is stored in the main memory as offset amount data 89. In the first coordinate correction process (step S82), which will be described later, the first coordinate calculated by the first method is corrected to the coordinate moved by the offset amount. Therefore, it can be said that the process of calculating the offset amount in step S97 is a process of moving the X′Y ′ coordinate system by the offset amount (in the direction in which the sign of the offset amount is reversed). Following step S97, step S98 is executed.

ステップS98において、CPU10は、設定画面を終了するか否かを判定する。ステップS98の判定は、例えば、ユーザが設定画面を終了する指示を行ったか否かによって行われる。ステップS98の判定結果が否定である場合、ステップS91の処理が再度実行される。以降、ステップS98の判定結果が肯定であるまで、ステップS91〜S98の処理が繰り返し実行される。一方、ステップS98の判定結果が肯定である場合、CPU10はオフセット決定処理を終了する。   In step S98, the CPU 10 determines whether or not to end the setting screen. The determination in step S98 is made based on, for example, whether or not the user has given an instruction to end the setting screen. If the determination result of step S98 is negative, the process of step S91 is executed again. Thereafter, the processes of steps S91 to S98 are repeatedly executed until the determination result of step S98 is positive. On the other hand, when the determination result of step S98 is affirmative, the CPU 10 ends the offset determination process.

以上のように、オフセット決定処理においては、入力装置8が画面の(上下方向に関して)中央を指し示す時点で算出される第1の座標のY’成分が原点の値(0)となるように、オフセット量が決定される。ここで、オフセット決定処理においてオフセット量を決定するためには、入力装置8が画面の(上下方向に関して)中央を指し示す状態が生じなければならない。本実施形態では、このような状態を生じさせるべく、所定の指示を行うためのボタン画像101および102を画面の(上下方向に関して)中央に表示させるようにしている(図36)。これによれば、ユーザは、所定の指示を行うために、上記状態となるように入力装置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 generate such a state, button images 101 and 102 for giving a predetermined instruction are displayed in the center (with respect to the vertical direction) (FIG. 36). According to this, since the user naturally operates the input device 8 so as to be in the above state in order to give a predetermined instruction, it is possible to cause the user to perform the offset amount determination operation naturally without making the user aware of it. it can. The predetermined instruction may be any instruction. However, in order to ensure that the process for determining the offset amount is performed reliably, the user must always perform an instruction (for example, a setting screen). An instruction to end or an instruction to start a game is preferable. Further, as in the present embodiment, by giving an instruction regarding the adjustment of the cursor as the predetermined instruction, the offset amount can be determined simultaneously with the adjustment of the cursor. According to this, it is possible to determine the offset amount without giving the user a feeling that “an extra operation is being performed (to determine the offset amount)”.

図34の説明に戻り、ステップS81のオフセット決定処理の次に、上述した実施形態と同様のステップS3の処理が実行される。さらに、ステップS3の次に、上述した実施形態と同様のステップS4〜S7の処理が実行される。なお、ステップS7の処理は、第1の方法で第1の座標を算出する処理である。第2の方法では、ステップS7の処理の次にステップS82の処理が実行される。   Returning to the description of FIG. 34, the process of step S3 similar to the above-described embodiment is executed after the offset determination process of step S81. 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 S82 is executed after the process of step S7.

ステップS82において、CPU10は、ステップS7で算出された第1の座標をオフセット量に従って補正する。すなわち、CPU10は、第1座標データ87およびオフセット量データ78をメインメモリから読み出し、第1の座標を、Y’成分にオフセット量Dを加算した値へと補正する。補正後の第1の座標を示すデータは、新たな第1座標データ87としてメインメモリに記憶される。   In step S82, the CPU 10 corrects the first coordinates calculated in step S7 according to the offset amount. That is, the CPU 10 reads the first coordinate data 87 and the offset amount data 78 from the main memory, and corrects the first coordinate to a value obtained by adding the offset amount D to the Y ′ component. Data indicating the corrected first coordinates is stored as new first coordinate data 87 in the main memory.

なお、本実施形態では、第1の方法による第1の座標の算出処理(ステップS7)と、第1の座標の補正処理(ステップS82)とを別々の処理として記載したが、CPU10は、これら2つの処理をまとめて実行してもよい。すなわち、ステップS7において、CPU10は、上式(15)に代えて、以下の式(23)に従って第1の座標を算出してもよい。
Wy=L×Zy/Zz+D …(23)
上式(23)において、変数Dは、オフセット量を示し、上記ステップS96で算出された第1の座標のY’成分(d)の符号を反転させた値(−d)である。上式(23)を用いる場合、補正処理を含めた形で第1の座標を算出することができる。
In the present embodiment, the first coordinate calculation process (step S7) by the first method and the first coordinate correction process (step S82) are described as separate processes. However, the CPU 10 The two processes may be executed together. That is, in step S7, the CPU 10 may calculate the first coordinates according to the following equation (23) instead of the above equation (15).
Wy = L × Zy / Zz + D (23)
In the above equation (23), 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 S96. When the above equation (23) is used, the first coordinates can be calculated in a form including correction processing.

ステップS82の次にステップS83およびS84の処理が実行される。ステップS83およびS84の処理は、上述したステップS8の処理と同様であるが、図34ではステップS8の処理を2つに分けてステップS83およびS84として説明を行う。   Following step S82, the processes of steps S83 and S84 are executed. The process of steps S83 and S84 is the same as the process of step S8 described above, but in FIG. 34, the process of step S8 is divided into two and described as steps S83 and S84.

ステップS83において、CPU10は、テレビ2の画面上の位置を表す座標(画面座標)を算出する。画面座標は、ステップS82で補正された第1の座標に基づいて算出される。すなわち、CPU10は、第1座標データ87をメインメモリから読み出し、第1座標データ87により示される第1の座標に基づいて画面座標を算出する。画面座標は、第1の座標が原点の値(0,0)となる場合に画面の中心となるように算出される。また、画面座標は、画面の中心から画面座標への方向が、原点から第1の座標への方向に対応する方向となり、画面の中心から画面座標までの長さが、原点から第1の座標までの長さに対応する長さとなるように算出される。したがって、入力装置8のZ軸を画面の中心に向けた状態では、画面座標は画面の中心を表し(画面座標と指示位置とが一致し)、当該状態から入力装置8のZ軸の向きを変化させた方向に応じた方向へ画面座標が移動することになる。以上のようにして算出された画面座標を示すデータは、画面座標データ90としてメインメモリに記憶される。ステップS83の次にステップS84の処理が実行される。   In step S <b> 83, the CPU 10 calculates coordinates (screen coordinates) representing the position on the screen of the television 2. The screen coordinates are calculated based on the first coordinates corrected in step S82. That is, the CPU 10 reads the first coordinate data 87 from the main memory, and calculates the screen coordinates based on the first coordinates indicated by the first coordinate data 87. The screen coordinates are calculated to be the center of the screen when the first coordinates are the origin value (0, 0). The screen coordinate is a direction in which the direction from the center of the screen to the screen coordinate corresponds to the direction from the origin to the first coordinate, and the length from the center of the screen to the screen coordinate is the first coordinate from the origin. It is calculated to be a length corresponding to the length up to. Therefore, in a state where the Z axis of the input device 8 is directed to the center of the screen, the screen coordinates represent the center of the screen (the screen coordinates coincide with the designated position), and the direction of the Z axis of the input device 8 is determined from this state. The screen coordinates move in the direction corresponding to the changed direction. Data indicating the screen coordinates calculated as described above is stored in the main memory as screen coordinate data 90. Following step S83, the process of step S84 is executed.

ステップS84において、CPU10は、ステップS83で算出された画面座標を用いたゲーム処理を行う。ステップS84におけるゲーム処理は、上記画面座標に基づく処理であればどのような処理であってもよい。例えば、画面座標の位置にカーソルやゲームのオブジェクトを表示させる処理でもよいし、オブジェクトの位置と画面座標との位置関係に応じてオブジェクトを移動させる処理でもよい。また、ステップS84におけるゲーム処理は、上記ステップS8の表示制御処理であってもよい。このとき、表示制御処理においては、上記ステップS82で補正された第1の座標(仮想面座標)に基づいて表示範囲が制御されてもよい。つまり、ステップS41およびS42の処理においては、上記ステップS82で補正された第1の座標に基づいて仮想カメラの向きおよび位置が制御されてもよい。また、ステップS43においては、上記ステップS83で算出された画面座標の位置がカーソル位置として設定される。なお、画面座標に何らかの画像が表示される場合には、ユーザが画面座標の位置を視認することができるので、第1の方法では上述したような違和感を抱く可能性が高い。したがって、このような場合には第2の方法が特に有効である。ステップS84の次に、上記実施形態と同様のステップS9の処理が実行される。以上で、第2の方法の説明を終了する。   In step S84, the CPU 10 performs a game process using the screen coordinates calculated in step S83. The game process in step S84 may be any process as long as the process is based on the screen coordinates. For example, a process of displaying a cursor or a game object at the position of the screen coordinates may be performed, or a process of moving the object according to the positional relationship between the position of the object and the screen coordinates may be performed. Further, the game process in step S84 may be the display control process in step S8. At this time, in the display control process, the display range may be controlled based on the first coordinates (virtual plane coordinates) corrected in step S82. That is, in the processes of steps S41 and S42, the orientation and position of the virtual camera may be controlled based on the first coordinates corrected in step S82. In step S43, the position of the screen coordinates calculated in step S83 is set as the cursor position. When any image is displayed on the screen coordinates, the user can visually recognize the position of the screen coordinates. Therefore, the first method has a high possibility of having the above-mentioned uncomfortable feeling. Therefore, the second method is particularly effective in such a case. Following step S84, the process of step S9 similar to that in the above embodiment is executed. This is the end of the description of the second method.

以上のように、第2の方法においては、ゲーム装置3は、設定画面を表示する際に、入力装置8が画面の上下方向に関して中央を指し示している状態を検知し(ステップ54)、その状態における第1の座標を用いてオフセット量を決定する(ステップS97)。そして、その後のゲーム処理においては、第1の方法で算出された第1の座標を上記オフセット量に従って補正する(ステップS82)。したがって、入力装置8が画面の上下方向に関して中央を指し示している状態では、第1の座標のY’成分は0となり、その結果、画面座標は、上下方向に関して画面の中央の位置を表すことになる。したがって、第2の方法によれば、ユーザが入力装置8で画面の中心を指している場合には画面座標は画面の中心を表すことになるので、ユーザに違和感を与えることなく、画面座標を適切に算出することができる。   As described above, in the second method, when the game apparatus 3 displays the setting screen, the game apparatus 3 detects a state in which the input device 8 points to the center with respect to the vertical direction of the screen (step 54). The offset amount is determined using the first coordinates at (step S97). In the subsequent game processing, the first coordinates calculated by the first method are corrected according to the offset amount (step S82). Therefore, in a state where the input device 8 points to the center in the vertical direction of the screen, the Y ′ component of the first coordinate is 0, and as a result, the screen coordinate represents the center position of the screen in the vertical direction. Become. Therefore, according to the second method, when the user points to the center of the screen with the input device 8, the screen coordinates represent the center of the screen. It can be calculated appropriately.

なお、上記実施形態においては、指示位置が画面の中心となる場合には、画面座標の位置と指示位置とが一致する。一方、指示位置がその他の位置となる場合には、上記長さ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, it is considered that the user hardly feels a sense of incongruity, and the position of the screen coordinates and the designated position are different 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の姿勢を決定する処理であるステップS97の処理は、「基準姿勢を決定する処理」であると言える。また、原点から補正後の第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 S97 which is the process of determining is a "process of determining 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 game apparatus 3 may use two types of cursors with different calculation methods. If the two types of cursors do not match at any position on the screen (the state of the input device 8 does not match when the positions of the two types of cursors match), the cursor moves from one cursor to the other. At the time of switching, the user feels that the operation method of the cursor is completely changed, so that the user may feel uncomfortable and feel that the operability is poor. On the other hand, in the above embodiment, the two types of cursors match at the center of the screen (the state of the input device 8 when the cursor is positioned at the center of the screen matches). Therefore, there is little discomfort when switching between the two types of cursors, and the user can be prevented from being confused with respect to the cursor operation.

また、上記実施形態においては、上記第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 game apparatus 3 can determine the offset amount without causing the user to feel uncomfortable due to a sudden change in the behavior of the cursor.

なお、他の実施形態においては、ゲーム装置3は、オフセット量を決定する際、上記第2カーソルを必ずしも用いる必要はない。例えば、ゲーム装置3は、「画面中央にコントローラを向けてAボタンを押して下さい」というメッセージを表示し(カーソルは表示しない)、Aボタンが押下された時点で上記ステップS96およびS97の処理を実行するようにしてもよい。この場合であっても、ユーザが「入力装置8が画面中央を指している」と感じる状態で、画面座標は画面の中心に位置することになるので、上記実施形態と同様、ユーザが抱く違和感を低減することができる。また、ゲーム装置3は、オフセット量を決定することを示唆する画面を表示する必要はなく、例えばゲーム画像が表示されている場合にオフセット量を決定してもよい。   In other embodiments, the game apparatus 3 does not necessarily use the second cursor when determining the offset amount. For example, the game apparatus 3 displays a message “Please point the controller at the center of the screen and press the A button” (the cursor is not displayed), and when the A button is pressed, execute the processes of steps S96 and S97. You may make it do. Even in this case, the screen coordinates are located at the center of the screen in a state in which the user feels that “the input device 8 points to the center of the screen”. Can be reduced. In addition, the game apparatus 3 does not need to display a screen that suggests determining the offset amount, and may determine the offset amount when, for example, a game image is displayed.

また、上記実施形態では、ゲーム装置3は、オフセット量を決定する処理(ステップS97)を、画面座標を入力として用いる処理(ステップS84)を実行前にのみ実行した。ここで、他の実施形態においては、画面座標を入力として用いる処理を繰り返し実行する場合、当該処理が繰り返し実行される合間に、オフセット量を(再度)決定する処理を実行してもよい。例えば上記実施形態に即して言えば、ゲーム中においてステップS3〜S9の処理ループが繰り返し実行される間に、オフセット量を決定する処理が実行されてもよい。例えば、ゲーム装置3は、ゲーム中において上記設定画面が表示されるタイミングでオフセット量を決定する処理を実行してもよいし、当該処理を所定時間間隔で実行してもよいし、ユーザが指示したタイミングで当該処理を実行してもよい。このように、ゲーム中においてオフセット量を決定し直すことによって、ゲーム中に入力装置を把持するユーザの状態が変化した場合(例えば、ゲームを立ってプレイしていたが、ゲーム途中で座った場合)でも、適切なオフセット量を決定し直すことができる。なお、オフセット量を決定し直す処理が実行されると、オフセット量が変化することによって、ユーザの意図しない画面座標の変化が生じ、ユーザがゲーム操作をうまく行えない可能性がある。そのため、ゲーム装置3は、画面座標を入力とする処理が実行されている期間(例えば、カーソルを用いてゲーム操作を行っている期間)には、オフセット量を決定し直す処理をできるだけ実行しないことが好ましい。また、当該処理を実行する場合には、画面座標の変化による影響が小さい場面(例えば、ゲームのポーズ中や、メニュー画面の表示中)で実行することが好ましい。   In the above embodiment, the game apparatus 3 executes the process of determining the offset amount (step S97) only before the process of using the screen coordinates as an input (step S84). Here, in another embodiment, when the process using the screen coordinates as an input is repeatedly executed, the process of determining the offset amount (again) may be executed between the times when the process is repeatedly executed. For example, in the case of the above embodiment, the process for determining the offset amount may be executed while the process loop of steps S3 to S9 is repeatedly executed during the game. For example, the game apparatus 3 may execute a process for determining the offset amount at a timing when the setting screen is displayed during the game, may execute the process at a predetermined time interval, or may be instructed by the user. The processing may be executed at the timing. As described above, when the state of the user holding the input device changes during the game by re-determining the offset amount during the game (for example, when the game is standing and playing but sitting in the middle of the game) However, an appropriate offset amount can be determined again. Note that when the process for re-determining the offset amount is executed, the offset amount changes, thereby causing a change in screen coordinates not intended by the user, and the user may not be able to perform the game operation well. For this reason, the game apparatus 3 does not execute the process of re-determining the offset amount as much as possible during the period in which the process using the screen coordinates as an input is being performed (for example, the period in which the game operation is performed using the cursor). Is preferred. Further, when executing the processing, it is preferable to execute it in a scene where the influence of the change in the screen coordinates is small (for example, during a game pause or during the display of a menu screen).

上記実施形態では、ゲーム装置3は、仮想空間に設定される平面Qを用いて入力装置8の姿勢から第1の座標を算出し、第1の座標から画面座標を算出した。ここで、入力装置8の姿勢から画面座標を算出する方法は、姿勢に応じて画面座標の位置が変化する方法であればどのような方法であってもよい。例えば、ゲーム装置3は、第1の座標を算出せずに、入力装置8の姿勢から画面座標を直接算出してもよい(換言すれば、第1の座標は画面上の位置を表す座標であってもよい。)。具体的には、ゲーム装置3は、入力装置8が所定の基準姿勢となる場合に画面座標が画面の中心の位置となるように設定し、かつ、当該基準姿勢からの回転角度に比例した大きさだけ、当該基準姿勢からの回転方向に(中心位置にある画面座標を)移動させた位置を表すように、画面座標を算出してもよい。また、例えば、ゲーム装置3は、上記X’Y’座標を画面座標の座標系と一致するように設定することで、入力装置8の姿勢から画面座標を直接算出してもよい。   In the above embodiment, the game apparatus 3 calculates the first coordinates from the attitude of the input device 8 using the plane Q set in the virtual space, and calculates the screen coordinates from the first coordinates. Here, the method for calculating the screen coordinates from the attitude of the input device 8 may be any method as long as the position of the screen coordinates changes according to the attitude. For example, the game apparatus 3 may directly calculate the screen coordinates from the attitude of the input device 8 without calculating the first coordinates (in other words, the first coordinates are coordinates representing a position on the screen). May be.) Specifically, the game apparatus 3 sets the screen coordinates to be the center position of the screen when the input device 8 is in a predetermined reference posture, and has a size proportional to the rotation angle from the reference posture. Thus, the screen coordinates may be calculated so as to represent the position moved in the rotation direction from the reference posture (the screen coordinates at the center position). Further, for example, the game apparatus 3 may directly calculate the screen coordinates from the attitude of the input device 8 by setting the X′Y ′ coordinates so as to coincide with the coordinate system of the screen coordinates.

また、上記実施形態においては、ゲーム装置3は、オフセット量を用いて第1の座標を補正することによって画面座標を間接的に補正するようにしたが、他の実施形態においては、画面座標を直接補正するようにしてもよい。具体的には、ゲーム装置3は、上記ステップS96において、第1の座標からさらに画面座標を算出し、ステップS97において、画面座標に関するオフセット量を算出してもよい。このとき、ステップS82およびS83においては、ゲーム装置3は、第1の方法で算出された第1の座標から画面座標を算出し、算出された画面座標をオフセット量に従って補正することによって、最終的な画面座標を得ればよい。   In the above embodiment, the game apparatus 3 indirectly corrects the screen coordinates by correcting the first coordinates using the offset amount. However, in other embodiments, the game coordinates are changed to the screen coordinates. You may make it correct | amend directly. Specifically, the game apparatus 3 may further calculate screen coordinates from the first coordinates in step S96, and may calculate an offset amount related to the screen coordinates in step S97. At this time, in steps S82 and S83, the game apparatus 3 calculates screen coordinates from the first coordinates calculated by the first method, and corrects the calculated screen coordinates according to the offset amount, thereby finally What is necessary is just to obtain a screen coordinate.

また、上記実施形態においては、ゲーム装置3は、第1の座標に関してオフセット量を設定する、すなわち、X’Y’座標系を平面Q上で移動することによって、第1の座標の補正を行った(図32、図37)。ここで、他の実施形態においては、仮想空間における入力装置8の位置を中心にX’Y’座標系を回転させることによって、第1の座標を補正してもよい。図38は、第2の方法における補正方法の変形例を示す図である。図38は、仮想空間における平面Qを側方から見た図であって、点線で示す平面Qは、第1の方法で用いる平面Qと同じ平面であり、実線で示す平面Q’は、補正後の平面Qである。図38に示す変形例では、CPU10は、図35に示す上記ステップS96およびS97の処理に代えて、次の処理を実行する。すなわち、CPU10は、入力装置8の姿勢(第1姿勢M1)に基づいて、補正後のX’Y’座標系を設定する。X’Y’座標系は、入力装置8のZ軸ベクトルVZの方向に長さLだけ離れた位置が原点となり、かつ、Z軸ベクトルVZと垂直な平面Q’上に設定される。また、ゲーム中においては、CPU10は、図34に示すステップS7およびS82の処理に代えて、上記平面Q’上のX’Y’座標系によって表現される第1の座標を算出する。上記変形例によれば、仮想空間における入力装置8の位置からの距離が一定になるので、第1の座標(画面座標)をより正確に算出することができる。例えば、実際にテレビ2の画面が鉛直方向から傾いて設置される場合(例えば、画面が水平よりも下方を向いてテレビ2が天井に設置される場合)には、より正確に画面座標を算出することができる。一方、上記実施形態における補正方法では、入力装置8の位置に対して固定される平面内においてX’Y’座標系が設定されるので、補正の計算が簡単になる。したがって、テレビ2の画面が鉛直方向から大きく傾いて設置される状況が想定されない場合や、CPU10の処理負荷の低減を優先する場合には、上記実施形態における補正方法を採用することが好ましい。   In the above embodiment, the game apparatus 3 sets the offset amount with respect to the first coordinate, that is, corrects the first coordinate by moving the X′Y ′ coordinate system on the plane Q. (FIGS. 32 and 37). Here, in another embodiment, the first coordinate may be corrected by rotating the X′Y ′ coordinate system around the position of the input device 8 in the virtual space. FIG. 38 is a diagram showing a modification of the correction method in the second method. FIG. 38 is a side view of the plane Q in the virtual space. The plane Q indicated by the dotted line is the same plane as the plane Q used in the first method, and the plane Q ′ indicated by the solid line is corrected. This is the later plane Q. In the modification shown in FIG. 38, the CPU 10 executes the following processing instead of the processing in steps S96 and S97 shown in FIG. That is, the CPU 10 sets the corrected X′Y ′ coordinate system based on the attitude of the input device 8 (first attitude M1). The X′Y ′ coordinate system is set on a plane Q ′ that is the origin at a position separated by a length L in the direction of the Z-axis vector VZ of the input device 8 and that is perpendicular to the Z-axis vector VZ. Further, during the game, the CPU 10 calculates the first coordinates represented by the X′Y ′ coordinate system on the plane Q ′ instead of the processing of steps S7 and S82 shown in FIG. According to the modified example, since the distance from the position of the input device 8 in the virtual space is constant, the first coordinates (screen coordinates) can be calculated more accurately. For example, when the screen of the television 2 is actually installed tilted from the vertical direction (for example, when the television 2 is installed on the ceiling with the screen facing downward from the horizontal), the screen coordinates are calculated more accurately. can do. On the other hand, in the correction method in the above embodiment, the X′Y ′ coordinate system is set in a plane fixed with respect to the position of the input device 8, so that the correction calculation is simplified. Therefore, when the situation where the screen of the television 2 is installed with a large inclination from the vertical direction is not assumed, or when priority is given to reducing the processing load of the CPU 10, it is preferable to employ the correction method in the above embodiment.

(撮像手段に関する変形例)
上記実施形態では、ゲーム装置3は、入力装置8が画面の中心を向く方向となったことを検知するために、入力装置8が備える撮像手段による撮像画像(マーカ座標)を用いた。ここで、ゲーム装置3は、空間内の所定位置から見たときの入力装置8の方向を知ることができれば、上記撮像画像に代えて、他の情報を用いて上記の検知を行ってもよい。例えば、テレビ2の周辺にカメラが設置される場合、ゲーム装置3は、当該カメラによって入力装置8が撮像された撮像画像を用いて上記検知を行ってもよい。また、上記検知を行うための方法はどのようなものであってもよく、例えば入力装置8の周囲に電波あるいは超音波等の信号を発生する装置を設置し、ゲーム装置3は、入力装置8において当該信号を検知することによって、空間内の所定位置から見たときの入力装置8の方向を検知するようにしてもよい。
(Modification regarding imaging means)
In the above-described embodiment, the game apparatus 3 uses a captured image (marker coordinates) obtained by an imaging unit included in the input apparatus 8 in order to detect that the input apparatus 8 is in a direction toward the center of the screen. Here, as long as the game apparatus 3 can know the direction of the input apparatus 8 when viewed from a predetermined position in the space, the game apparatus 3 may perform the detection using other information instead of the captured image. . For example, when a camera is installed around the television 2, the game apparatus 3 may perform the detection using a captured image obtained by capturing the input device 8 with the camera. Any method may be used for the detection. For example, a device that generates a signal such as a radio wave or an ultrasonic wave is installed around the input device 8. In this case, the direction of the input device 8 when viewed from a predetermined position in the space may be detected by detecting the signal.

(入力装置8の姿勢算出に関する変形例)
なお、上記実施形態においては、ゲーム装置3は、ジャイロセンサ55および56、加速度センサ37、ならびに撮像素子40による検出結果を用いて、入力装置8の姿勢を算出した(ステップS3〜S6)。ここで、入力装置8の姿勢を算出する方法はどのような方法であってもよい。例えば、入力装置8の姿勢は、ジャイロセンサの検出結果のみを用いて算出されてもよいし、加速度センサの検出結果のみを用いて算出されてもよい。
(Modification regarding attitude calculation of input device 8)
In the above embodiment, the game apparatus 3 calculates the attitude of the input device 8 using the detection results obtained by the gyro sensors 55 and 56, the acceleration sensor 37, and the image sensor 40 (steps S3 to S6). Here, the method for calculating the attitude of the input device 8 may be any method. For example, the attitude of the input device 8 may be calculated using only the detection result of the gyro sensor, or may be calculated using only the detection result of the acceleration sensor.

なお、上記実施形態においては、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 marker unit 6. Specifically, before executing the second correction process, the CPU 10 determines whether or not the input device 8 (imaging unit) faces a direction in which the marker unit 6 can be imaged. This determination can be performed using the first posture or the second posture. For example, the first posture (or the second posture) may be determined as to whether the imaging direction of the input device 8 is the same or opposite to the direction from the input device 8 to the marker unit 6. In addition, the first posture used for the above determination may be the first posture in which the first and second correction processes are performed in the previous processing loop, or may be calculated in the current processing loop. The first posture in which one correction process is performed may be used.

上記の判定の結果、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 marker unit 6 can be imaged, the CPU 10 performs the second correction process and faces the direction in which the marker unit 6 can be imaged. If it is determined that there is not, the second correction process is skipped. Note that an object that is not the marker unit 6 (for example, an electric lamp in a room or sunlight outside a window) may be erroneously detected as the marker unit 6, and the third posture is obtained using the marker coordinates obtained by the erroneous detection. When is calculated, correct correction cannot be performed even if the second correction process is performed using the third posture. On the other hand, by performing the above determination process, it is possible to prevent the second correction process from being performed using the third posture calculated from the marker coordinates obtained by the erroneous detection. As a result, the second correction process can be performed more accurately.

以上のように、本発明は、ジャイロセンサの出力を用いて表示装置に表示される表示範囲を制御すること等を目的として、Webページや電子番組表を表示装置に表示するための情報処理装置や、ゲーム画像を表示装置に表示するためのゲーム装置等として利用することができる。   As described above, the present invention is an information processing apparatus for displaying a Web page or an electronic program guide on a display device for the purpose of controlling the display range displayed on the display device using the output of the gyro sensor. It can also be used as a game device for displaying game images on a display device.

1 ゲームシステム
2 テレビ
3 ゲーム装置
4 光ディスク
5 コントローラ
6 マーカ部
7 ジャイロセンサユニット
8 入力装置
10 CPU
11c GPU
11e 内部メインメモリ
12 外部メインメモリ
63 角速度データ
64 加速度データ
65 マーカ座標データ
68 第1姿勢データ
77 仮想面座標データ
78 はみ出しベクトルデータ
79 カメラ向きデータ
80 カメラ位置データ
81 カーソル位置データ
91 仮想カメラ
92 表示対象
DESCRIPTION OF SYMBOLS 1 Game system 2 Television 3 Game device 4 Optical disk 5 Controller 6 Marker part 7 Gyro sensor unit 8 Input device 10 CPU
11c GPU
11e Internal main memory 12 External main memory 63 Angular velocity data 64 Acceleration data 65 Marker coordinate data 68 First attitude data 77 Virtual plane coordinate data 78 Projection vector data 79 Camera orientation data 80 Camera position data 81 Cursor position data 91 Virtual camera 92 Display target

Claims (28)

入力装置が備えるジャイロセンサによって検出される角速度を入力し、表示装置に画像を表示させる情報処理装置であって、
前記角速度に基づいて前記入力装置の姿勢を算出する姿勢算出部と、
所定空間の所定位置から前記姿勢を表すベクトルの方向へ延ばした線分と、当該所定空間における所定平面との交点の座標を算出する座標算出部と、
表示対象のうちで前記表示装置に表示すべき表示範囲を前記座標に基づいて制御する表示制御部とを備える、情報処理装置。
An information processing device that inputs an angular velocity detected by a gyro sensor included in an input device and displays an image on a display device,
An attitude calculation unit that calculates an attitude of the input device based on the angular velocity;
A coordinate calculation unit that calculates the coordinates of the intersection of a line segment extending from a predetermined position in a predetermined space in the direction of the vector representing the posture and a predetermined plane in the predetermined space;
An information processing apparatus comprising: a display control unit that controls a display range to be displayed on the display device among display targets based on the coordinates.
前記表示制御部は、前記表示対象が配置される仮想空間内において仮想カメラの向きおよび/または位置を前記座標に基づいて変化させることで前記表示範囲を制御する、請求項1記載の情報処理装置。   The information processing apparatus according to claim 1, wherein the display control unit controls the display range by changing a direction and / or position of a virtual camera based on the coordinates in a virtual space in which the display target is arranged. . 前記情報処理装置は、前記入力装置に設けられた操作手段に対する方向指示操作を示す操作情報をさらに入力し、
前記表示制御部は、前記座標に基づいて前記仮想カメラの向きを変化させ、前記操作情報に基づいて前記仮想カメラの位置を変化させることで前記表示範囲を制御する、請求項2記載の情報処理装置。
The information processing apparatus further inputs operation information indicating a direction instruction operation on an operation unit provided in the input device,
The information processing according to claim 2, wherein the display control unit controls the display range by changing a direction of the virtual camera based on the coordinates and changing a position of the virtual camera based on the operation information. apparatus.
前記表示制御部は、前記座標が前記所定平面における所定領域の外側の位置を示す場合、前記表示範囲を変化させる、請求項1から請求項3のいずれか1項に記載の情報処理装置。   The information processing apparatus according to any one of claims 1 to 3, wherein the display control unit changes the display range when the coordinates indicate a position outside a predetermined region on the predetermined plane. 前記所定領域と前記表示装置の画面の領域とが対応するように、当該画面上の位置を前記座標に基づいて算出する画面位置算出部をさらに備える、請求項4に記載の情報処理装置。   The information processing apparatus according to claim 4, further comprising: a screen position calculation unit that calculates a position on the screen based on the coordinates so that the predetermined area corresponds to a screen area of the display device. 前記画面位置算出部が算出した前記画面上の位置に所定の指示画像を表示させる指示画像表示部と、
前記指示画像の位置に基づいて所定の情報処理を実行する処理実行部とをさらに備える、請求項5に記載の情報処理装置。
An instruction image display unit for displaying a predetermined instruction image at a position on the screen calculated by the screen position calculation unit;
The information processing apparatus according to claim 5, further comprising: a process execution unit that executes predetermined information processing based on a position of the instruction image.
前記表示制御部は、前記表示範囲を変化させる方向を、前記所定領域から前記座標が示す位置までの方向に応じて決定する、請求項4から請求項6のいずれか1項に記載の情報処理装置。   The information processing according to any one of claims 4 to 6, wherein the display control unit determines a direction in which the display range is changed in accordance with a direction from the predetermined region to a position indicated by the coordinates. apparatus. 前記表示制御部は、前記表示範囲を変化させる度合を、前記座標が示す位置が前記所定領域から離れている度合に基づいて決定する、請求項4から請求項7のいずれか1項に記載の情報処理装置。   8. The display control unit according to claim 4, wherein the display control unit determines a degree of changing the display range based on a degree that a position indicated by the coordinates is away from the predetermined region. Information processing device. 前記表示制御部は、前記表示範囲を変化させる度合を、前記座標が前記所定領域の外側に位置する場合における当該座標の速度に基づいて決定する、請求項4から請求項7のいずれか1項に記載の情報処理装置。   The said display control part determines the degree to which the said display range is changed based on the speed of the said coordinate in case the said coordinate is located outside the said predetermined area | region, The any one of Claim 4-7 The information processing apparatus described in 1. 前記表示制御部は、前記座標が前記所定領域の外側に出てからの所定期間における当該座標の速度の最大値を少なくとも用いて、前記表示範囲を変化させる速度を決定する、請求項9に記載の情報処理装置。   10. The display control unit according to claim 9, wherein the display control unit determines a speed at which the display range is changed using at least a maximum value of the speed of the coordinates in a predetermined period after the coordinates are outside the predetermined area. Information processing device. 前記表示制御部は、ユーザが前記入力装置を用いて指定した期間において、前記座標に基づき前記表示範囲を変化させる、請求項1から請求項10のいずれか1項に記載の情報処理装置。   The information processing apparatus according to any one of claims 1 to 10, wherein the display control unit changes the display range based on the coordinates in a period specified by a user using the input device. 前記表示制御部は、前記座標の移動方向に応じた方向へ、前記座標の移動量に応じた量だけ前記表示範囲を移動させる、請求項11に記載の情報処理装置。   The information processing apparatus according to claim 11, wherein the display control unit moves the display range in a direction according to a movement direction of the coordinates by an amount according to a movement amount of the coordinates. 前記表示制御部は、前記所定平面における所定の基準位置から前記座標が示す位置までの方向に応じた方向へ、当該所定の基準位置から前記座標が示す位置までの距離に応じた速度で前記表示範囲を移動させる、請求項11に記載の情報処理装置。   The display control unit displays the display in a direction according to a direction from a predetermined reference position on the predetermined plane to a position indicated by the coordinates at a speed according to a distance from the predetermined reference position to the position indicated by the coordinates. The information processing apparatus according to claim 11, wherein the range is moved. 入力装置が備えるジャイロセンサによって検出される角速度を入力し、表示装置に画像を表示させる情報処理装置のコンピュータにおいて実行される情報処理プログラムであって、
前記角速度に基づいて前記入力装置の姿勢を算出する姿勢算出手段と、
所定空間の所定位置から前記姿勢を表すベクトルの方向へ延ばした線分と、当該所定空間における所定平面との交点の座標を算出する座標算出手段と、
表示対象のうちで前記表示装置に表示すべき表示範囲を前記座標に基づいて制御する表示制御手段として前記コンピュータを機能させる、情報処理プログラム。
An information processing program that is executed in a computer of an information processing device that inputs an angular velocity detected by a gyro sensor included in the input device and displays an image on a display device,
Attitude calculating means for calculating the attitude of the input device based on the angular velocity;
Coordinate calculating means for calculating the coordinates of the intersection of a line segment extending from a predetermined position in a predetermined space in the direction of the vector representing the posture and a predetermined plane in the predetermined space;
An information processing program for causing the computer to function as display control means for controlling a display range to be displayed on the display device among display objects based on the coordinates.
前記表示制御手段は、前記表示対象が配置される仮想空間内において仮想カメラの向きおよび/または位置を前記座標に基づいて変化させることで前記表示範囲を制御する、請求項14記載の情報処理プログラム。   The information processing program according to claim 14, wherein the display control means controls the display range by changing a direction and / or position of a virtual camera based on the coordinates in a virtual space in which the display target is arranged. . 前記情報処理装置は、前記入力装置に設けられた操作手段に対する方向指示操作を示す操作情報をさらに入力し、
前記表示制御手段は、前記座標に基づいて前記仮想カメラの向きを変化させ、前記操作情報に基づいて前記仮想カメラの位置を変化させることで前記表示範囲を制御する、請求項15記載の情報処理プログラム。
The information processing apparatus further inputs operation information indicating a direction instruction operation on an operation unit provided in the input device,
The information processing according to claim 15, wherein the display control unit controls the display range by changing an orientation of the virtual camera based on the coordinates and changing a position of the virtual camera based on the operation information. program.
前記表示制御手段は、前記座標が前記所定平面における所定領域の外側の位置を示す場合、前記表示範囲を変化させる、請求項14から請求項16のいずれか1項に記載の情報処理プログラム。   The information processing program according to any one of claims 14 to 16, wherein the display control unit changes the display range when the coordinates indicate a position outside a predetermined region on the predetermined plane. 前記所定領域と前記表示装置の画面の領域とが対応するように、当該画面上の位置を前記座標に基づいて算出する画面位置算出手段として前記コンピュータをさらに機能させる、請求項17に記載の情報処理プログラム。   18. The information according to claim 17, further causing the computer to function as a screen position calculating unit that calculates a position on the screen based on the coordinates so that the predetermined area corresponds to a screen area of the display device. Processing program. 前記画面位置算出手段が算出した前記画面上の位置に所定の指示画像を表示させる指示画像表示手段と、
前記指示画像の位置に基づいて所定の情報処理を実行する処理実行手段として前記コンピュータをさらに機能させる、請求項18に記載の情報処理プログラム。
Instruction image display means for displaying a predetermined instruction image at the position on the screen calculated by the screen position calculation means;
The information processing program according to claim 18, further causing the computer to function as processing execution means for executing predetermined information processing based on a position of the instruction image.
前記表示制御手段は、前記表示範囲を変化させる方向を、前記所定領域から前記座標が示す位置までの方向に応じて決定する、請求項17から請求項19のいずれか1項に記載の情報処理プログラム。   The information processing according to any one of claims 17 to 19, wherein the display control unit determines a direction in which the display range is changed according to a direction from the predetermined area to a position indicated by the coordinates. program. 前記表示制御手段は、前記表示範囲を変化させる度合を、前記座標が示す位置が前記所定領域から離れている度合に基づいて決定する、請求項17から請求項20のいずれか1項に記載の情報処理プログラム。   The display control unit according to any one of claims 17 to 20, wherein the display control unit determines a degree of changing the display range based on a degree that a position indicated by the coordinates is away from the predetermined area. Information processing program. 前記表示制御手段は、前記表示範囲を変化させる度合を、前記座標が前記所定領域の外側に位置する場合における当該座標の速度に基づいて決定する、請求項17から請求項20のいずれか1項に記載の情報処理プログラム。   The said display control means determines the degree to which the said display range is changed based on the speed of the said coordinate in case the said coordinate is located outside the said predetermined area | region. Information processing program described in 1. 前記表示制御手段は、前記座標が前記所定領域の外側に出てからの所定期間における当該座標の速度の最大値を少なくとも用いて、前記表示範囲を変化させる速度を決定する、請求項22に記載の情報処理プログラム。   The said display control means determines the speed | rate which changes the said display range using at least the maximum value of the speed | velocity | rate of the said coordinate in the predetermined period after the said coordinate comes out of the said predetermined area | region. Information processing program. 前記表示制御手段は、ユーザが前記入力装置を用いて指定した期間において、前記座標に基づき前記表示範囲を変化させる、請求項14から請求項23のいずれか1項に記載の情報処理プログラム。   The information processing program according to any one of claims 14 to 23, wherein the display control unit changes the display range based on the coordinates in a period specified by a user using the input device. 前記表示制御手段は、前記座標の移動方向に応じた方向へ、前記座標の移動量に応じた量だけ前記表示範囲を移動させる、請求項24に記載の情報処理プログラム。   25. The information processing program according to claim 24, wherein the display control unit moves the display range by an amount corresponding to a movement amount of the coordinates in a direction corresponding to a movement direction of the coordinates. 前記表示制御手段は、前記所定平面における所定の基準位置から前記座標が示す位置までの方向に応じた方向へ、当該所定の基準位置から前記座標が示す位置までの距離に応じた速度で前記表示範囲を移動させる、請求項24に記載の情報処理プログラム。   The display control means displays the display in a direction corresponding to a direction from a predetermined reference position on the predetermined plane to a position indicated by the coordinates at a speed corresponding to a distance from the predetermined reference position to the position indicated by the coordinates. The information processing program according to claim 24, wherein the range is moved. 入力装置が備えるジャイロセンサによって検出される角速度を入力し、表示装置に画像を表示させる情報処理システムであって、
前記角速度に基づいて前記入力装置の姿勢を算出する姿勢算出部と、
所定空間の所定位置から前記姿勢を表すベクトルの方向へ延ばした線分と、当該所定空間における所定平面との交点の座標を算出する座標算出部と、
表示対象のうちで前記表示装置に表示すべき表示範囲を前記座標に基づいて制御する表示制御部とを備える、情報処理システム。
An information processing system for inputting an angular velocity detected by a gyro sensor included in an input device and displaying an image on a display device,
An attitude calculation unit that calculates an attitude of the input device based on the angular velocity;
A coordinate calculation unit that calculates the coordinates of the intersection of a line segment extending from a predetermined position in a predetermined space in the direction of the vector representing the posture and a predetermined plane in the predetermined space;
An information processing system comprising: a display control unit that controls a display range to be displayed on the display device among display objects based on the coordinates.
入力装置が備えるジャイロセンサによって検出される角速度を入力し、表示装置に画像を表示させる表示範囲制御方法であって、
前記角速度に基づいて前記入力装置の姿勢を算出する姿勢算出ステップと、
所定空間の所定位置から前記姿勢を表すベクトルの方向へ延ばした線分と、当該所定空間における所定平面との交点の座標を算出する座標算出ステップと、
表示対象のうちで前記表示装置に表示すべき表示範囲を前記座標に基づいて制御する表示制御ステップとを備える、表示範囲制御方法。
A display range control method for inputting an angular velocity detected by a gyro sensor included in an input device and displaying an image on a display device,
An attitude calculating step for calculating an attitude of the input device based on the angular velocity;
A coordinate calculation step for calculating the coordinates of the intersection of a line segment extending from a predetermined position in a predetermined space in the direction of the vector representing the posture and a predetermined plane in the predetermined space;
A display range control method comprising: a display control step of controlling a display range to be displayed on the display device among display targets based on the coordinates.
JP2009297473A 2009-03-09 2009-12-28 Information processing apparatus, information processing program, information processing system, and display range control method Active JP5424400B2 (en)

Priority Applications (6)

Application Number Priority Date Filing Date Title
JP2009297473A JP5424400B2 (en) 2009-12-28 2009-12-28 Information processing apparatus, information processing program, information processing system, and display range control method
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
EP10154556.4A EP2228110B1 (en) 2009-03-09 2010-02-24 Coordinate calculation apparatus and storage medium having coordinate calculation program stored therein
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
JP2009297473A JP5424400B2 (en) 2009-12-28 2009-12-28 Information processing apparatus, information processing program, information processing system, and display range control method

Publications (2)

Publication Number Publication Date
JP2011138295A true JP2011138295A (en) 2011-07-14
JP5424400B2 JP5424400B2 (en) 2014-02-26

Family

ID=44349675

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2009297473A Active JP5424400B2 (en) 2009-03-09 2009-12-28 Information processing apparatus, information processing program, information processing system, and display range control method

Country Status (1)

Country Link
JP (1) JP5424400B2 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013029921A (en) * 2011-07-27 2013-02-07 Nintendo Co Ltd Pointing system, information processing system, setting method for coordinate system and the like, information processing device, and information processing program
JP2013058156A (en) * 2011-09-09 2013-03-28 Nintendo Co Ltd Input device, input processing program, input processing method, and input processing system

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH11244540A (en) * 1998-03-06 1999-09-14 Namco Ltd Game device
JP2002298160A (en) * 2001-03-29 2002-10-11 Namco Ltd Portable image generating device and program, and information storage medium
JP2003334379A (en) * 2002-05-20 2003-11-25 Nintendo Co Ltd Game system and game program
JP2006018476A (en) * 2004-06-30 2006-01-19 Sega Corp Method for controlling display of image
JP2007061489A (en) * 2005-09-01 2007-03-15 Nintendo Co Ltd Information processing system and program
JP2007240889A (en) * 2006-03-08 2007-09-20 Victor Co Of Japan Ltd Scrolling control device and scrolling control method
JP2008068060A (en) * 2006-09-14 2008-03-27 Nintendo Co Ltd Method and apparatus for using common pointing input to control 3d viewpoint and object targeting
JP2009187426A (en) * 2008-02-08 2009-08-20 Sony Corp Recording and reproducing device

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH11244540A (en) * 1998-03-06 1999-09-14 Namco Ltd Game device
JP2002298160A (en) * 2001-03-29 2002-10-11 Namco Ltd Portable image generating device and program, and information storage medium
JP2003334379A (en) * 2002-05-20 2003-11-25 Nintendo Co Ltd Game system and game program
JP2006018476A (en) * 2004-06-30 2006-01-19 Sega Corp Method for controlling display of image
JP2007061489A (en) * 2005-09-01 2007-03-15 Nintendo Co Ltd Information processing system and program
JP2007240889A (en) * 2006-03-08 2007-09-20 Victor Co Of Japan Ltd Scrolling control device and scrolling control method
JP2008068060A (en) * 2006-09-14 2008-03-27 Nintendo Co Ltd Method and apparatus for using common pointing input to control 3d viewpoint and object targeting
JP2009187426A (en) * 2008-02-08 2009-08-20 Sony Corp Recording and reproducing device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013029921A (en) * 2011-07-27 2013-02-07 Nintendo Co Ltd Pointing system, information processing system, setting method for coordinate system and the like, information processing device, and information processing program
JP2013058156A (en) * 2011-09-09 2013-03-28 Nintendo Co Ltd Input device, input processing program, input processing method, and input processing system

Also Published As

Publication number Publication date
JP5424400B2 (en) 2014-02-26

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
EP2140918B1 (en) Orientation calculation apparatus, storage medium having orientation calculation program stored therein, game apparatus, and storage medium having game program stored therein
JP5060798B2 (en) Information processing program and information processing apparatus
JP4265814B1 (en) Posture calculation device, posture calculation program, game device, and game program
EP2140916B1 (en) Coordinate calculation apparatus and storage medium having coordinate calculation program stored therein
US8913010B2 (en) Pointing system, information processing system, method for setting coordinate system, etc., information processing device, and storage medium storing information processing program
JP2010207329A (en) Coordinate calculation device and coordinate calculation program
JP5541851B2 (en) Posture calculation device, posture calculation program, game device, and game program
JP5424400B2 (en) Information processing apparatus, information processing program, information processing system, and display range control method
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
JP6042394B2 (en) Coordinate calculation apparatus and coordinate calculation program
JP6280390B2 (en) Information processing program, information processing apparatus, information processing system, and information processing method
JP6262563B2 (en) Information processing program, information processing apparatus, information processing system, and information processing method
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: 20121114

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20130611

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20130612

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: 20131121

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20131122

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

Ref document number: 5424400

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

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250