Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
JP7250451B2 - Programs, electronic devices, and methods - Google Patents
[go: Go Back, main page]

JP7250451B2 - Programs, electronic devices, and methods - Google Patents

Programs, electronic devices, and methods Download PDF

Info

Publication number
JP7250451B2
JP7250451B2 JP2018133541A JP2018133541A JP7250451B2 JP 7250451 B2 JP7250451 B2 JP 7250451B2 JP 2018133541 A JP2018133541 A JP 2018133541A JP 2018133541 A JP2018133541 A JP 2018133541A JP 7250451 B2 JP7250451 B2 JP 7250451B2
Authority
JP
Japan
Prior art keywords
axis
angle
determined
data points
determining
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
JP2018133541A
Other languages
Japanese (ja)
Other versions
JP2019200765A (en
Inventor
修一 倉林
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Cygames Inc
Original Assignee
Cygames Inc
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 Cygames Inc filed Critical Cygames Inc
Priority to JP2018133541A priority Critical patent/JP7250451B2/en
Publication of JP2019200765A publication Critical patent/JP2019200765A/en
Application granted granted Critical
Publication of JP7250451B2 publication Critical patent/JP7250451B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • User Interface Of Digital Computer (AREA)

Description

本発明は、プログラム等に関するものであり、特にタッチパネルを備える電子装置において実行されるプログラム等に関する。 The present invention relates to a program and the like, and more particularly to a program and the like executed in an electronic device having a touch panel.

近年のタッチパネル技術の向上に伴い、タッチパネル上のユーザインタフェースを介してユーザ入力を行う電子装置が広く普及してきた。そして、電子装置において実行されるゲームにおいては、従来型の物理的なコントローラによるユーザ入力に代えて、電子装置に備えられたタッチパネルを介してユーザ入力を行う形態が広く普及してきている。 With recent improvements in touch panel technology, electronic devices that perform user input via a user interface on a touch panel have become widespread. In games executed on electronic devices, a form in which user input is performed via a touch panel provided in the electronic device instead of user input using a conventional physical controller has become widespread.

特にスマートフォン等に代表される小型の携帯型電子装置の普及が急速に進み、このような携帯型電子装置上で実行されるゲームも数多くリリースされている。このような状況において、タッチパネルに表示されたプレイヤキャラクタなどの仮想オブジェクトの操作方法については、例えば非特許文献1に示すバーチャルパッドに関する技術を含め、様々な技術が提案されている。 In particular, small portable electronic devices such as smart phones have rapidly spread, and many games have been released to be executed on such portable electronic devices. Under such circumstances, various techniques have been proposed for operating a virtual object such as a player character displayed on a touch panel, including a technique relating to a virtual pad disclosed in Non-Patent Document 1, for example.

例えば特許文献1には、タッチパネルを備えるゲーム装置であって、ユーザのタッチ操作に応じて原点を設定してジョイスティックを模した操作を行うことができるゲーム装置やプログラムが開示されている。当該ゲーム装置は、タッチパネルがタッチを検出していない状態から検出した状態に変化した場合に検出を開始したときの座標に基づき基準座標を設定し、その後タッチ検出を継続する場合、その後に検出した座標に基づき指示座標を設定する。そして当該ゲーム装置は、基準座標から指示座標へのベクトルの方向がジョイスティックを倒している方向、ベクトルの大きさがジョイスティックの倒し具合と認識することで、仮想ジョイスティックを実現し、仮想オブジェクトの操作を実現している。 For example, Patent Literature 1 discloses a game apparatus having a touch panel, and a game apparatus and a program capable of setting an origin according to a user's touch operation and performing an operation simulating a joystick. The game device sets the reference coordinates based on the coordinates at the start of detection when the touch panel changes from a state in which the touch panel does not detect a touch to a state in which the touch panel detects a touch. Set the indicated coordinates based on the coordinates. The game device realizes a virtual joystick by recognizing that the direction of the vector from the reference coordinates to the designated coordinates is the direction in which the joystick is tilted, and the magnitude of the vector is the extent to which the joystick is tilted, thereby operating the virtual object. Realized.

特許第3734820号Patent No. 3734820

Matthias Baldauf, Peter Frohlich, Florence Adegeye, and Stefan Suette. 2015. Investigating On-Screen Gamepad Designs for Smartphone-Controlled Video Games. ACM Trans. Multimedia Comput. Commun. Appl. 12, 1s, Article 22 (October 2015), 21 pages. DOI: https://doi.org/10.1145/2808202Matthias Baldauf, Peter Frohlich, Florence Adegeye, and Stefan Suette. 2015. Investigating On-Screen Gamepad Designs for Smartphone-Controlled Video Games. ACM Trans. Multimedia Comput. pages. DOI: https://doi.org/10.1145/2808202

特許文献1に示す従来技術において、ユーザは、タッチパネル上の1箇所を指で接触してゲーム装置に基準座標を認識させ、接触したままその指をスライドさせ、スライド後の指の接触位置によりゲーム装置に指示座標を認識させる。このように構成される従来技術は、ユーザが方向を入力するとき、基準座標から指示座標まで有意な距離を生成する必要があるため、高い応答性を実現することは難しかった。例えばユーザが仮想ジョイスティックを大きく倒した操作を行いたい場合、大きく倒したジョイスティックの倒し具合に対応する基準座標から指示座標へのベクトルの大きさを生成する必要があった。 In the prior art disclosed in Patent Document 1, a user touches a point on a touch panel with a finger to cause the game device to recognize reference coordinates, slides the finger while in contact, and starts a game based on the contact position of the finger after sliding. Make the device recognize the indicated coordinates. With the conventional technology configured in this way, it is difficult to achieve high responsiveness because it is necessary to generate a significant distance from the reference coordinate to the indicated coordinate when the user inputs the direction. For example, when the user wants to perform an operation in which the virtual joystick is greatly tilted, it is necessary to generate the magnitude of the vector from the reference coordinates to the designated coordinates corresponding to the tilting degree of the joystick that has been tilted greatly.

したがって、タッチパネルに表示された、仮想空間上に配置された仮想オブジェクトを制御する操作方法として、例えばより高速で直感的な操作方法の実現が求められている。更に一般化すると、仮想空間内に配置され、ユーザの操作対象となりうるオブジェクトである操作対象オブジェクトを制御する操作方法として、より操作性の高い操作方法の実現が求められている。 Therefore, as an operation method for controlling a virtual object placed in a virtual space and displayed on a touch panel, there is a demand for realizing a faster and more intuitive operation method, for example. More generalized, there is a demand for an operation method with higher operability as an operation method for controlling an operation target object, which is an object that is placed in a virtual space and can be a user's operation target.

本発明は、このような課題を解決するためになされたものであり、仮想空間における操作対象オブジェクトを制御するにあたって、より操作性を高くすることが可能なプログラム等を提供することを主目的とする。 SUMMARY OF THE INVENTION The present invention has been made to solve such problems, and the main object thereof is to provide a program or the like that can improve operability when controlling an object to be manipulated in a virtual space. do.

上記の目的を達成するために、本発明の一態様としてのプログラムは、タッチパネルを備える電子装置において実行されるプログラムであって、該電子装置に、前記タッチパネルへのユーザの操作により発生したタッチイベントに基づいて取得される第1の軸の値及び第2の軸の値により示されるデータポイントを保持するステップと、前記保持されているデータポイントのうち既定の保持時間を超えたデータポイントの保持を終了するステップと、前記保持されているデータポイントに基づいて回帰直線の傾きを決定するステップと、前記保持されているデータポイントの集合としての変位方向に基づいて前記決定された回帰直線の傾きを回転させる回転量を決定するステップと、前記決定された回帰直線の傾き及び前記決定された回転量に基づいて、前記ユーザが仮想空間内の操作対象オブジェクトを制御するための角度を決定するステップと、を実行させることを特徴とする。 In order to achieve the above object, a program as one aspect of the present invention is a program executed in an electronic device having a touch panel, wherein the electronic device receives a touch event generated by a user's operation on the touch panel. holding data points indicated by a first axis value and a second axis value obtained based on and holding data points of said held data points that have exceeded a predetermined holding time determining the slope of a regression line based on the retained data points; and determining the slope of the determined regression line based on the displacement direction as a set of the retained data points. and determining an angle for the user to control the operation target object in the virtual space based on the determined slope of the regression line and the determined rotation amount. and is characterized by executing

また、本発明において好ましくは、前記回転量を決定するステップは、前記保持されているデータポイントにおける時系列的に前後するデータポイントの変位方向に基づいて、前記操作対象オブジェクトを制御するための角度を決定するにあたって、前記決定された傾きに対して180度回転させるか否かを示す回転量を決定する。 Further, in the present invention, preferably, the step of determining the amount of rotation includes determining an angle for controlling the operation target object based on displacement directions of data points that chronologically precede and follow in the held data points. is determined, a rotation amount indicating whether or not to rotate 180 degrees with respect to the determined inclination is determined.

また、本発明において好ましくは、記プログラムは、前記電子装置に、前記保持されているデータポイントにおける前記第1の軸の値の変位量及び前記第2の軸の値の変位量に基づいて、独立変数の軸として該第1の軸及び該第2の軸のいずれか一方の軸を決定するステップと、他方の軸を従属変数の軸として決定するステップと、を更に実行させ、前記回帰直線の傾きを決定するステップは、前記決定された独立変数の軸及び従属変数の軸に更に基づいて、回帰直線の傾きを決定する。 Also, preferably in the present invention, the program causes the electronic device to perform determining one of the first axis and the second axis as an axis of an independent variable; and determining the other axis as an axis of a dependent variable; The step of determining the slope of determines the slope of the regression line further based on the determined independent variable axis and dependent variable axis.

また、本発明において好ましくは、前記いずれか一方の軸を決定するステップは、前記保持されているデータポイントにおける、前記第1の軸の最大値と最小値の差分値及び前記第2の軸の最大値と最小値の差分値に基づいて、独立変数の軸として前記いずれか一方の軸を決定する。 In addition, preferably in the present invention, the step of determining one of the axes includes the difference value between the maximum value and the minimum value of the first axis and the difference value of the second axis in the retained data points. Based on the difference value between the maximum value and the minimum value, one of the axes is determined as the axis of the independent variable.

また、本発明において好ましくは、前記いずれか一方の軸を決定するステップは、前記保持されているデータポイントにおける、前記第1の軸の最大値と最小値の差分値に対して重み付けを行った値及び前記第2の軸の最大値と最小値の差分値の大きさを比較することにより、独立変数の軸として前記いずれか一方の軸を決定する。 Further, preferably in the present invention, the step of determining one of the axes weights the difference between the maximum value and the minimum value of the first axis in the retained data points. One of the axes is determined as the axis of the independent variable by comparing the values and the magnitude of the difference between the maximum and minimum values of the second axis.

また、本発明において好ましくは、前記回転量を決定するステップは、前記保持されているデータポイントにおける時系列的に前後する、前記決定された独立変数の軸の値の差分値の正負の数量を比較することにより、前記操作対象オブジェクトを制御するための角度を決定するにあたって、前記決定された回帰直線の傾きに対して180度回転させるか否かを示す回転量を決定する。 In addition, preferably in the present invention, the step of determining the amount of rotation includes determining the positive and negative quantities of the difference values of the determined axis values of the independent variables that chronologically change in the held data points. By the comparison, a rotation amount indicating whether or not to rotate the determined regression line by 180 degrees is determined in determining the angle for controlling the operation target object.

また、本発明において好ましくは、前記回帰直線の傾きを決定するステップは、前記保持されているデータポイントにおける、独立変数の平均及び従属変数の平均を決定するステップと、前記決定された平均を用いて、前記保持されているデータポイントにおける、独立変数の偏差及び従属変数の偏差を決定するステップと、前記決定された独立変数の偏差を用いて、前記保持されているデータポイントにおける独立変数の分散を決定するステップと、前記決定された独立変数の偏差及び従属変数の偏差を用いて、前記保持されているデータポイントにおける共分散を決定するステップと、前記決定された共分散を前記決定された独立変数の分散で割ることにより回帰直線の傾きを決定するステップと、を含む。 Also preferably in the present invention, the step of determining the slope of the regression line comprises determining the mean of the independent variable and the mean of the dependent variable in the retained data points; determining an independent variable deviation and a dependent variable deviation at the retained data points; using the determined independent variable deviations to determine the independent variable variance at the retained data points; using the determined independent variable deviations and dependent variable deviations to determine covariances at the retained data points; determining the slope of the regression line by dividing by the variance of the independent variable.

また、本発明において好ましくは、前記第1の軸は、前記タッチパネルのセンサが配列される方向の短手方向を示すX軸であり、前記第2の軸は、前記タッチパネルのセンサが配列される方向の長手方向を示し、前記第1の軸に直交するY軸であり、前記回帰直線の傾きを決定するステップは、前記決定された独立変数の軸が前記第2の軸である場合、前記決定された共分散を前記決定された独立変数の分散で割ることにより決定された回帰直線の傾きに対応する角度を、90度から引くことにより回帰直線の傾きを決定する。 Further, in the present invention, preferably, the first axis is an X-axis indicating a lateral direction of a direction in which the sensors of the touch panel are arranged, and the second axis is an X-axis along which the sensors of the touch panel are arranged. The Y-axis indicates the longitudinal direction and is orthogonal to the first axis, and the step of determining the slope of the regression line includes, if the determined axis of the independent variable is the second axis, the Determine the slope of the regression line by subtracting from 90 degrees the angle corresponding to the slope of the regression line determined by dividing the determined covariance by the determined variance of the independent variable.

また、本発明において好ましくは、前記第1の軸は、前記タッチパネルのセンサが配列される方向の短手方向を示すX軸であり、前記第2の軸は、前記タッチパネルのセンサが配列される方向の長手方向を示し、前記第1の軸に直交するY軸である。 Further, in the present invention, preferably, the first axis is an X-axis indicating a lateral direction of a direction in which the sensors of the touch panel are arranged, and the second axis is an X-axis along which the sensors of the touch panel are arranged. The Y-axis indicates the longitudinal direction of the direction and is orthogonal to the first axis.

また、本発明において好ましくは、前記角度を決定するステップは、既定の処理時間ごとに角度を決定する。 Also, in the present invention, preferably, the step of determining the angle determines the angle for each predetermined processing time.

また、上記の目的を達成するために、本発明の一態様としての一組のプログラムは、上記のプログラムを含む、前記タッチパネルを備える前記電子装置において実行されるゲームのための一組のプログラムであって、前記既定の処理時間は、ゲームを実行するためのフレームレートに対応する時間であり、前記既定の処理時間ごとに決定される角度に基づいて、前記既定の処理時間ごとに角度及び大きさを決定するステップと、前記既定の処理時間ごとに決定される角度及び大きさに基づいて、前記タッチパネルに表示される前記操作対象オブジェクトを制御するステップと、を実行させることを特徴とする。 Further, in order to achieve the above object, a set of programs as one aspect of the present invention is a set of programs for a game executed on the electronic device provided with the touch panel, including the above program. wherein the predetermined processing time is a time corresponding to a frame rate for executing the game, and based on an angle determined for each predetermined processing time, an angle and a size are determined for each predetermined processing time. and controlling the operation target object displayed on the touch panel based on the angle and size determined for each predetermined processing time.

また、上記の目的を達成するために、本発明の一態様としての一組のプログラムは、上記のプログラムを含む、前記タッチパネルを備える前記電子装置において実行されるゲームのための一組のプログラムであって、前記既定の処理時間は、ゲームを実行するためのフレームレートに対応する時間であり、前記既定の処理時間ごとに決定される角度に基づいて、前記既定の処理時間ごとに角度及び大きさを決定するステップと、前記既定の処理時間ごとに決定される角度及び大きさに基づいて、前記タッチパネルに表示されるゲーム画像を撮影するための前記操作対象オブジェクトである仮想カメラを制御するステップと、を実行させることを特徴とする。 Further, in order to achieve the above object, a set of programs as one aspect of the present invention is a set of programs for a game executed on the electronic device provided with the touch panel, including the above program. wherein the predetermined processing time is a time corresponding to a frame rate for executing the game, and based on an angle determined for each predetermined processing time, an angle and a size are determined for each predetermined processing time. and controlling a virtual camera, which is the operation target object for capturing a game image displayed on the touch panel, based on the angle and size determined for each predetermined processing time. and is characterized by executing

また、上記の目的を達成するために、本発明の一態様としての電子装置は、タッチパネルを備える電子装置であって、前記タッチパネルへのユーザの操作により発生したタッチイベントに基づいて取得される第1の軸の値及び第2の軸の値により示されるデータポイントを保持し、前記保持されているデータポイントのうち既定の保持時間を超えたデータポイントの保持を終了し、前記保持されているデータポイントに基づいて回帰直線の傾きを決定し、前記保持されているデータポイントの集合としての変位方向に基づいて前記決定された回帰直線の傾きを回転させる回転量を決定し、前記決定された回帰直線の傾き及び前記決定された回転量に基づいて、前記ユーザが仮想空間内の操作対象オブジェクトを制御するための角度を決定する、ことを特徴とする。 Further, in order to achieve the above object, an electronic device according to one aspect of the present invention is an electronic device including a touch panel, wherein a touch event is acquired based on a touch event generated by a user's operation on the touch panel. Retaining data points indicated by a value of one axis and a value of a second axis, terminating retention of data points exceeding a predetermined retention time among the retained data points, and determining a slope of a regression line based on the data points; determining an amount of rotation to rotate the determined slope of the regression line based on a displacement direction for the set of retained data points; An angle for the user to control the operation target object in the virtual space is determined based on the inclination of the regression line and the determined amount of rotation.

また、上記の目的を達成するために、本発明の一態様としての方法は、タッチパネルを備える電子装置において実行される方法であって、前記タッチパネルへのユーザの操作により発生したタッチイベントに基づいて取得される第1の軸の値及び第2の軸の値により示されるデータポイントを保持するステップと、前記保持されているデータポイントのうち既定の保持時間を超えたデータポイントの保持を終了するステップと、前記保持されているデータポイントに基づいて回帰直線の傾きを決定するステップと、前記保持されているデータポイントの集合としての変位方向に基づいて前記決定された回帰直線の傾きを回転させる回転量を決定するステップと、前記決定された回帰直線の傾き及び前記決定された回転量に基づいて、前記ユーザが仮想空間内の操作対象オブジェクトを制御するための角度を決定するステップと、を有することを特徴とする。 Further, in order to achieve the above object, a method according to one aspect of the present invention is a method executed in an electronic device having a touch panel, the method comprising: retaining data points indicated by the obtained first axis value and second axis value; and terminating retention of data points of said retained data points that have exceeded a predetermined retention time. determining a slope of a regression line based on the retained data points; and rotating the determined slope of the regression line based on a displacement direction as a set of the retained data points. determining an amount of rotation; and determining an angle for the user to control the operation target object in the virtual space based on the determined slope of the regression line and the determined amount of rotation. characterized by having

本発明によれば、仮想空間における操作対象オブジェクトを制御するにあたって、より操作性を高くすることができる。 According to the present invention, operability can be enhanced when controlling an operation target object in a virtual space.

本発明の一実施形態による電子装置のハードウェア構成を示すブロック図である。1 is a block diagram showing the hardware configuration of an electronic device according to an embodiment of the invention; FIG. 本発明の一実施形態による電子装置の機能ブロック図である。1 is a functional block diagram of an electronic device according to an embodiment of the invention; FIG. 本実施形態の第1の軸及び第2の軸からなる座標軸を示す図である。It is a figure which shows the coordinate axis which consists of the 1st axis of this embodiment, and the 2nd axis. 角度決定部が決定する角度と角度に対応する方向の一例を説明する図である。It is a figure explaining an example of the direction corresponding to the angle which an angle determination part determines, and an angle. 時間t1におけるデータポイントバッファが保持するデータポイントの一例を示す図である。FIG. 10 is a diagram showing an example of data points held by a data point buffer at time t1; 時間t1におけるデータポイントバッファが保持するデータポイントの一例を示す図である。FIG. 10 is a diagram showing an example of data points held by a data point buffer at time t1; 図5に示すデータポイントの集合から求めた回帰直線を示す図である。Figure 6 shows a regression line obtained from the set of data points shown in Figure 5; 図7に示す回帰直線の傾きを用いて関数aop(x,y)が算出した角度を示す図である。FIG. 8 is a diagram showing angles calculated by a function aop(x, y) using the slope of the regression line shown in FIG. 7; 時間t2におけるデータポイントバッファが保持するデータポイントの一例を示す図である。FIG. 10 is a diagram showing an example of data points held by a data point buffer at time t2; 図9に示す回帰直線の傾きを用いて関数aop(x,y)が算出した角度を示す図である。FIG. 10 is a diagram showing angles calculated by a function aop(x, y) using the slope of the regression line shown in FIG. 9; 時間t3におけるデータポイントバッファが保持するデータポイントの一例を示す図である。FIG. 10 is a diagram showing an example of data points held by a data point buffer at time t3; 時間t3におけるデータポイントバッファが保持するデータポイントの一例を示す図である。FIG. 10 is a diagram showing an example of data points held by a data point buffer at time t3; 図11に示すデータポイントの集合から求めた回帰直線及び該回帰直線の傾きを用いて関数aop(x,y)が算出した角度を示す図である。FIG. 12 is a diagram showing an angle calculated by a function aop(x, y) using a regression line obtained from the set of data points shown in FIG. 11 and the slope of the regression line; 時間t4におけるデータポイントバッファが保持するデータポイントの一例を示す図である。FIG. 10 is a diagram showing an example of data points held by the data point buffer at time t4; 時間t4におけるデータポイントバッファが保持するデータポイントの一例を示す図である。FIG. 10 is a diagram showing an example of data points held by the data point buffer at time t4; 図14に示すデータポイントの集合から求めた回帰直線を示す図である。FIG. 15 shows a regression line obtained from the set of data points shown in FIG. 14; 図16に示す回帰直線の傾きを用いて関数aop(x,y)が算出した角度を示す図である。FIG. 17 is a diagram showing angles calculated by a function aop(x, y) using the slope of the regression line shown in FIG. 16; 本発明の一実施形態による電子装置がデータポイントの集合から仮想キャラクタを制御する様子を示す図である。FIG. 4 illustrates an electronic device controlling a virtual character from a set of data points according to one embodiment of the invention; 本発明の一実施形態による角度決定部の情報処理のフローチャートを示す図である。It is a figure which shows the flowchart of the information processing of the angle determination part by one Embodiment of this invention. 本発明の一実施形態による電子装置が表示する画像を撮影する仮想空間内に配置された仮想カメラを示す図である。FIG. 2 illustrates a virtual camera placed in a virtual space capturing an image displayed by an electronic device according to an embodiment of the present invention;

以下、図面を参照して、本発明の実施形態を説明する。各図において同一の符号は、特に言及が無い限り同一又は相当部分を示すものとし、説明の便宜上、図面の縦横の縮尺を実際のものとは異なるように表す場合がある。また、説明の便宜上、必要以上に詳細な説明は省略する場合がある。例えば、既によく知られた事項の詳細説明や実質的に同一の構成についての重複説明を省略する場合がある。 Hereinafter, embodiments of the present invention will be described with reference to the drawings. The same reference numerals in each drawing indicate the same or corresponding parts unless otherwise specified, and for convenience of explanation, the vertical and horizontal scales of the drawings may be different from the actual ones. Further, for convenience of explanation, more detailed explanation than necessary may be omitted. For example, detailed descriptions of already well-known matters and redundant descriptions of substantially the same configurations may be omitted.

本発明の一実施形態による電子装置10は、仮想空間に配置された仮想的なオブジェクトをユーザに提示し、ゲームを進行するゲームアプリケーションがインストールされている。本実施形態の電子装置10は、当該ゲームアプリケーションが実行されると、ユーザの操作に応じて、仮想空間内のユーザの操作対象の仮想的なオブジェクトである操作対象オブジェクトを制御するための仮想的なコントローラ(仮想コントローラ)を提供する。仮想空間は、当該ゲームアプリケーションにより定められるものであり、2次元空間であることもできるし、3次元空間であることもできる。例えば、仮想的なオブジェクトは、仮想空間に配置されたキャラクタ又はアイテムである。例えば、操作対象オブジェクトの制御とは、仮想空間に配置されたキャラクタ又はアイテムの動作の制御である。 The electronic device 10 according to an embodiment of the present invention is installed with a game application that presents virtual objects arranged in a virtual space to the user and progresses the game. When the game application is executed, the electronic device 10 of the present embodiment is a virtual virtual machine for controlling an operation target object, which is a virtual object to be operated by the user in the virtual space, in accordance with the user's operation. provides a simple controller (virtual controller). The virtual space is defined by the game application, and can be a two-dimensional space or a three-dimensional space. For example, a virtual object is a character or item placed in virtual space. For example, control of the operation target object is control of actions of characters or items placed in the virtual space.

説明の便宜上、本実施形態においては、電子装置10には上記のようなゲームアプリケーションがインストールされているものとするが、これに限定されない。電子装置10は、ユーザの操作に応じて、操作対象オブジェクトを制御することが可能なアプリケーションを実装していればよい。例えば、電子装置10には、ゲームアプリケーションの代わりに又はこれに追加して、ユーザの操作に応じて操作対象オブジェクトを動作させる入力支援アプリケーション又はシミュレーションアプリケーションが実装されてもよい。本実施形態の電子装置10が提供する仮想コントローラは、ユーザの入力として方向と大きさが必要な入力に用いることができる。以下の説明において、アプリケーションは、アプリケーションプログラム全般を意味するものであり、スマートフォンやタブレット端末にインストールされるアプリを意味することができる。 For convenience of explanation, in the present embodiment, it is assumed that the game application as described above is installed in the electronic device 10, but the present invention is not limited to this. The electronic device 10 may be equipped with an application capable of controlling an operation target object in accordance with a user's operation. For example, instead of or in addition to the game application, the electronic device 10 may be implemented with an input support application or a simulation application that causes an operation target object to move according to a user's operation. The virtual controller provided by the electronic device 10 of the present embodiment can be used for user input that requires direction and magnitude. In the following description, applications mean application programs in general, and can mean applications installed on smartphones and tablet terminals.

図1は本発明の一実施形態による電子装置10のハードウェア構成を示すブロック図である。電子装置10は、プロセッサ11、入力装置12、表示装置13、記憶装置14、及び通信装置15を備える。これらの各構成装置はバス16によって接続される。なお、バス16と各構成装置との間には必要に応じてインタフェースが介在しているものとする。本実施形態において、電子装置10はスマートフォンである。ただし、電子装置10は、上記の構成を備えるものであれば、タブレット型コンピュータ、タッチパッド等の接触型入力装置を備えるコンピュータなどの端末とすることができる。 FIG. 1 is a block diagram showing the hardware configuration of an electronic device 10 according to one embodiment of the invention. The electronic device 10 comprises a processor 11 , an input device 12 , a display device 13 , a storage device 14 and a communication device 15 . Each of these components are connected by a bus 16 . It is assumed that an interface is interposed between the bus 16 and each constituent device as required. In this embodiment, the electronic device 10 is a smart phone. However, the electronic device 10 can be a terminal such as a tablet computer or a computer equipped with a contact input device such as a touch pad as long as it has the above configuration.

プロセッサ11は、電子装置10全体の動作を制御する。例えばプロセッサ11は、CPUである。なお、プロセッサ11としては、MPU等の電子回路が用いられてもよい。プロセッサ11は、記憶装置14に格納されているプログラムやデータを読み込んで実行することにより、様々な処理を実行する。1つの例では、プロセッサ11は、複数のプロセッサから構成される。 Processor 11 controls the overall operation of electronic device 10 . For example, processor 11 is a CPU. Note that an electronic circuit such as an MPU may be used as the processor 11 . The processor 11 performs various processes by reading and executing programs and data stored in the storage device 14 . In one example, processor 11 is comprised of multiple processors.

入力装置12は、電子装置10に対するユーザからの入力を受け付けるユーザインタフェースであり、例えば、タッチパネル、タッチパッド、キーボード、又はマウスである。表示装置(ディスプレイ)13は、プロセッサ11の制御に従って、アプリケーション画面などを電子装置10のユーザに表示する。本実施形態においては、スマートフォンである電子装置10は入力装置12としてタッチパネル17を備え、タッチパネル17は表示装置13としても機能し、入力装置12と表示装置13は一体となった構造である。本実施形態のタッチパネル17は、投影型静電容量方式タッチパネルであるが、同等の機能を有するデバイスがあれば、それを用いてもよい。 The input device 12 is a user interface that receives input from the user to the electronic device 10, and is, for example, a touch panel, touch pad, keyboard, or mouse. A display device (display) 13 displays application screens and the like to the user of the electronic device 10 under the control of the processor 11 . In this embodiment, the electronic device 10, which is a smartphone, includes a touch panel 17 as the input device 12, the touch panel 17 also functions as the display device 13, and the input device 12 and the display device 13 are integrated. The touch panel 17 of this embodiment is a projected capacitive touch panel, but if there is a device having equivalent functions, it may be used.

記憶装置14は、揮発性メモリであるRAM及び不揮発性メモリであるROMを含む、一般的なスマートフォンが備える記憶装置である。記憶装置14は、外部メモリを含むこともできる。記憶装置14は、ゲームアプリケーションを含む各種プログラムを記憶する。例えば、記憶装置14は、オペレーティングシステム(OS)、ミドルウェア、アプリケーションプログラム、これらのプログラムの実行に伴って参照され得る各種データなどを格納する。 The storage device 14 is a storage device included in a general smart phone, including a RAM that is a volatile memory and a ROM that is a nonvolatile memory. Storage device 14 may also include external memory. The storage device 14 stores various programs including game applications. For example, the storage device 14 stores an operating system (OS), middleware, application programs, and various data that can be referred to during the execution of these programs.

1つの例では、記憶装置14は、主記憶装置及び補助記憶装置を含む。主記憶装置は、情報の高速な読み書きが可能な揮発性の記憶媒体であり、プロセッサ11が情報を処理する際の記憶領域及び作業領域として用いられる。補助記憶装置は、様々なプログラムや、各プログラムの実行に際してプロセッサ11が使用するデータを格納する。補助記憶装置は、例えばハードディスク装置であるが、情報を格納できるものであればいかなる不揮発性ストレージ又は不揮発性メモリであってもよく、着脱可能なものであっても構わない。 In one example, memory device 14 includes primary memory and secondary memory. The main memory is a volatile storage medium from which information can be read and written at high speed, and is used as a storage area and work area when the processor 11 processes information. The auxiliary storage stores various programs and data used by the processor 11 when executing each program. The auxiliary storage device is, for example, a hard disk device, but may be any nonvolatile storage or nonvolatile memory that can store information, and may be removable.

通信装置15は、ネットワークを介してサーバなどの他のコンピュータとの間でデータの授受を行う。例えば通信装置15は、移動体通信や無線LAN等の無線通信を行い、ネットワークへ接続する。1つの例では、電子装置10は、通信装置15によってプログラムをサーバからダウンロードして、記憶装置14に格納する。ただし、通信装置15は既知の有線通信を行ってもよい。他のコンピュータとの間でデータの送受信を行わない場合、電子装置10は通信装置15を備えなくてもよい。 The communication device 15 exchanges data with another computer such as a server via a network. For example, the communication device 15 performs wireless communication such as mobile communication and wireless LAN, and connects to a network. In one example, electronic device 10 downloads a program from a server via communication device 15 and stores it in storage device 14 . However, the communication device 15 may perform known wired communication. The electronic device 10 does not have to include the communication device 15 if data is not transmitted/received to/from another computer.

図2は本発明の一実施形態による電子装置10の機能ブロック図である。電子装置10は、入力部21、表示部22、及び制御部23を備える。制御部23は、角度決定部24、状態決定部25、及びアプリケーション部26を備える。本実施形態においては、プログラムがプロセッサ11により実行されることによりこれらの機能が実現される。例えば実行されるプログラムは、記憶装置14に記憶されている又は通信装置15を介して受信したプログラムである。このように、各種機能がプログラム読み込みにより実現されるため、1つのパート(機能)の一部又は全部を他のパートが有していてもよい。ただし、各機能の一部又は全部を実現するための電子回路等を構成することによりハードウェアによってもこれらの機能は実現してもよい。 FIG. 2 is a functional block diagram of electronic device 10 according to one embodiment of the present invention. The electronic device 10 includes an input section 21 , a display section 22 and a control section 23 . The control unit 23 includes an angle determination unit 24 , a state determination unit 25 and an application unit 26 . In this embodiment, these functions are realized by executing a program by the processor 11 . For example, the program to be executed is a program stored in storage device 14 or received via communication device 15 . In this way, since various functions are realized by program loading, one part (function) may be partly or wholly included in another part. However, these functions may also be realized by hardware by configuring an electronic circuit or the like for realizing part or all of each function.

入力部21は、入力装置12を用いて構成されるものであり、電子装置10に対するユーザからの入力を受け付ける。本実施形態では、入力部21は、タッチパネル17へのユーザのタッチ操作を受け付けてタッチイベントを発生するものであり、タッチパネル17を備えるスマートフォンが一般的に有しているタッチ検出機能を用いることができる。 The input unit 21 is configured using the input device 12 and receives input from the user to the electronic device 10 . In the present embodiment, the input unit 21 receives a user's touch operation on the touch panel 17 and generates a touch event. can.

表示部22は、ゲームアプリケーション画面を表示装置13に表示し、ユーザ操作に応じた画面を表示する。 The display unit 22 displays a game application screen on the display device 13, and displays a screen corresponding to a user's operation.

制御部23は、仮想コントローラを実現するものである。本実施形態では、制御部23は3層構造のアーキテクチャを採用し、角度決定部24、状態決定部25、及びアプリケーション部26が各層に対応する。例えば制御部23は、各層に対応する各プログラムにより構成される一組のプログラムがプロセッサ11により実行されることにより実現される。 The control unit 23 implements a virtual controller. In this embodiment, the control unit 23 employs a three-layered architecture, and the angle determination unit 24, the state determination unit 25, and the application unit 26 correspond to each layer. For example, the control unit 23 is implemented by the processor 11 executing a set of programs each program corresponding to each layer.

制御部23が実現する仮想コントローラにおける角度決定部24の役割は、物理的なコントローラにおけるコントローラ内部のセンサICチップに対応する。角度決定部24は、主として、タッチパネル17へのユーザのタッチ操作により発生したタッチイベントを用いてユーザが仮想空間内の操作対象オブジェクトを制御するための角度を決定し、状態決定部25へ送出する。 The role of the angle determination unit 24 in the virtual controller realized by the control unit 23 corresponds to the sensor IC chip inside the controller in the physical controller. The angle determination unit 24 mainly determines an angle for the user to control the operation target object in the virtual space by using a touch event generated by the user's touch operation on the touch panel 17 , and sends the angle to the state determination unit 25 . .

状態決定部25の役割は、物理的なコントローラにおける操作するコントローラ全体に対応する。状態決定部25は、主として、角度決定部24から送出された角度を用いて、タッチパネル17上のユーザのタッチ操作に対応するベクトル(角度及び大きさ)を決定し、アプリケーション部26へ送出する。 The role of the state determination unit 25 corresponds to the overall controller to be operated in the physical controller. The state determination unit 25 mainly uses the angle sent from the angle determination unit 24 to determine a vector (angle and magnitude) corresponding to the user's touch operation on the touch panel 17 and sends it to the application unit 26 .

アプリケーション部26は、ゲーム内の動作等を実装する、具体的なゲームアプリケーションに対応する。ゲームアプリケーションは、一般的なゲームアプリケーションと同様にして、フレームレートが定められ、例えばフレームレートに対応する時間ごとに、メインプログラムのメインループを処理する。フレームレートは、一般的に30fps(フレーム毎秒)又は60fpsである。 The application unit 26 corresponds to a specific game application that implements in-game actions and the like. A game application has a frame rate determined in the same manner as a general game application, and processes the main loop of the main program, for example, every time corresponding to the frame rate. The frame rate is typically 30 fps (frames per second) or 60 fps.

角度決定部24は、ユーザが仮想空間内の操作対象オブジェクトを制御するために必要な角度を決定する。1つの好適な例では、角度決定部24は、リアルタイムに角度を計算する数学関数ライブラリであり、かつ短時間のタッチイベントの列からの角度計算を行う、統計処理アルゴリズムを実装する、ソフトウェアモジュールである。タッチイベントの列は、タッチパネル17上の指の動きに対応するものである。 The angle determination unit 24 determines an angle necessary for the user to control the operation target object in the virtual space. In one preferred example, angle determiner 24 is a software module that is a library of mathematical functions that computes angles in real time and that implements statistical processing algorithms that compute angles from a sequence of short duration touch events. be. A column of touch events corresponds to finger movements on the touch panel 17 .

記憶装置14は、データポイントバッファを含む。データポイントバッファは、角度決定部24がタッチイベントに基づいて取得される第1の軸の値及び第2の軸の値により示されるデータポイントを保持するためのバッファである。 Storage device 14 includes a data point buffer. The data point buffer is a buffer for holding data points indicated by the first axis value and the second axis value obtained by the angle determination unit 24 based on the touch event.

角度決定部24は、タッチパネル17へのユーザの操作により発生したタッチイベントに基づいて取得される第1の軸の値及び第2の軸の値により示されるデータポイントをデータポイントバッファに保持する。ここで、タッチイベントは、ユーザがタッチパネル17へ指を接触したとき(touchstart)、ユーザがタッチパネル17に指を接触させたまま動かしたとき(touchmove)、ユーザがタッチパネル17から指を離したとき(touchend)などに発生する。角度決定部24は、タッチイベントが発生するときに、タッチイベントを取得する。角度決定部24は、タッチイベントを取得するとき、タッチパネル17上の静電容量が変化した位置に対応する、2つの変数からなる数値の組(x、y)を取得するとともに、(x、y)を取得した時間tを取得し、3つの変数からなる数値の組(x、y、t)をデータポイントバッファに格納する。当該2つの変数からなる数値の組のデータは、タッチイベントに付随して角度決定部24が取得するものであり、第1の軸の値及び第2の軸の値により示されるデータポイントに対応するものである。tは(x、y)を取得した時間であるデータポイント取得時間を表す値であり、上記のように(x、y)と対応付けられてデータポイントバッファに格納される。1つの例では、tは、OSから取得可能な、いわゆるUNIX(登録商標)時間と呼ばれる整数値であるか、又は”2017/07/14 15:48:43.444”のような文字列である。以下、特に言及が無い限り、角度決定部24がデータポイントを保持する(又は保持を終了する)ことは、該データポイントに対応付けられたデータポイント取得時間tを保持する(又は保持を終了する)ことを含む。 The angle determination unit 24 holds data points indicated by the first axis value and the second axis value acquired based on the touch event generated by the user's operation on the touch panel 17 in the data point buffer. Here, the touch events are when the user touches the touch panel 17 with the finger (touchstart), when the user moves the finger while touching the touch panel 17 (touchmove), and when the user releases the finger from the touch panel 17 (touchstart). touchend), etc. The angle determination unit 24 acquires the touch event when the touch event occurs. When acquiring a touch event, the angle determination unit 24 acquires a set of numerical values (x, y) consisting of two variables corresponding to the position on the touch panel 17 where the capacitance changes, and (x, y ) and store the triplet of numerical values (x, y, t) in the data point buffer. The data of the numerical value set consisting of the two variables is obtained by the angle determination unit 24 accompanying the touch event, and corresponds to the data points indicated by the values on the first axis and the values on the second axis. It is something to do. t is a value representing the data point acquisition time, which is the time at which (x, y) is acquired, and is stored in the data point buffer in association with (x, y) as described above. In one example, t is an integer value called UNIX time, which can be obtained from the OS, or a character string such as "2017/07/14 15:48:43.444". Hereinafter, unless otherwise specified, holding (or ending holding) of a data point by the angle determination unit 24 means holding (or ending holding) the data point acquisition time t associated with the data point. ).

本実施形態では、説明の便宜上、第1の軸及び第2の軸を以下のとおり定める。図3は、本実施形態の第1の軸及び第2の軸からなる座標軸を示す図である。第1の軸は、タッチパネル17のセンサが配列される方向に実質的に平行な方向のうちの短手方向を示す軸であり、タッチパネル17の短辺と実質的に平行な横軸(x軸)である。第2の軸は、第1の軸に直交し、タッチパネル17のセンサが配列される方向に実質的に平行な方向のうちの長手方向を示す軸であり、タッチパネル17の長辺と実質的に平行な縦軸(y軸)である。このように、第1の軸及び第2の軸は、タッチパネル17のセンサが配列される方向に実質的に平行であり、タッチパネル17上の位置は、2つの軸により座標(x、y)として表される。したがって、本実施形態では、データポイントの座標(x、y)は、タッチパネル17上の位置に対応する。本実施形態では、角度決定部24は、当該座標(x、y)を、データポイントとしてデータポイントバッファに保持する。図3に示す座標設定は、一例であり、タッチパネル17のセンサ配列や電子装置10が実装するプログラムにより、上記例示と異なるように設定することができる。なお、センサは、例えば電極である。 In this embodiment, for convenience of explanation, the first axis and the second axis are defined as follows. FIG. 3 is a diagram showing coordinate axes consisting of the first axis and the second axis of this embodiment. The first axis is an axis that indicates the short side of the directions substantially parallel to the direction in which the sensors of the touch panel 17 are arranged, and the horizontal axis (x-axis) that is substantially parallel to the short sides of the touch panel 17. ). The second axis is orthogonal to the first axis and indicates the longitudinal direction of the directions substantially parallel to the direction in which the sensors of the touch panel 17 are arranged. Parallel vertical axis (y-axis). Thus, the first axis and the second axis are substantially parallel to the direction in which the sensors of the touch panel 17 are arranged, and a position on the touch panel 17 is defined by the two axes as coordinates (x, y). expressed. Therefore, in this embodiment, the coordinates (x, y) of the data point correspond to the position on touch panel 17 . In this embodiment, the angle determining unit 24 holds the coordinates (x, y) as data points in the data point buffer. The coordinate setting shown in FIG. 3 is an example, and can be set differently from the above example depending on the sensor arrangement of the touch panel 17 and the program implemented by the electronic device 10 . In addition, the sensor is, for example, an electrode.

図4は、図3に示すように座標軸が定められた場合の、角度決定部24が決定する角度と角度に対応する方向の一例を説明する図である。第一象限の角度31は方向32に対応し、第二象限の角度33は方向34に対応し、第四象限の角度35は方向36に対応する。ここで、方向34と方向36の傾きは同じであるが、方向の向きが逆であるため、角度33と角度35は180度異なることが確認できる。 FIG. 4 is a diagram illustrating an example of the angle determined by the angle determination unit 24 and the direction corresponding to the angle when the coordinate axes are determined as shown in FIG. Angle 31 in the first quadrant corresponds to direction 32 , angle 33 in the second quadrant corresponds to direction 34 , and angle 35 in the fourth quadrant corresponds to direction 36 . Here, it can be confirmed that the angles 33 and 35 differ by 180 degrees because the direction 34 and the direction 36 have the same inclination but the directions are opposite to each other.

角度決定部24は、データポイントバッファに保持されているデータポイントのうち既定の保持時間を超えたデータポイントの保持を終了する。例えば、角度決定部24は、データポイントのデータの保持を終了する場合、該データを削除してもよいし、該データを無効化してもよいし、又は該データに保持を終了したことを示すフラグを関連付けて適宜削除するようにしてもよい。角度決定部24は、データポイントバッファに格納するデータポイントの寿命をミリ秒で指定する変数Dを定める。変数Dにより指定される時間が既定の保持時間に対応する。ただし、変数Dの値はミリ秒に限定されない。 The angle determining unit 24 terminates holding data points that have exceeded a predetermined holding time among the data points held in the data point buffer. For example, when the angle determination unit 24 ends holding data of a data point, the angle determination unit 24 may delete the data, invalidate the data, or indicate in the data that the holding has ended. A flag may be associated and deleted as appropriate. The angle determiner 24 defines a variable D that specifies the lifetime in milliseconds of the data points stored in the data point buffer. The time specified by variable D corresponds to the default holding time. However, the value of variable D is not limited to milliseconds.

例えば、角度決定部24は、1つのデータポイントをデータポイントバッファに格納すると、該データポイントの格納されてからの経過時間を監視し、継続的に変数Dと比較する。角度決定部24は、監視したデータポイントの経過時間が変数Dを超えたとき、該データポイントをデータポイントバッファの保持を終了する。このようにして、角度決定部24は、データポイントバッファが保持するすべてのデータポイントの各々の寿命を管理する。このとき、角度決定部24は、データポイント取得時間tを用いて、経過時間を算出することができる。なお、変数Dを超えたと判断したときは、変数D以上と判断したときを意味することができるものとする。また、角度決定部24が管理するデータポイントの経過時間の単位は、変数Dと同じであることが好ましい。 For example, when the angle determiner 24 stores a data point in the data point buffer, it monitors the elapsed time since the data point was stored and continuously compares it with the variable D. When the elapsed time of the monitored data point exceeds the variable D, the angle determination unit 24 stops holding the data point in the data point buffer. In this way, angle determiner 24 manages the lifetime of each of all data points held by the data point buffer. At this time, the angle determination unit 24 can calculate the elapsed time using the data point acquisition time t. It should be noted that when it is determined that the variable D has been exceeded can mean when it is determined that the variable D is exceeded. Moreover, it is preferable that the unit of the elapsed time of the data points managed by the angle determination unit 24 is the same as that of the variable D.

例えば、変数Dに165が設定されたとき、角度決定部24は、データポイントバッファに格納したデータポイントを165ミリ秒だけ保持し、165ミリ秒が経過すると、該データポイントをデータポイントバッファの保持を終了する。 For example, when the variable D is set to 165, the angle determining unit 24 holds the data point stored in the data point buffer for 165 milliseconds, and after 165 milliseconds has passed, the data point is stored in the data point buffer. exit.

角度決定部24は、定期的に角度を算出できるか否かを判定する。角度決定部24は、角度を算出可能な場合、データポイントバッファが保持するデータポイントを用いて、該データポイントの集合が示す角度を算出し、ユーザが仮想空間内の操作対象オブジェクトを制御するための角度として決定する。このように、角度決定部24は、データポイントの集合が示す角度を求めることにより、タッチパネル17に対してタッチ操作を行ったユーザが意図する方向の角度を求めることが可能となる。 The angle determination unit 24 periodically determines whether or not the angle can be calculated. If the angle can be calculated, the angle determining unit 24 uses the data points held by the data point buffer to calculate the angle indicated by the set of data points, so that the user can control the operation target object in the virtual space. is determined as the angle of In this way, the angle determination unit 24 can determine the angle of the direction intended by the user who performed the touch operation on the touch panel 17 by obtaining the angle indicated by the set of data points.

角度決定部24は、決定した角度を状態決定部25へ出力する。角度決定部24は、決定した角度を状態決定部25へ出力するとき、例えばangleイベントを示す情報とともに出力する。角度決定部24は、状態決定部25へ直接出力せずに、状態決定部25が参照する記憶装置14内のメモリ領域に決定した角度やangleイベントを示す情報を格納してもよい。 Angle determination unit 24 outputs the determined angle to state determination unit 25 . When outputting the determined angle to the state determining unit 25, the angle determining unit 24 outputs it together with information indicating an angle event, for example. The angle determination unit 24 may store information indicating the determined angle or angle event in a memory area in the storage device 14 to which the state determination unit 25 refers without directly outputting to the state determination unit 25 .

角度決定部24は、取得したタッチイベントがtouchstartのとき、startイベントを状態決定部25へ出力し、角度を算出しない。角度決定部24は、取得したタッチイベントがtouchendのとき、stopイベントを状態決定部25へ出力し、角度を算出しない。 When the acquired touch event is touchstart, the angle determination unit 24 outputs the start event to the state determination unit 25 and does not calculate the angle. When the acquired touch event is touchend, the angle determination unit 24 outputs a stop event to the state determination unit 25 and does not calculate the angle.

角度決定部24は、変数Bを定め、データポイントバッファが保持するデータポイントの個数が変数Bの数以上であった場合、該データポイントを用いて角度を算出し、決定する。角度決定部24は、データポイントバッファが保持するデータポイントの個数が変数Bの数未満であった場合、データポイントの集合が示す角度を一定の精度以上で算出することが不可能であるため、keepイベントを状態決定部25へ出力し、角度を算出しない。一般的には、回帰直線の傾きを求めるにあたっては3個以上のデータポイントが有ること好ましいため、変数Bは3以上に設定されるのが好ましい。本実施形態では、変数Bは3に設定される。 The angle determining unit 24 determines a variable B, and when the number of data points held by the data point buffer is equal to or greater than the number of the variable B, uses the data points to calculate and determine an angle. If the number of data points held by the data point buffer is less than the number of variables B, the angle determination unit 24 cannot calculate the angle indicated by the set of data points with a certain accuracy or more. A keep event is output to the state determination unit 25 and the angle is not calculated. In general, it is preferable to have 3 or more data points when determining the slope of the regression line, so variable B is preferably set to 3 or more. Variable B is set to 3 in this embodiment.

角度決定部24は、角度決定部24が角度を算出できるか否かを判定する時間の間隔をミリ秒で指定する変数Iを定める。タッチイベントが発生し続ける場合など、角度決定部24が角度を算出可能な場合が継続する場合、当該間隔は、角度決定部24が角度を算出する時間の間隔となる。ただし、変数Iの値はミリ秒に限定されない。 The angle determination unit 24 defines a variable I that specifies a time interval in milliseconds for determining whether the angle determination unit 24 can calculate the angle. When the angle determination unit 24 can continue to calculate the angle, such as when touch events continue to occur, the interval is the time interval for the angle determination unit 24 to calculate the angle. However, the value of variable I is not limited to milliseconds.

角度決定部24は、上記のように既定の処理時間ごとに角度算出可否について判定し、既定の処理時間ごとに角度を決定する。1つの好適な例では、既定の処理時間は、ゲームを実行するためのフレームレートに対応する時間である。フレームレートが30fps(30Hz)の場合、変数Iは33に設定される。変数Iに33が設定されたとき、角度決定部24は、33ミリ秒に1回角度を算出できるか判定し、角度を算出可能な場合は算出した角度を決定し、決定した角度をangleイベントとともに状態決定部25へ出力する。算出不可能な場合、角度決定部24は、startイベント、stopイベント、又はkeepイベントのいずれか1つを状態決定部25へ出力する。なお、angleイベントは角度を示す情報を含むことができ、この場合、角度決定部24は、角度を算出可能な場合、angleイベントを状態決定部25へ出力する。 As described above, the angle determination unit 24 determines whether or not the angle can be calculated for each predetermined processing time, and determines the angle for each predetermined processing time. In one preferred example, the default processing time is the time corresponding to the frame rate for running the game. Variable I is set to 33 if the frame rate is 30 fps (30 Hz). When the variable I is set to 33, the angle determining unit 24 determines whether the angle can be calculated once every 33 milliseconds, determines the calculated angle if the angle can be calculated, and sends the determined angle to the angle event. together with the output to the state determination unit 25 . If the calculation is not possible, the angle determination unit 24 outputs any one of the start event, stop event, and keep event to the state determination unit 25 . The angle event can include information indicating an angle. In this case, the angle determination unit 24 outputs the angle event to the state determination unit 25 when the angle can be calculated.

データポイントバッファが保持するデータポイントの集合が示す角度を算出するにあたって、角度決定部24は、データポイントバッファに保持されているデータポイントに基づいて回帰直線の傾きを決定する。ここで、角度決定部24が参照するデータポイントの個数は、3以上である。角度決定部24は、回帰直線の傾きを決定するにあたって、データポイントバッファに保持されているデータポイントにおけるx軸の値の変位量及びy軸の値の変位量に基づいて、独立変数の軸としてx軸及びy軸のいずれか一方の軸を決定する。同時に、角度決定部24は、他方の軸を従属変数の軸として決定する。 In calculating the angle indicated by the set of data points held in the data point buffer, the angle determination unit 24 determines the slope of the regression line based on the data points held in the data point buffer. Here, the number of data points referred to by the angle determination unit 24 is 3 or more. In determining the slope of the regression line, the angle determination unit 24 determines the axis of the independent variable based on the amount of displacement of the x-axis value and the amount of displacement of the y-axis value at the data points held in the data point buffer. Determine one of the x-axis and y-axis. At the same time, the angle determination unit 24 determines the other axis as the axis of the dependent variable.

本実施形態では、角度決定部24は、最小二乗法を用いて回帰直線の傾きを算出する。最小二乗法を用いて回帰直線の傾きを求める方法は既知であるが、当該方法は独立変数と従属変数の関係の強さを傾きとして求めるものである。最小二乗法は、x軸を独立変数の軸とし、y軸を従属変数の軸として適用するのが一般的であるが、x軸の値が固定されてy軸の値のみが変化する場合、従属変数が独立変数に一切の従属性を持たないことになる。また、y軸に沿った傾きを決定する場合、決定される傾きは、例えばy軸をまたいで大きなマイナスの値から大きなプラスの値となることがあり、安定して傾きを出すことが難しい。そのため、角度決定部24は、x軸の値とy軸の値のどちらが独立変数として適切であるかを判定し、決定された独立変数の軸及び従属変数の軸に基づいて最小二乗法を用いて回帰直線の傾きを決定する。 In this embodiment, the angle determining unit 24 calculates the slope of the regression line using the method of least squares. A method of obtaining the slope of a regression line using the method of least squares is known, but this method obtains the strength of the relationship between the independent variable and the dependent variable as the slope. The method of least squares is generally applied with the x-axis as the axis of the independent variable and the y-axis as the axis of the dependent variable. The dependent variable will have no dependence on the independent variable. Also, when determining the tilt along the y-axis, the determined tilt may change from a large negative value to a large positive value across the y-axis, and it is difficult to stably determine the tilt. Therefore, the angle determination unit 24 determines which of the x-axis value and the y-axis value is appropriate as the independent variable, and uses the least squares method based on the determined independent variable axis and dependent variable axis. determines the slope of the regression line.

角度決定部24は、独立変数の軸をx軸とするとき、y=ax+bの回帰直線の傾きaを決定し、独立変数の軸をy軸とするとき、x=cy+dの回帰直線の傾きcを決定する。具体的には、角度決定部24は、以下の(a)~(e)により回帰直線の傾きを求める。
(a)角度決定部24は、データポイントバッファに保持されているデータポイントにおける、独立変数の平均及び従属変数の平均を算出(決定)する。
(b)角度決定部24は、(a)で決定された平均を用いて、データポイントバッファに保持されているデータポイントにおける、独立変数の偏差及び従属変数の偏差を算出(決定)する。
(c)角度決定部24は、(b)で決定された独立変数の偏差を用いて、データポイントバッファに保持されているデータポイントにおける独立変数の分散を算出(決定)する。
(d)角度決定部24は、(b)で決定された独立変数の偏差及び従属変数の偏差を用いて、データポイントバッファに保持されているデータポイントにおける共分散を算出(決定)する。
(e)角度決定部24は、(d)で決定された共分散を(c)で決定された独立変数の分散で割ることにより回帰直線の傾きを算出(決定)する。
The angle determination unit 24 determines the slope a of the regression line of y=ax+b when the axis of the independent variable is the x-axis, and the slope c of the regression line of x=cy+d when the axis of the independent variable is the y-axis. to decide. Specifically, the angle determining unit 24 obtains the slope of the regression line by the following (a) to (e).
(a) The angle determining unit 24 calculates (determines) the average of the independent variables and the average of the dependent variables in the data points held in the data point buffer.
(b) The angle determination unit 24 uses the averages determined in (a) to calculate (determine) the independent variable deviation and the dependent variable deviation for the data points held in the data point buffer.
(c) The angle determining unit 24 uses the independent variable deviation determined in (b) to calculate (determine) the independent variable variance for the data points held in the data point buffer.
(d) The angle determination unit 24 calculates (determines) the covariance of the data points held in the data point buffer using the independent variable deviation and the dependent variable deviation determined in (b).
(e) The angle determination unit 24 calculates (determines) the slope of the regression line by dividing the covariance determined in (d) by the variance of the independent variable determined in (c).

1つの例では、角度決定部24は、データポイントバッファに保持されているデータポイントにおけるx軸の値の最大値と最小値の差分値及びy軸の値の最大値と最小値の差分値に基づいて、独立変数の軸としてx軸及びy軸のいずれか一方の軸を決定し、他方の軸を従属変数の軸として決定する。好ましくは、角度決定部24は、データポイントバッファに保持されているデータポイントにおけるx軸の値の最大値と最小値の差分値に対して重み係数を用いて重み付けを行った値及びy軸の値の最大値と最小値の差分値に基づいて、独立変数の軸としてx軸及びy軸のいずれか一方の軸を決定し、他方の軸を従属変数の軸として決定する。 In one example, the angle determiner 24 determines the difference between the maximum and minimum x-axis values and the maximum and minimum y-axis values of the data points held in the data point buffer. Based on this, either the x-axis or the y-axis is determined as the axis of the independent variable, and the other axis is determined as the axis of the dependent variable. Preferably, the angle determination unit 24 weights the difference between the maximum and minimum x-axis values of the data points held in the data point buffer using a weighting factor and the y-axis value. Based on the difference between the maximum and minimum values, either the x-axis or the y-axis is determined as the axis of the independent variable, and the other axis is determined as the axis of the dependent variable.

角度決定部24は、上記のように最小二乗法を用いて回帰直線の傾きを算出(決定)する。好ましくは、角度決定部24が回帰直線の傾きを算出することは、角度決定部24が回帰直線の傾きの角度を算出することを意味する。ここで、算出される回帰直線の傾きは正負の方向を持たないため、角度決定部24は、最小二乗法を用いて回帰直線の傾きを算出する際、例えば0度~90度及び270度~360度の範囲内で算出する。したがって、例えばデータポイントの集合が示す角度が、45度の場合であっても225度の場合であっても、回帰直線の傾きとして45度が算出される。そのため、角度決定部24は、回帰直線の傾きを決定した後、データポイントバッファに保持されているデータポイントの集合としての変位方向に基づいて、決定された回帰直線の傾きを回転させる回転量を決定する。具体的には、角度決定部24は、回帰直線の傾きを決定した後、ユーザが操作対象オブジェクトを制御するための角度を決定するにあたって、決定された回帰直線の傾き(の角度)に対して180度回転させるか否かを示す回転量を決定する。ここで、データポイントの集合としての変位方向は、データポイントが時間とともに変位する方向を示すものであり、例えばユーザがタッチパネル17上で指を動かす大まかな方向に対応するものである。 The angle determination unit 24 calculates (determines) the slope of the regression line using the method of least squares as described above. Preferably, the calculation of the slope of the regression line by the angle determination unit 24 means that the angle determination unit 24 calculates the angle of the slope of the regression line. Here, the slope of the calculated regression line does not have a positive or negative direction. It is calculated within the range of 360 degrees. Therefore, for example, whether the angle indicated by the set of data points is 45 degrees or 225 degrees, 45 degrees is calculated as the slope of the regression line. Therefore, after determining the slope of the regression line, the angle determination unit 24 determines the amount of rotation for rotating the determined slope of the regression line based on the displacement direction as a set of data points held in the data point buffer. decide. Specifically, after determining the slope of the regression line, the angle determining unit 24 determines the angle for the user to control the operation target object, with respect to (the angle of) the determined slope of the regression line. A rotation amount indicating whether to rotate 180 degrees is determined. Here, the displacement direction as a set of data points indicates the direction in which the data points are displaced over time, and corresponds to the rough direction in which the user moves his/her finger on the touch panel 17, for example.

1つの例では、角度決定部24は、データポイントバッファに保持されているデータポイントにおいて時系列的に前後するデータポイントの変位方向に基づいて、回転量を決定する。好ましくは、角度決定部24は、データポイントバッファに保持されているデータポイントにおける時系列的に前後する、決定された独立変数の軸の値の差分値の正負の数量を比較することにより、回転量を決定する。決定される回転量は、決定された回帰直線の傾きに対して180度回転させるか否かを示す回転量である。 In one example, the angle determination unit 24 determines the amount of rotation based on the displacement direction of the data points that chronologically follow each other in the data points held in the data point buffer. Preferably, the angle determining unit 24 compares the positive and negative quantities of the difference values of the determined axis values of the independent variables that chronologically precede and follow the data points held in the data point buffer. Determine quantity. The determined amount of rotation indicates whether or not to rotate the determined regression line by 180 degrees.

角度決定部24は、データポイントバッファが先に格納されたデータポイントから順番にデータポイントを保持するように、各データポイントを格納する。或いは、角度決定部24は、データポイントバッファにデータポイントを格納するとき、格納された順番が識別可能な識別情報を関連付けて格納する。このように、角度決定部24は、格納された順番が識別できるように、すなわち格納されたデータポイントの時系列順が識別できるように、データポイントバッファにデータポイントを保持している。このとき、角度決定部24は、データポイント取得時間tの値を用いることができる。 The angle determiner 24 stores each data point such that the data point buffer holds data points in order from the data point stored first. Alternatively, when storing the data points in the data point buffer, the angle determination unit 24 associates and stores identification information that enables identification of the order in which the data points were stored. Thus, the angle determiner 24 maintains the data points in the data point buffer such that the order in which they were stored is identifiable, ie, the chronological order of the stored data points is identifiable. At this time, the angle determination unit 24 can use the value of the data point acquisition time t.

角度決定部24は、決定された回帰直線の傾き及び決定された回転量に基づいて、データポイントの集合が示す角度を算出し、ユーザが仮想空間内の操作対象オブジェクトを制御するための角度として決定する。 The angle determination unit 24 calculates the angle indicated by the set of data points based on the determined slope of the regression line and the determined amount of rotation, and calculates the angle as the angle for the user to control the operation target object in the virtual space. decide.

本実施形態では、上記の角度決定部24が行う、回帰直線の傾きの決定、回転量の決定、及び角度の決定について、式(1)に示す関数aop(x,y)を用いて実現する。関数aop(x,y)は、0~360度の実数で角度を算出する。関数aop(x,y)が角度を算出するとき、データポイントバッファはn個のデータポイントP(x,y)を保持しているものとする。また、n個の各データポイントPk(k=1~n)のx座標の値及びy座標の値は、Pk(xk,yk)で表され、P1(x1,y1)、P2(x2,y2)、…、Pn(xn,yn)の順番に格納された時間が早いものとする。

Figure 0007250451000001
(1)
関数aop(x,y)は、場合分けをするため、関数rotate(x,y)、関数left(x)、関数down(y)を使用する。最初に、関数aop(x,y)は、関数rotate(x,y)を用いて、xとyのいずれか一つを独立変数として決定する。 In this embodiment, the determination of the inclination of the regression line, the determination of the amount of rotation, and the determination of the angle performed by the angle determining unit 24 are realized using the function aop(x, y) shown in Equation (1). . The function aop(x,y) calculates an angle in real numbers between 0 and 360 degrees. Assume that the datapoint buffer holds n datapoints P(x,y) when the function aop(x,y) computes the angle. Also, the x-coordinate value and y-coordinate value of each of the n data points P k (k=1 to n) are represented by P k (x k , y k ) and P 1 (x 1 , y 1 ), P 2 (x 2 , y 2 ) , .
Figure 0007250451000001
(1)
The function aop(x, y) uses the function rotate(x, y), the function left(x), and the function down(y) to separate cases. First, the function aop(x, y) uses the function rotate(x, y) to determine one of x and y as an independent variable.

関数rotate(x,y)は、式(2)により定められる。

Figure 0007250451000002
(2)
関数rotate(x,y)は、n個のデータポイントP(x,y)が主にy軸方向に変位しているか否かを判定し、例えば真偽値を返す。n個のデータポイントP(x,y)が主にy軸方向に変位している場合とは、例えばタッチパネル17上でユーザの指が主として上下方向に動いた場合である。このようにして、関数rotate(x,y)は、n個のデータポイントP(x,y)が主にx軸(左右)方向に変位しているか又は主にy軸(上下)方向に変位しているかを判定し、x軸の値とy軸の値のどちらが独立変数として適切であるかを判定する。 The function rotate(x,y) is defined by equation (2).
Figure 0007250451000002
(2)
The function rotate(x, y) determines whether the n data points P(x, y) are displaced mainly in the y-axis direction, and returns a true/false value, for example. The case where the n data points P(x, y) are displaced mainly in the y-axis direction is, for example, the case where the user's finger moves mainly in the vertical direction on the touch panel 17 . In this way, the function rotate(x,y) determines whether the n data points P(x,y) are displaced primarily along the x-axis (left-right) or displaced primarily along the y-axis (up-down). It determines whether the x-axis value or the y-axis value is appropriate as an independent variable.

式(2)において、(max(x)―min(x))は、n個のデータポイントPのxの値(x1,x2,…xn)における最大値と最小値の差分の絶対値であり、n個のデータポイントPのx軸方向の変位量を示す。同様にして、(max(y)―min(y))は、n個のデータポイントPのyの値(y1,y2,…yn)における最大値と最小値の差分の絶対値であり、n個のデータポイントPのy軸方向の変位量を示す。変数wは、(max(x)―min(x))に対して重み付けを行う重み係数である。 In equation (2), (max(x)−min(x)) is the absolute difference between the maximum and minimum values of x values (x 1 , x 2 , . . . x n ) of n data points P. , which indicates the amount of displacement of n data points P in the x-axis direction. Similarly, (max(y)−min(y)) is the absolute value of the difference between the maximum and minimum y values (y 1 , y 2 , . . . y n ) of n data points P. , indicating the amount of displacement of n data points P in the y-axis direction. The variable w is a weighting factor that weights (max(x)-min(x)).

関数rotate(x,y)は、(max(y)―min(y))が(max(x)―min(x))と変数wとの積の値よりも大きいときに不等号を満たし、関数aop(x,y)は、座標変換を行う。この場合、関数aop(x,y)は、y軸を独立変数の軸とし、x軸を従属変数の軸とし、更に関数down(y)を用いて、回転量を決定する。一方、関数rotate(x,y)は、(max(y)―min(y))が(max(x)―min(x))と変数wとの積の値以下のときに不等号を満たさず、関数aop(x,y)は、座標変換を行わない。この場合、関数aop(x,y)は、x軸を独立変数の軸とし、y軸を従属変数の軸とすし、更に関数left(x)を用いて、回転量を決定する。 The function rotate(x, y) satisfies the inequality when (max(y)-min(y)) is greater than the product of (max(x)-min(x)) and the variable w, and the function aop(x,y) performs a coordinate transformation. In this case, the function aop(x,y) uses the y-axis as the axis of the independent variable, the x-axis as the axis of the dependent variable, and the function down(y) to determine the amount of rotation. On the other hand, the function rotate(x, y) does not satisfy the inequality when (max(y)-min(y)) is less than or equal to the product of (max(x)-min(x)) and the variable w. , the function aop(x,y) does not perform a coordinate transformation. In this case, the function aop(x,y) uses the x-axis as the independent variable axis and the y-axis as the dependent variable axis, and further uses the function left(x) to determine the amount of rotation.

関数rotate(x,y)が変数wにより重み付けされない場合、y軸方向の変位量がx軸方向の変位量よりもわずかに大きいと、関数aop(x,y)は座標変換を行うこととなる。変数wを用いて重み付けすることにより、関数aop(x,y)は、n個のデータポイントP(x,y)がよりy軸に沿った傾きの場合に座標変換を行うようにすることが可能となる。 If the function rotate(x,y) is not weighted by the variable w, the function aop(x,y) will perform a coordinate transformation if the displacement along the y-axis is slightly greater than the displacement along the x-axis. . By weighting with the variable w, the function aop(x,y) can cause the n data points P(x,y) to undergo a coordinate transformation if they are more tilted along the y-axis. It becomes possible.

例えばスマートフォンは縦持ちで使用されることが多いため、図3に示すタッチパネル17のy軸は重力方向と実質的に平行となることが多い。タッチパネル17のy軸方向の寸法はx軸方向の寸法より大きいことを考慮すると、変数wは1より大きい値とすることが好ましい。例えば、変数wは2とすることが好ましい。他の例では、スマートフォンが横持ちされ、かつゲームアプリが備えるゲームエンジンが縦横の座標の変換をしない場合、角度決定部24はwを0.5などの1より小さい値に決定する。 For example, since smartphones are often held vertically and used, the y-axis of the touch panel 17 shown in FIG. 3 is often substantially parallel to the direction of gravity. Considering that the dimension of the touch panel 17 in the y-axis direction is larger than the dimension in the x-axis direction, the variable w is preferably set to a value greater than one. For example, it is preferable to set the variable w to 2. In another example, when the smartphone is held horizontally and the game engine included in the game application does not convert the vertical and horizontal coordinates, the angle determination unit 24 determines w to be a value smaller than 1, such as 0.5.

関数left(x)は、式(3)により表される。

Figure 0007250451000003
(3)
関数left(x)は、関数rotate(x,y)が不等号を満たさない場合、n個のデータポイントP(x,y)の変位方向が-x軸方向(左方向)か否かを判定し、例えば真偽値を返す。具体的には、関数left(x)は、n個のデータポイントPのxの値(x1,x2,…xn)における時系列的に前後する値の差分値(x2-x1,x3-x2,…xn-xn-1)を算出する。関数left(x)は、差分値がマイナスとなる個数が、差分値がプラスとなる個数より多いか否かを判定することにより、n個のデータポイントP(x,y)の変位方向が-x軸方向(左方向)か否かを判定する。このようにして、関数left(x)は、n個のデータポイントP(x,y)の変位方向が-x軸方向(左方向)か+x軸方向(右方向)であるかを判定し、決定された回帰直線の傾きに対して180度回転させるか否かを示す回転量を決定する。例えば、関数left(x)が真である場合、関数aop(x,y)は回転量を180度と決定し、関数left(x)が偽である場合、関数aop(x,y)は回転量を0度と決定する。 The function left(x) is represented by Equation (3).
Figure 0007250451000003
(3)
The function left(x) determines whether or not the displacement direction of the n data points P(x, y) is in the −x-axis direction (to the left) if the function rotate(x, y) does not satisfy the inequality. , for example returning a boolean value. Specifically, the function left(x ) is the difference value (x 2 −x 1 , x 3 −x 2 , . . . x n −x n-1 ). The function left(x) determines whether the number of negative difference values is greater than the number of positive difference values, so that the displacement direction of the n data points P(x, y) is − It is determined whether or not it is in the x-axis direction (leftward direction). Thus, the function left(x) determines whether the direction of displacement of the n data points P(x,y) is in the direction of the −x axis (to the left) or the direction of the +x axis (to the right), A rotation amount indicating whether to rotate the determined regression line by 180 degrees is determined. For example, if the function left(x) is true, the function aop(x,y) determines the amount of rotation to be 180 degrees, and if the function left(x) is false, the function aop(x,y) rotates Determine the volume as 0 degrees.

関数down(y)は、式(4)により表される。

Figure 0007250451000004
(4)
関数down(y)は、関数rotate(x,y)が不等号を満たす場合、n個のデータポイントP(x,y)の変位方向が-y軸方向(下方向)か否かを判定し、例えば真偽値を返す。具体的には、関数down(y)は、n個のデータポイントPのyの値(y1,y2,…yn)における時系列的に前後する値の差分値(y2-y1,y3-y2,…yn-yn-1)を算出する。関数down(y)は、差分値がマイナスとなる個数が、差分値がプラスとなる個数より多いか否かを判定することにより、n個のデータポイントP(x,y)の変位方向が-y軸方向(下方向)か否かを判定する。このようにして、関数down(y)は、n個のデータポイントP(x,y)の変位方向が-y軸方向(下方向)か+y軸方向(上方向)であるかを判定し、決定された回帰直線の傾きに対して180度回転させるか否かを示す回転量を決定する。例えば、関数down(y)が真である場合、関数aop(x,y)は回転量を180度と決定し、関数down(y)が偽である場合、関数aop(x,y)は回転量を0度と決定する。 Function down(y) is represented by equation (4).
Figure 0007250451000004
(4)
The function down (y) determines whether the displacement direction of the n data points P (x, y) is the -y axis direction (downward) when the function rotate (x, y) satisfies the inequality, For example, return a boolean value. Specifically , the function down(y) is the difference value (y 2 −y 1 , y 3 −y 2 , . . . y n −y n-1 ). The function down(y) determines whether the number of negative difference values is greater than the number of positive difference values, so that the displacement direction of the n data points P(x, y) is − It is determined whether it is in the y-axis direction (downward). Thus, the function down(y) determines whether the direction of displacement of the n data points P(x,y) is in the direction of the −y axis (downward) or in the direction of the +y axis (upward), A rotation amount indicating whether to rotate the determined regression line by 180 degrees is determined. For example, if the function down(y) is true, the function aop(x,y) determines the amount of rotation to be 180 degrees, and if the function down(y) is false, the function aop(x,y) rotates Determine the volume as 0 degrees.

関数aop(x,y)は、上記のように、独立変数(独立変数の軸)及び回転量を決定した後、最小二乗法を用いて傾きを算出する。関数aop(x,y)は、xを独立変数とし、yを従属変数とする場合、y=ax+bの回帰直線の傾きaは、式(5)により算出している。

Figure 0007250451000005
(5)
ここで、
Figure 0007250451000006
は、x(独立変数)の平均であり、
Figure 0007250451000007
は、y(従属変数)の平均であり、
Figure 0007250451000008
は、x(独立変数)とy(従属変数)の共分散であり、
Figure 0007250451000009
は、x(独立変数)の分散である。 The function aop(x, y) calculates the slope using the least squares method after determining the independent variable (axis of the independent variable) and the amount of rotation as described above. In the function aop(x, y), where x is the independent variable and y is the dependent variable, the slope a of the regression line of y=ax+b is calculated by Equation (5).
Figure 0007250451000005
(5)
here,
Figure 0007250451000006
is the mean of x (the independent variable),
Figure 0007250451000007
is the mean of y (the dependent variable) and
Figure 0007250451000008
is the covariance of x (independent variable) and y (dependent variable),
Figure 0007250451000009
is the variance of x (the independent variable).

なお、関数aop(x,y)は、yを独立変数とし、xを従属変数とする場合、x=cx+dの回帰直線の傾きcは、式(6)により算出している。

Figure 0007250451000010
(6)
ここで、
Figure 0007250451000011
は、x(従属変数)の平均であり、
Figure 0007250451000012
は、y(独立変数)の平均であり、
Figure 0007250451000013
は、x(従属変数)とy(独立変数)の共分散であり、
Figure 0007250451000014
は、y(独立変数)の分散である。 In the function aop(x, y), where y is the independent variable and x is the dependent variable, the slope c of the regression line of x=cx+d is calculated by Equation (6).
Figure 0007250451000010
(6)
here,
Figure 0007250451000011
is the mean of x (the dependent variable) and
Figure 0007250451000012
is the mean of y (independent variable),
Figure 0007250451000013
is the covariance of x (dependent variable) and y (independent variable),
Figure 0007250451000014
is the variance of y (the independent variable).

角度決定部24は、変数Vを定め、独立変数の分散がV以上であった場合、関数aop(x,y)を用いて角度を算出し、決定する。角度決定部24は、独立変数の分散がV未満である場合、keepイベントを状態決定部25へ出力し、角度を算出しない。独立変数の分散がV未満である場合とは、n個のデータポイントP(x,y)が、局所的に集中していることを意味する。したがって、角度決定部24が変数Vを定めることにより、微細すぎる指の動きを無視し、安定した角度の算出を行うことが可能となる。変数Vは、好ましくは0.7に設定される。 The angle determining unit 24 determines a variable V, and when the variance of the independent variable is V or more, calculates and determines the angle using the function aop(x, y). When the variance of the independent variable is less than V, the angle determination unit 24 outputs a keep event to the state determination unit 25 and does not calculate the angle. If the variance of the independent variable is less than V, it means that the n data points P(x,y) are locally concentrated. Therefore, by setting the variable V by the angle determining unit 24, it is possible to ignore too minute movements of the finger and to calculate a stable angle. Variable V is preferably set to 0.7.

関数aop(x,y)は、関数rotate(x,y)が偽であり、関数left(x)が偽である場合、回帰直線の傾きから得られる角度をそのまま算出する。関数aop(x,y)は、関数rotate(x,y)が偽であり、関数left(x)が真である場合、回帰直線の傾きから得られる角度に180度プラスした角度を算出する。関数aop(x,y)は、関数rotate(x,y)が真であり、関数down(y)が偽である場合、回帰直線の傾きから得られる角度を90度から引くことにより角度を算出する。関数aop(x,y)は、関数rotate(x,y)が真であり、関数down(y)が真である場合、回帰直線の傾きから得られる角度を90度から引くことにより算出した角度に180度プラスした角度を算出する。 The function aop(x, y) directly calculates the angle obtained from the slope of the regression line when the function rotate(x, y) is false and the function left(x) is false. The function aop(x, y) calculates the angle obtained by adding 180 degrees to the angle obtained from the slope of the regression line when the function rotate(x, y) is false and the function left(x) is true. The function aop(x, y) calculates the angle by subtracting the angle obtained from the slope of the regression line from 90 degrees when the function rotate(x, y) is true and the function down(y) is false. do. The function aop(x, y) is the angle plus 180 degrees to calculate the angle.

状態決定部25は、角度決定部24により既定の処理時間ごとに決定される角度に基づいて、既定の処理時間ごとに角度及び大きさを決定する。状態決定部25は、決定した角度及び大きさをアプリケーション部26へ出力する。状態決定部25は、アプリケーション部26へ直接出力せずに、アプリケーション部26が参照するメモリ領域に決定した角度及び大きさを示す情報を格納してもよい。1つの好適な例では、状態決定部25は、連続的に算出される角度の列をコントローラの機能に変換するソフトウェアモジュールである。本モジュールは、タッチ座標は一切用いず、角度と時間を使った状態管理モデル(ステートマシン)として実装される。 The state determination unit 25 determines the angle and the size for each predetermined processing time based on the angle determined by the angle determination unit 24 for each predetermined processing time. The state determination unit 25 outputs the determined angle and size to the application unit 26 . The state determination unit 25 may store information indicating the determined angle and size in a memory area referred to by the application unit 26 without directly outputting the information to the application unit 26 . In one preferred example, the state determiner 25 is a software module that translates a series of continuously calculated angles into controller functions. This module does not use any touch coordinates, and is implemented as a state management model (state machine) using angles and time.

状態決定部25は、既定の処理時間ごとに角度決定部24が出力する情報を受け取ると、受け取ったイベントに応じて、既定の処理時間ごとに仮想コントローラの傾きの状態を出力する。仮想コントローラは、物理的なアナログコントローラをソフトウェアで実現するものであるが、仮想コントローラの傾きとは、物理的なコントローラのジョイスティックやレバーの傾きに対応するものである。状態決定部25は、仮想コントローラの傾きの状態を、ベクトルすなわち方向(角度)及び大きさとして出力する。大きさは、加速度情報とすることもできるし、速度情報とすることもできる。仮想コントローラの傾きの状態は、物理的なアナログコントローラの入力量に対応するものである。 When the state determination unit 25 receives the information output by the angle determination unit 24 every predetermined processing time, the state determination unit 25 outputs the tilt state of the virtual controller every predetermined processing time according to the received event. A virtual controller is a software implementation of a physical analog controller, and the tilt of the virtual controller corresponds to the tilt of the joystick or lever of the physical controller. The state determination unit 25 outputs the tilt state of the virtual controller as a vector, ie, direction (angle) and magnitude. The magnitude can be acceleration information or velocity information. The tilt state of the virtual controller corresponds to the input quantity of the physical analog controller.

このように、状態決定部25は、発生したタッチイベントの意味を解釈するための状態遷移モデルを提供するものと考えることができる。状態決定部25は、仮想のコントローラの傾きを状態として管理し、既定の処理時間ごとに角度決定部24が出力する情報を受け取ると、既定の処理時間ごとに状態遷移させるものである。 In this way, the state determination unit 25 can be considered to provide a state transition model for interpreting the meaning of touch events that have occurred. The state determination unit 25 manages the tilt of the virtual controller as a state, and upon receiving the information output by the angle determination unit 24 every predetermined processing time, changes the state every predetermined processing time.

1つの例では、状態決定部25は、角度決定部24から出力される角度の情報を蓄積し、時間に応じて、アプリケーション部26への出力を算出する。例えば、角度決定部24が165ms継続して33msごとに45度を出力する場合、状態決定部25は、45度の方向に165ms分の加速度情報を決定する。例えば、角度決定部24が同じ角度の出力が連続した場合、状態決定部25は該角度の方向へ加速する情報を出力し、続けて角度決定部24が該角度と180度反対の角度を入力した場合、状態決定部25は、減速する情報を出力する。このような構成とすることにより、実際のタッチ座標をそのまま用いずに、コントローラの入力量を、状態遷移回数に対応する時間として求めることが可能となる。 In one example, the state determination unit 25 accumulates angle information output from the angle determination unit 24 and calculates the output to the application unit 26 according to time. For example, when the angle determination unit 24 continues for 165 ms and outputs 45 degrees every 33 ms, the state determination unit 25 determines acceleration information for 165 ms in the direction of 45 degrees. For example, when the angle determination unit 24 continuously outputs the same angle, the state determination unit 25 outputs information to accelerate in the direction of the angle, and the angle determination unit 24 subsequently inputs an angle 180 degrees opposite to the angle. If so, the state determination unit 25 outputs information about deceleration. By adopting such a configuration, it is possible to obtain the input amount of the controller as the time corresponding to the number of state transitions without using the actual touch coordinates as they are.

1つの例では、状態決定部25は、角度決定部24が出力する情報を受け取ると、受け取ったイベントに応じて、仮想コントローラの傾きの状態を設定し、ゲームアプリケーションへ移動イベント又は加速イベントを角度及び大きさを示す情報とともに出力する。具体的には、状態決定部25は、所定のプログラム言語を用いて、物理的なアナログコントローラを模した加速度処理を実装することができる。 In one example, when the state determination unit 25 receives the information output by the angle determination unit 24, the state determination unit 25 sets the tilt state of the virtual controller according to the received event, and sends a movement event or an acceleration event to the game application. and size information. Specifically, the state determination unit 25 can implement acceleration processing that imitates a physical analog controller using a predetermined program language.

1つの好適な例では、状態決定部25は、仮想コントローラの傾きの状態をベクトルとして保持し、既定の処理時間ごとに、保持したベクトルを出力する。状態決定部25は、角度決定部24からstartイベントを受け取ると、状態管理を開始する。状態決定部25は、最初に角度決定部24からangleイベントを受け取ると、受け取った角度及び状態遷移1回分の大きさのベクトルの保持を開始し、該ベクトルを出力する。状態決定部25は、更に角度決定部24からangleイベントを受け取ると、内部で保持するベクトルに、受け取った角度及び状態遷移1回分の大きさのベクトルを加算して、該ベクトルを保持するとともに出力する。状態決定部25は、出力するベクトルの長さが1.0を超えた場合、1.0に正規化する。 In one preferred example, the state determination unit 25 holds the state of the tilt of the virtual controller as a vector, and outputs the held vector every predetermined processing time. Upon receiving the start event from the angle determination unit 24, the state determination unit 25 starts state management. When the state determination unit 25 first receives an angle event from the angle determination unit 24, the state determination unit 25 starts holding the received angle and a vector having the size of one state transition, and outputs the vector. When the state determination unit 25 further receives an angle event from the angle determination unit 24, the state determination unit 25 adds the received angle and a vector having the size of one state transition to the internally retained vector, and stores and outputs the vector. do. If the length of the output vector exceeds 1.0, the state determination unit 25 normalizes it to 1.0.

例えば、状態決定部25は、角度決定部24から45度の角度情報を1回受け取ると、45度の角度及び0.2の大きさのベクトルを出力するとともに、該ベクトルを保持する。状態決定部25は、角度決定部24から45度の角度情報を更に4回受け取ると、45度の角度及び1.0の大きさのベクトルを保持するとともに出力する。状態決定部25は、更に角度決定部24から45度の角度情報を受け取った場合も、45度の角度及び1.0の大きさのベクトルを保持するとともに出力する。状態決定部25は、30度の角度情報を受け取った場合、30度の角度及び0.2の大きさのベクトルと、45度の角度及び1.0の大きさのベクトルとを加算したベクトルの角度及び1.0の大きさのベクトルを保持するとともに出力する。この場合も、ベクトルの大きさが1.0を超えるため、状態決定部25は、1.0に正規化して出力する。 For example, when the state determination unit 25 receives the angle information of 45 degrees from the angle determination unit 24 once, it outputs a vector with an angle of 45 degrees and a magnitude of 0.2 and holds the vector. When the state determination unit 25 receives the angle information of 45 degrees from the angle determination unit 24 four more times, the state determination unit 25 holds and outputs the angle of 45 degrees and the magnitude vector of 1.0. When the state determination unit 25 further receives the angle information of 45 degrees from the angle determination unit 24, the state determination unit 25 holds and outputs the angle of 45 degrees and the vector having the magnitude of 1.0. When the state determination unit 25 receives the angle information of 30 degrees, the state determination unit 25 adds the vector of the angle of 30 degrees and the magnitude of 0.2 to the vector of the angle of 45 degrees and the magnitude of 1.0. Retain and output a vector of angle and magnitude of 1.0. Also in this case, since the magnitude of the vector exceeds 1.0, the state determination unit 25 normalizes it to 1.0 and outputs it.

状態決定部25は、角度決定部24からkeepイベントを受け取ると、内部で保持するベクトルの保持を継続し、該ベクトルを出力する。状態決定部25は、角度決定部24からstopイベントを受け取ると、内部で保持するベクトルの保持を解除し、ゼロベクトルを出力するか、又はstopイベントを出力する。 Upon receiving the keep event from the angle determination unit 24, the state determination unit 25 continues to hold the internally held vector and outputs the vector. Upon receiving the stop event from the angle determination unit 24, the state determination unit 25 releases the vector held internally and outputs a zero vector or a stop event.

このような構成とすることにより、物理的なアナログコントローラと同様の操作をスマートフォン上で実現することが可能となる。 With such a configuration, it is possible to realize the same operation on the smartphone as a physical analog controller.

アプリケーション部26は、電子装置10上で起動されたアプリの機能を有し、当該アプリによるサービスの提供を行う。1つの好適な例では、アプリケーション部26は、状態決定部25から出力されたベクトルを、具体的な仮想キャラクタのモーションなどに変換するものであり、一般的なゲームアプリに実装されている機能である。アプリがWebアプリである場合、電子装置10と通信するサーバがアプリケーション部26の一部又は全部を有し、アプリは、当該サーバとデータの送受信を行う。 The application unit 26 has the function of an application started on the electronic device 10, and provides services by the application. In one preferred example, the application unit 26 converts the vector output from the state determination unit 25 into a specific motion of the virtual character, and is a function implemented in general game applications. be. When the application is a web application, a server that communicates with the electronic device 10 has part or all of the application unit 26, and the application transmits and receives data to and from the server.

角度決定部24による、式(1)に示す関数aop(x,y)を用いた角度算出の実施例を以下に説明する。以下の例示において、変数wは2であり、独立変数の分散はV以上であるものとし、時間t1~t4は、角度決定部24が角度を算出する任意の1つの時間を示すものとする。 An example of angle calculation using the function aop(x, y) shown in Equation (1) by the angle determination unit 24 will be described below. In the following illustration, it is assumed that the variable w is 2, the variance of the independent variables is V or more, and the times t1 to t4 indicate any one time at which the angle determination unit 24 calculates the angles.

図5は、時間t1におけるデータポイントバッファが保持するデータポイントの一例を示す図である。データポイントバッファが保持するデータポイントの集合40は、6個のデータポイントP41~46からなる。また、P41~46のx座標の値及びy座標の値(x,y)は、各々P41(x41,y41)、P42(x42,y42)…P46(x46,y46)であり、データポイントバッファは、P41、P42、…、P46の順番でデータポイントを格納したものとする。 FIG. 5 is a diagram showing an example of data points held by the data point buffer at time t1. A set 40 of data points held by the data point buffer consists of six data points P41-46. The x-coordinate values and y-coordinate values (x, y) of P41 to 46 are respectively P41 (x 41 , y 41 ), P42 (x 42 , y 42 ) . . . P46 (x 46 , y 46 ). , and the data point buffer stores the data points in the order of P41, P42, . . . , P46.

最初に、関数aop(x,y)は、関数rotate(x,y)を用いて、abs(max(x)―min(x))とabs(max(y)―min(y))を比較する。図6より、P46とP41のx座標の値の差分値x46-x41(=Δx)がabs(max(x)―min(x))に対応し、P45とP41のy座標の値の差分値y45-y41(=Δy)がabs(max(y)―min(y))に対応することが確認できる。図5より、Δx>Δyである。したがって、関数rotate(x,y)は、不等号を満たさないため、偽の値を返す。 First, the function aop(x, y) compares abs(max(x)-min(x)) and abs(max(y)-min(y)) using the function rotate(x, y) do. From FIG. 6, the difference value x 46 −x 41 (=Δx) of the x-coordinate values of P46 and P41 corresponds to abs(max(x)−min(x)), and the y-coordinate values of P45 and P41 It can be confirmed that the difference value y 45 −y 41 (=Δy) corresponds to abs(max(y)−min(y)). From FIG. 5, Δx>Δy. Therefore, the function rotate(x,y) returns a false value because it does not satisfy the inequality.

続いて、関数aop(x,y)は、関数left(x)を用いて、時系列的に前後する値の差分値(x42-x41,x43-x42,…x46-x45)を算出する。図5より、差分値はすべてプラスとなる。したがって、関数left(x)は不等号を満たさないため、偽の値を返す。 Subsequently, the function aop(x, y) uses the function left(x) to obtain the difference values (x 42 −x 41 , x 43 −x 42 , . . . x 46 −x 45 ) is calculated. From FIG. 5, the difference values are all positive. Therefore, the function left(x) does not satisfy the inequality and returns a false value.

上記実施例においては、関数rotate(x,y)が偽であり、関数left(x)が偽である。したがって関数aop(x,y)は、データポイントの集合40から図7に示す回帰直線81を求め、図8に示すように回帰直線81の傾きから角度91を算出する。 In the above example, the function rotate(x,y) is false and the function left(x) is false. The function aop(x,y) thus determines the regression line 81 shown in FIG. 7 from the set of data points 40 and calculates the angle 91 from the slope of the regression line 81 as shown in FIG.

図9は、時間t2におけるデータポイントバッファが保持するデータポイントの一例を示す図である。データポイントバッファが保持するデータポイントの集合60は、6個のデータポイントP61~66からなる。P61、P62、…P66のx座標の値及びy座標の値は、各々P46、P45、…、P41のx座標の値及びy座標の値と同じであり、P61、P62、…、P66の順番でデータポイントを格納したものとする。 FIG. 9 is a diagram showing an example of data points held by the data point buffer at time t2. A set 60 of data points held by the data point buffer consists of six data points P61-66. The x-coordinate value and y-coordinate value of P61, P62, . . . P66 are the same as the x-coordinate value and y-coordinate value of P46, P45, . store the data points in .

関数rotate(x,y)は、図5の実施例の場合と同様にして、不等号を満たさないため、偽の値を返す。続いて、関数aop(x,y)は、関数left(x)を用いて、時系列的に前後する値の差分値を算出する。図9より、差分値はすべてマイナスとなる。したがって、関数left(x)は不等号を満たし、真の値を返す。 The function rotate(x,y) returns a value of false because the inequality is not satisfied, as in the embodiment of FIG. Subsequently, the function aop(x, y) uses the function left(x) to calculate the difference value between the values preceding and succeeding in time series. From FIG. 9, all the difference values are negative. Therefore, the function left(x) satisfies the inequality and returns a true value.

上記実施例においては、関数rotate(x,y)が偽であり、関数left(x)が真である。したがって関数aop(x,y)は、データポイントの集合60から図9に示す回帰直線82を求め、図10に示すように回帰直線82の傾きから算出される角度92aに180度プラスした角度92bを算出する。ここで、回帰直線82の傾きは回帰直線81と同じであり、角度91は角度92aと同じであるが、データポイントバッファがデータポイントを格納した順番が逆であるため、関数aop(x,y)が算出する角度は180度異なることが確認できる。 In the above example, the function rotate(x,y) is false and the function left(x) is true. The function aop(x,y) thus determines from the set of data points 60 the regression line 82 shown in FIG. 9, and the angle 92a calculated from the slope of the regression line 82 as shown in FIG. Calculate Here, the slope of the regression line 82 is the same as the regression line 81, and the angle 91 is the same as the angle 92a, but the order in which the data points were stored in the data point buffer is reversed, so the function aop(x, y ) are different from each other by 180 degrees.

図11は、時間t3におけるデータポイントバッファが保持するデータポイントの一例を示す図である。データポイントバッファが保持するデータポイントの集合70は、6個のデータポイントP71~76からなる。また、P71~76のx座標の値及びy座標の値は、各々P71(x71,y71)、P72(x72,y72)…P46(x76,y76)であり、データポイントバッファは、P71、P72、…、P76の順番でデータポイントを格納したものとする。 FIG. 11 is a diagram showing an example of data points held by the data point buffer at time t3. A data point set 70 held by the data point buffer consists of six data points P71-76. The x-coordinate values and y - coordinate values of P71 to P76 are respectively P71 ( x71 , y71 ), P72 ( x72 , y72 ) . stores the data points in the order of P71, P72, . . . , P76.

図12より、P75とP71のx座標の値の差分値x75-x71(=Δx)がabs(max(x)―min(x))に対応し、P76とP71のy座標の値の差分値y76-y71(=Δy)がabs(max(y)―min(y))に対応することが確認できる。図11より、2×Δx<Δyである。したがって、関数rotate(x,y)は、不等号を満たすため、真の値を返す。 From FIG. 12, the difference value x 75 −x 71 (=Δx) of the x-coordinate values of P75 and P71 corresponds to abs(max(x)−min(x)), and the y-coordinate values of P76 and P71 It can be confirmed that the difference value y 76 −y 71 (=Δy) corresponds to abs(max(y)−min(y)). From FIG. 11, 2×Δx<Δy. Therefore, the function rotate(x,y) returns a true value because it satisfies the inequality.

続いて、関数aop(x,y)は、関数down(y)を用いて、時系列的に前後する値の差分値(y72-y71,y73-y72,…y76-y75)を算出する。図11より、差分値はすべてプラスとなる。したがって、関数down(y)は不等号を満たさないため、偽の値を返す。 Subsequently, the function aop(x, y) uses the function down(y) to obtain the difference values (y 72 −y 71 , y 73 −y 72 , . . . y 76 −y 75 ). From FIG. 11, the difference values are all positive. Therefore, the function down(y) does not satisfy the inequality and returns a false value.

上記実施例においては、関数rotate(x,y)が真であり、関数down(y)が偽である。したがって関数aop(x,y)は、データポイントの集合70から図13に示す回帰直線83を求め、図13に示すように回帰直線83の傾きから算出される角度93aを、90度から引くことにより角度93bを算出する。ここで、図13に示す角度93aは、yを独立変数としてxを従属変数とした場合の回帰直線83の傾きから算出される角度を、xを独立変数としてyを従属変数とした座標に戻した場合の位置に対応させて示している。 In the above example, the function rotate(x,y) is true and the function down(y) is false. The function aop(x,y) thus determines from the set of data points 70 the regression line 83 shown in FIG. to calculate the angle 93b. Here, the angle 93a shown in FIG. 13 is the angle calculated from the slope of the regression line 83 when y is the independent variable and x is the dependent variable, and is returned to the coordinates where x is the independent variable and y is the dependent variable. It is shown corresponding to the position in the case of

図14は、時間t4におけるデータポイントバッファが保持するデータポイントの一例を示す図である。時間t4は、時間t1から時間Δtが経過した時間である。データポイントバッファが保持するデータポイントの集合40’は、8個のデータポイントP45~52からなる。また、P45~52のx座標の値及びy座標の値は、各々P45(x45,y46)、P46(x46,y46)…P52(x52,y52)であり、データポイントバッファは、P45、P46、…、P52の順番でデータポイントを格納したものとする。 FIG. 14 is a diagram showing an example of data points held by the data point buffer at time t4. Time t4 is the time when time Δt has elapsed from time t1. A set 40' of data points held by the data point buffer consists of eight data points P45-52. The x-coordinate values and y-coordinate values of P45-52 are respectively P45 (x 45 , y 46 ), P46 (x 46 , y 46 ) . stores the data points in the order of P45, P46, . . . , P52.

図15より、P52とP45のx座標の値の差分値x52-x45(=Δx)がabs(max(x)―min(x))に対応し、P46とP52のy座標の値の差分値y46-y52(=Δy)がabs(max(y)―min(y))に対応することが確認できる。図14より、2×Δx<Δyである。したがって、関数rotate(x,y)は、不等号を満たすため、真の値を返す。 From FIG. 15, the difference value x 52 −x 45 (=Δx) of the x-coordinate values of P52 and P45 corresponds to abs(max(x)−min(x)), and the y-coordinate values of P46 and P52 It can be confirmed that the difference value y 46 −y 52 (=Δy) corresponds to abs(max(y)−min(y)). From FIG. 14, 2×Δx<Δy. Therefore, the function rotate(x,y) returns a true value because it satisfies the inequality.

続いて、関数aop(x,y)は、関数down(y)を用いて、時系列的に前後する値の差分値(y46-y45,y47-y46,…y52-y51)を算出する。図11より、y46-y45以外の差分値はマイナスとなる。したがって、関数down(y)は不等号を満たすため、真の値を返す。 Subsequently, the function aop(x, y) uses the function down(y) to obtain the difference values (y 46 −y 45 , y 47 −y 46 , . . . y 52 −y 51 ) is calculated. From FIG. 11, difference values other than y 46 -y 45 are negative. Therefore, the function down(y) satisfies the inequality and returns a true value.

上記実施例においては、関数rotate(x,y)が真であり、関数down(y)が真である。したがって関数aop(x,y)は、データポイントの集合40’から図16に示す回帰直線84を求め、図17に示すように回帰直線83の傾きから算出される角度94aを、90度から引くことにより算出した角度94bに180度プラスした角度94cを算出する。 In the above example, the function rotate(x,y) is true and the function down(y) is true. The function aop(x,y) thus determines from the set of data points 40' the regression line 84 shown in FIG. An angle 94c is calculated by adding 180 degrees to the calculated angle 94b.

図18は、本発明の一実施形態による電子装置10がデータポイントの集合120から仮想キャラクタ121を制御する様子を示す図である。図18は、タッチパネル17へのユーザの操作により発生したタッチイベントに対応するデータポイントを可視化したデータポイントの集合120を示す。電子装置10は、データポイントの集合120が示す角度122に基づいて、操作対象オブジェクトである仮想キャラクタ121のモーション、例えば歩く、走る、方向転換などを制御する。 FIG. 18 is a diagram illustrating electronic device 10 controlling virtual character 121 from set 120 of data points according to one embodiment of the present invention. FIG. 18 shows a data point set 120 that visualizes data points corresponding to touch events generated by a user's manipulation of the touch panel 17 . Based on the angle 122 indicated by the data point set 120, the electronic device 10 controls the motion of the virtual character 121, which is the operation target object, such as walking, running, turning direction, and the like.

図19は、本発明の一実施形態による角度決定部24の情報処理のフローチャートを示す図である。本フローチャートは、タッチイベントが発生し、角度決定部24が該タッチイベントからデータポイントを取得したときに開始する。 FIG. 19 is a diagram showing a flowchart of information processing of the angle determining section 24 according to one embodiment of the present invention. This flow chart starts when a touch event occurs and the angle determiner 24 acquires data points from the touch event.

ステップ101で、角度決定部24は、取得したデータポイントをデータポイントバッファに格納する。このとき、角度決定部24は、格納するデータポイントに、格納後の経過時間をミリ秒で示すTと、データポイントバッファに格納できる時間(保持寿命)をミリ秒で示す変数Dを関連付ける。 At step 101, the angle determination unit 24 stores the obtained data points in the data point buffer. At this time, the angle determination unit 24 associates the data points to be stored with T, which indicates the elapsed time after storage in milliseconds, and a variable D, which indicates the time (retention life) that can be stored in the data point buffer in milliseconds.

続いてステップ102で、角度決定部24は、startイベントを状態決定部25へ出力する。 Subsequently, at step 102 , the angle determining section 24 outputs a start event to the state determining section 25 .

続いてステップ103で、角度決定部24は、タッチイベントが発生したか否かを判定する。ステップ103は、本フローチャート開始時からIms後に実行される。タッチイベントが発生した場合、本フローチャートはステップ104へ進み、タッチイベントが発生しなかった場合、本フローチャートはステップ106へ進む。 Subsequently, at step 103, the angle determination unit 24 determines whether or not a touch event has occurred. Step 103 is executed Ims after the start of this flowchart. If a touch event has occurred, the flowchart proceeds to step 104 , and if no touch event has occurred, the flowchart proceeds to step 106 .

ステップ104で、角度決定部24は、発生したタッチイベントがtouchendであるか否かを判定する。取得したタッチイベントがtouchendであった場合、本フローチャートは終了する。取得したタッチイベントがtouchendでなかった場合、本フローチャートはステップ105へ進む。 At step 104, the angle determining unit 24 determines whether or not the generated touch event is touchend. If the acquired touch event is touchend, this flowchart ends. If the acquired touch event is not touchend, the flow proceeds to step 105 .

ステップ105で、角度決定部24は、発生したタッチイベントからデータポイントを取得し、データポイントバッファに格納する。このとき、角度決定部24は、格納するデータポイントに、格納後の経過時間をミリ秒で示すTと、データポイントバッファに格納できる時間をミリ秒で示す変数Dを関連付ける。 At step 105, the angle determiner 24 acquires data points from the touch event that occurred and stores them in the data point buffer. At this time, the angle determining unit 24 associates the data point to be stored with T, which indicates the elapsed time after storage in milliseconds, and a variable D, which indicates the time that can be stored in the data point buffer in milliseconds.

続いてステップ106で、角度決定部24は、データポイントバッファに保持されているデータポイントのうち、経過時間Tが変数D以上であるデータポイントの保持を終了する。角度決定部24は、データポイントバッファに格納する各データポイントについて、経過時間Tと変数Dを比較し、経過時間Tが変数D以上である場合、当該データポイントの保持を終了する。 Subsequently, at step 106, the angle determining unit 24 ends holding data points whose elapsed time T is equal to or greater than the variable D among the data points held in the data point buffer. The angle determining unit 24 compares the elapsed time T and the variable D for each data point stored in the data point buffer, and when the elapsed time T is equal to or greater than the variable D, the data point is terminated.

続いてステップ107で、角度決定部24は、データポイントバッファが保持するデータポイントの個数nが変数Bの数以上であるか否かを判定する。個数nが変数B以上である場合、本フローチャートはステップ108へ進み、個数nが変数B未満であった場合、本フローチャートはステップ113へ進む。 Subsequently, at step 107, the angle determining unit 24 determines whether or not the number n of data points held by the data point buffer is equal to or greater than the number of variables B. FIG. If the number n is greater than or equal to the variable B, the flowchart proceeds to step 108 , and if the number n is less than the variable B, the flowchart proceeds to step 113 .

ステップ108で、角度決定部24は、データポイントバッファに保持されているデータポイントにおけるx軸の値の変位量及びy軸の値の変位量に基づいて、独立変数の軸としてx軸及びy軸のいずれか一方の軸を決定する。角度決定部24は、同時に他方の軸を従属変数の軸として決定する。 In step 108, the angle determining unit 24 determines the x-axis and y-axis as independent variable axes based on the x-axis value displacement and the y-axis value displacement of the data points held in the data point buffer. Determine one axis of The angle determination unit 24 simultaneously determines the other axis as the axis of the dependent variable.

続いてステップ109で、角度決定部24は、ステップ108でx軸が独立変数の軸として決定された場合、式(5)を用いて傾きの角度を算出することにより、回帰直線の傾きの角度を決定する。1つの例では、角度決定部24は、式(5)を用いて傾きの角度を算出する際、0度~90度及び270度~360度の範囲内で算出する。角度決定部24は、ステップ108でy軸が独立変数の軸として決定された場合、式(6)を用いて傾きの角度を算出し、算出した角度を90度から引くことにより、回帰直線の傾きの角度を決定する。1つの例では、角度決定部24は、式(6)を用いて傾きの角度を算出する際、0度~90度及び270度~360度の範囲内で算出する。 Subsequently, in step 109, when the x-axis is determined as the axis of the independent variable in step 108, the angle determining unit 24 calculates the angle of inclination of the regression line by using equation (5). to decide. In one example, the angle determination unit 24 calculates the angle of inclination within the range of 0 to 90 degrees and 270 to 360 degrees when calculating the angle of inclination using Equation (5). When the y-axis is determined as the axis of the independent variable in step 108, the angle determination unit 24 calculates the angle of inclination using Equation (6), and subtracts the calculated angle from 90 degrees to obtain the regression line. Determine the angle of inclination. In one example, the angle determination unit 24 calculates the angle of inclination within the ranges of 0 to 90 degrees and 270 to 360 degrees when calculating the angle of inclination using Equation (6).

続いて、ステップ110で、角度決定部24は、データポイントバッファに保持されているデータポイントの集合としての変位方向に基づいて、決定された回帰直線の傾きに対して180度回転させるか否かを示す回転量を決定する。1つの例では、角度決定部24は、ステップ108でx軸が独立変数の軸として決定された場合、時系列的に前後するx軸の値の差分値を各々算出する。角度決定部24は、算出した差分値がマイナスとなる個数がプラスとなる個数よりも多いとき、回転量を180度に決定し、少ないとき、回転量を0度に決定する。1つの例では、角度決定部24は、ステップ108でy軸が独立変数の軸として決定された場合、時系列的に前後するy軸の値の差分値を各々算出する。角度決定部24は、算出した差分値がマイナスとなる個数がプラスとなる個数よりも多いとき、回転量を180度に決定し、少ないとき、回転量を0度に決定する。 Subsequently, at step 110, the angle determination unit 24 determines whether to rotate the determined regression line by 180 degrees with respect to the determined slope of the regression line based on the displacement direction as a set of data points held in the data point buffer. Determines the amount of rotation that indicates In one example, when the x-axis is determined as the axis of the independent variable in step 108, the angle determining unit 24 calculates the difference values of the values on the x-axis that precede and follow each other in time series. The angle determination unit 24 determines the amount of rotation to be 180 degrees when the number of calculated negative difference values is greater than the number of positive difference values, and determines the amount of rotation to be 0 degrees when the number is less. In one example, when the y-axis is determined as the axis of the independent variable in step 108, the angle determining unit 24 calculates the difference values of the y-axis values that precede and follow each other in time series. The angle determination unit 24 determines the amount of rotation to be 180 degrees when the number of calculated negative difference values is greater than the number of positive difference values, and determines the amount of rotation to be 0 degrees when the number is less.

続いて、ステップ111で、角度決定部24は、決定された回帰直線の傾き及び決定された回転量に基づいて、角度を決定する。具体的には、角度決定部24は、決定された回帰直線の傾きに対応する角度に決定された回転量を加算することにより、角度を決定する。例えば回転量が0度の場合、角度決定部24が決定する角度は、決定された回帰直線の傾きに対応する角度となる。角度決定部24は、angleイベントを決定された角度とともに状態決定部25へ出力し、ステップ112へ進む。 Subsequently, in step 111, the angle determination unit 24 determines the angle based on the determined slope of the regression line and the determined amount of rotation. Specifically, the angle determining unit 24 determines the angle by adding the determined amount of rotation to the angle corresponding to the determined slope of the regression line. For example, when the amount of rotation is 0 degrees, the angle determined by the angle determination unit 24 is the angle corresponding to the determined slope of the regression line. The angle determination unit 24 outputs the angle event together with the determined angle to the state determination unit 25 and proceeds to step 112 .

ステップ107で個数nが変数B未満であった場合、ステップ113で、角度決定部24は、keepイベントを状態決定部25へ出力し、ステップ112へ進む。 If the number n is less than the variable B in step 107 , the angle determination unit 24 outputs a keep event to the state determination unit 25 in step 113 , and proceeds to step 112 .

ステップ112で、本フローチャートは、例えばゲームアプリケーションが終了するなどにより終了しない限り、ステップ103へ戻る。角度決定部24は、ステップ103~ステップ112の処理を、Imsごとに実行する。 At step 112, the flow chart returns to step 103 unless terminated, for example, by termination of the game application. The angle determination unit 24 executes the processing of steps 103 to 112 for each Ims.

本フローチャートが終了すると、角度決定部24は、データポイントバッファに保持するデータポイントをすべて削除する。 When this flowchart ends, the angle determination unit 24 deletes all data points held in the data point buffer.

次に、本発明の実施形態による電子装置10の主な作用効果について説明する。本実施形態では、タッチパネル17上で指をスワイプさせたとき、例えば100msなどの極めて短い時間に6回以上のタッチイベントが発生するという投影型静電容量方式タッチパネルの特徴を利用している。電子装置10が実装するソフトウェアのシステムアーキテクチャは、角度決定部24、状態決定部25、アプリケーション部26が第1層、第2層、第3層に各々対応する3層構造をとり、第3層は、ゲームアプリケーションに対応する。第1層は、発生する複数のタッチイベントの集合(データポイントの集合)を対象として、スワイプ方向を360度のリニアな角度で算出する。第1層は、極めて短い時間に発生するタッチイベントを用いることができるため、高速に角度を算出し続けることが可能となる。また第1層は、データポイントバッファが極めて短い既定の保持時間(例えば165ms)だけ保持するデータポイントの集合が示す角度を求めることにより、基準点を用いずにタッチパネル17に対してタッチ操作を行ったユーザが意図する方向の角度を求めることが可能となる。 Next, main functions and effects of the electronic device 10 according to the embodiment of the present invention will be described. This embodiment utilizes the feature of the projected capacitive touch panel that, when a finger is swiped on the touch panel 17, six or more touch events occur in an extremely short period of time such as 100 ms. The system architecture of the software implemented by the electronic device 10 has a three-layer structure in which the angle determination unit 24, the state determination unit 25, and the application unit 26 correspond to the first layer, the second layer, and the third layer, respectively. corresponds to game applications. The first layer calculates the swipe direction at a linear angle of 360 degrees for a set of multiple touch events (a set of data points) that occur. Since the first layer can use touch events that occur in an extremely short period of time, it is possible to continue calculating angles at high speed. In addition, the first layer performs a touch operation on the touch panel 17 without using a reference point by obtaining an angle indicated by a set of data points held by the data point buffer for an extremely short predetermined holding time (for example, 165 ms). It is possible to obtain the angle of the direction intended by the user.

なお、本実施形態の電子装置10は、スワイプ等のユーザの操作が複雑であっても、100msなどの極めて短い時間では、等速直線運動としてモデル化できるため、等速度運動の角度を連続的に算出することにより、任意の非線形関数(≒人間の操作)を予測・近似させることができるというコンセプトに基づいて設計されたものである。 Note that the electronic device 10 of the present embodiment can be modeled as uniform linear motion in an extremely short time such as 100 ms even if the user's operation such as swiping is complicated. It is designed based on the concept that any nonlinear function (≈human operation) can be predicted and approximated by calculating .

第1層は、変数Iの値が比較的大きく設定された場合、比較的低い頻度で角度を算出する。この場合、第1層は、タッチイベントが発生し始めた直後においても、例えばユーザが操作を開始した直後においても、データポイントバッファに比較的多くのデータポイントが保持されている状態で、角度を算出することになる。このように、変数Iの値を比較的大きく設定することにより、ユーザの操作を比較的緩やかに反映した角度を算出することが可能となる。一方、第1層は、変数Iの値が比較的小さく設定された場合、比較的高い頻度で角度を算出する。この場合、第1層は、タッチイベントが発生し始めた直後では、例えばユーザが操作を開始した直後では、データポイントバッファに比較的少数のデータポイントが保持されている状態で、角度を算出することになる。このように、変数Iの値を比較的小さく設定することにより、ユーザの操作を比較的即座に反映した角度を算出することが可能となる。 The first layer calculates angles relatively infrequently when the value of variable I is set relatively large. In this case, the first layer can be used to measure the angle with a relatively large number of data points held in the data point buffer even immediately after a touch event begins to occur, e.g. will be calculated. By setting the value of the variable I to a relatively large value in this way, it is possible to calculate an angle that relatively gently reflects the user's operation. On the other hand, in the first layer, when the value of the variable I is set relatively small, the angle is calculated relatively frequently. In this case, the first layer computes the angle with a relatively small number of data points held in the data point buffer just after a touch event begins to occur, e.g. It will be. By setting the value of the variable I to a relatively small value in this way, it is possible to calculate an angle that reflects the user's operation relatively immediately.

第1層は、データポイントの集合が示す角度を算出するにあたって、最小二乗法を用いて回帰直線の傾きを算出する。xを独立変数及びyを従属変数として固定した場合、y軸に沿った傾きの場合等は傾きを算出することが難しいため、第1層は、データポイントの変位量から独立変数及び従属変数を決定した後で、回帰直線の傾きを算出する。このような構成とすることにより、第1層は、安定的に回帰直線の傾きを算出することが可能となる。 The first layer uses the least squares method to calculate the slope of the regression line in calculating the angle indicated by the set of data points. When x is the independent variable and y is the dependent variable, it is difficult to calculate the slope along the y-axis. Once determined, the slope of the regression line is calculated. With such a configuration, the first layer can stably calculate the slope of the regression line.

第1層は、データポイントの集合が示す角度を算出するにあたって、ユーザがタッチパネル17上で指を動かす大まかな方向に対応するデータポイントの集合としての変位方向に基づいて、決定された回帰直線の傾きに対して180度回転させるか否かを示す回転量を決定する。このように、最小二乗法を用いて算出された回帰直線の傾きからは把握できない回転量を決定することにより、タッチパネル17に対してタッチ操作を行ったユーザが意図する方向の角度を求めることが可能となる。 In the first layer, when calculating the angle indicated by the set of data points, the regression line determined based on the displacement direction as a set of data points corresponding to the rough direction in which the user moves the finger on the touch panel 17. A rotation amount indicating whether to rotate 180 degrees with respect to the inclination is determined. Thus, by determining the amount of rotation that cannot be grasped from the slope of the regression line calculated using the least squares method, the angle of the direction intended by the user who performed the touch operation on the touch panel 17 can be obtained. It becomes possible.

第1層は、既定の処理時間ごとに、例えば既定の処理時間としてゲームアプリケーションにおけるフレームレートに対応する時間ごとに、データポイントの集合を対象として、スワイプ方向に対応する角度を算出する。第2層は、継続的に出力される角度情報を用いて、既定の処理時間ごとに、仮想コントローラの傾きの状態を示すベクトル量(角度及び大きさ)を決定し、ゲームアプリケーションへ出力する。このような構成とすることにより、本実施形態では、ゲームアプリケーションに対して、既定の処理時間ごとに算出された角度に基づいた入力を行うことが可能となる。また、このような構成とすることにより、いずれの層も、過去のタッチ座標を基準点として用いずに、第1層が算出するフレームレートごとの高頻度で正確な移動角度に基づいた入力を行うことが可能となる。このように、本実施形態では、電子装置10は、従来技術における仮想コントローラで使用されていた、開始点(開始座標)や終了点(終了座標)といった点という空間的な概念を使用せずに角度を算出する。 The first layer calculates the angle corresponding to the swipe direction for a set of data points every predetermined processing time, such as the predetermined processing time corresponding to the frame rate in the game application. The second layer uses the continuously output angle information to determine the vector quantity (angle and magnitude) indicating the tilt state of the virtual controller for each predetermined processing time, and outputs it to the game application. By adopting such a configuration, in the present embodiment, it is possible to perform an input based on the angle calculated for each predetermined processing time to the game application. Further, with such a configuration, none of the layers uses the past touch coordinates as a reference point, and inputs based on the high frequency and accurate movement angle for each frame rate calculated by the first layer are performed. can be done. Thus, in the present embodiment, the electronic device 10 does not use the spatial concept of points such as a start point (start coordinates) and an end point (end coordinates), which is used in the conventional virtual controller. Calculate the angle.

また本実施形態では、従来技術における仮想コントローラ、すなわち基準座標と現在の指示座標との間の位置関係によって得られるベクトルを用いた仮想コントローラとは異なり、基準座標の概念がないため、基準座標を定める仮想コントローラよりも高い応答性を提供することが可能である。特に仮想キャラクタ等の方向転換操作においては、方向転換前とは大きく異なる方向にユーザがタッチパネル上の操作を行ったとしても、現在の指示座標が基準座標に近づくという概念そのものがないため、ユーザの意図した操作内容に素早く応答して方向転換することができ、優位性が顕著である。また上記のように構成されることにより、スマートフォンで操作するユーザに対して片手での操作を可能とすることができる。これにより、ユーザが従来技術における仮想ジョイスティックの操作を行うにあたって、常に基準座標を意識する必要があり、片手での操作が難しい場合があるという問題点を解消することができる。このように、本実施形態では、より高速で直感的な操作を可能とする仮想コントローラを実現している。 Further, in this embodiment, unlike the virtual controller in the prior art, that is, the virtual controller using the vector obtained by the positional relationship between the reference coordinates and the currently indicated coordinates, there is no concept of the reference coordinates. It is possible to provide higher responsiveness than the defined virtual controller. In particular, in a direction change operation of a virtual character or the like, even if the user performs an operation on the touch panel in a direction significantly different from that before the direction change, there is no concept that the current indicated coordinates approach the reference coordinates. It can quickly respond to the intended operation content and change direction, which is a remarkable advantage. Moreover, by being configured as described above, it is possible to allow a user operating with a smartphone to operate with one hand. As a result, it is possible to solve the problem that the user always needs to be aware of the reference coordinates when operating the virtual joystick in the conventional technology, and it is sometimes difficult to operate with one hand. In this manner, the present embodiment realizes a virtual controller that enables faster and more intuitive operations.

また本実施形態では、電子装置10は、従来技術における仮想コントローラと異なり、基準座標からの指の移動距離に応じた入力ではないため、指の移動量がより少ない操作により、ユーザが意図する操作を実現することが可能となる。したがって、従来技術と比較して、より小さい実装面積で実現することが可能となる。例えば、タッチパネル17の大きさに関わらず、同一の操作性を実現することが可能となる。 Further, in the present embodiment, unlike the virtual controller in the conventional technology, the electronic device 10 does not perform input according to the finger movement distance from the reference coordinates. can be realized. Therefore, it is possible to achieve a smaller mounting area than in the prior art. For example, the same operability can be realized regardless of the size of the touch panel 17 .

また、本実施形態の電子装置10が提供する仮想コントローラの技術は、スワイプ操作からの角度の認識を数理的にモデル化しているため、360度の方向移動、加速・減速、格闘ゲームのようなコマンド入力等の幅広いジャンルに適用可能である。 In addition, the virtual controller technology provided by the electronic device 10 of the present embodiment mathematically models the recognition of angles from swipe operations. It is applicable to a wide range of genres such as command input.

上記の作用効果は、特に言及が無い限り、他の実施形態や他の実施例においても同様である。 The above effects are the same in other embodiments and examples unless otherwise specified.

本発明の他の実施形態では、上記で説明した本発明の実施形態の機能やフローチャートに示す情報処理を実現するプログラムや該プログラムを格納したコンピュータ読み取り可能な記憶媒体とすることもできる。また他の実施形態では、上記で説明した本発明の実施形態の機能やフローチャートに示す情報処理を実現する方法とすることもできる。また他の実施形態では、上記で説明した本発明の実施形態の機能やフローチャートに示す情報処理を実現するプログラムをコンピュータに供給することができるサーバとすることもできる。また他の実施形態では、上記で説明した本発明の実施形態の機能やフローチャートに示す情報処理を実現する仮想マシンとすることもできる。 In another embodiment of the present invention, a computer-readable storage medium storing a program for realizing the functions of the above-described embodiments of the present invention and the information processing shown in the flow charts and the program can be used. In other embodiments, the functions of the embodiments of the present invention described above and methods for realizing the information processing shown in the flowcharts can also be used. In another embodiment, a server can supply a computer with a program for realizing the functions of the embodiments of the present invention described above and the information processing shown in the flowcharts. In another embodiment, it can be a virtual machine that realizes the functions of the embodiment of the present invention described above and the information processing shown in the flowchart.

以下に本発明の実施形態の変形例について説明する。以下で述べる変形例は、矛盾が生じない限りにおいて、適宜組み合わせて本発明の任意の実施形態に適用することができる。 Modifications of the embodiments of the present invention will be described below. Modifications described below can be appropriately combined and applied to any embodiment of the present invention as long as there is no contradiction.

1つの変形例では、電子装置10は、仮想空間上に仮想的なオブジェクトを配置し、該仮想空間内に配置される仮想カメラによって撮影したゲーム画像をユーザに提示し、ゲームを進行するゲームアプリケーションがインストールされている。電子装置10は、当該ゲームアプリケーションが実行されると、仮想空間内に配置される仮想的なオブジェクトなどを、仮想空間内に配置される仮想カメラによって撮影したゲーム画像をタッチパネル17に表示し、ユーザの操作に応じて仮想カメラを制御する。このように、電子装置10は、当該ゲームアプリケーションが実行されると、ユーザの操作に応じて、操作対象オブジェクトである仮想カメラを制御するための仮想コントローラを提供する。仮想カメラの制御とは、仮想空間に配置された仮想カメラの動き又は視野領域の制御である。 In one modification, the electronic device 10 is a game application that arranges a virtual object in a virtual space, presents a game image taken by a virtual camera arranged in the virtual space to the user, and progresses the game. is installed. When the game application is executed, the electronic device 10 displays on the touch panel 17 a game image of a virtual object or the like placed in the virtual space, which is captured by a virtual camera placed in the virtual space. to control the virtual camera according to the operation of . In this way, when the game application is executed, the electronic device 10 provides a virtual controller for controlling the virtual camera, which is the operation target object, according to the user's operation. Controlling a virtual camera is controlling the movement or viewing area of a virtual camera placed in a virtual space.

図20は、本発明の一実施形態による電子装置10が表示する画像を撮影する仮想空間内に配置された仮想カメラ131を示す図である。図20は、仮想カメラ131の位置と、仮想カメラ131の視線方向132を示す。視線方向132は仮想カメラ131の位置を視点とする3次元ベクトルで定められる。仮想カメラ131から視線方向132に一定の視野角において視野領域が定められ、当該視野領域に視線方向132と垂直な面である2次元スクリーン133が定められる。2次元スクリーン133に対して、仮想空間内の仮想的なオブジェクトが投影され、2次元画像が形成される。 FIG. 20 is a diagram showing a virtual camera 131 arranged in a virtual space for capturing images displayed by the electronic device 10 according to one embodiment of the present invention. FIG. 20 shows the position of the virtual camera 131 and the viewing direction 132 of the virtual camera 131 . The line-of-sight direction 132 is determined by a three-dimensional vector with the position of the virtual camera 131 as the viewpoint. A viewing area is defined at a certain viewing angle in a line-of-sight direction 132 from the virtual camera 131, and a two-dimensional screen 133, which is a plane perpendicular to the line-of-sight direction 132, is defined in the viewing area. A virtual object in the virtual space is projected onto the two-dimensional screen 133 to form a two-dimensional image.

1つの変形例では、入力装置12と表示装置13は、別の位置に配置される別個の形態である。この場合、入力装置12は、タッチパネル又は投影型静電容量方式タッチパネルと同等の機能を有するデバイスである。表示装置13は、プロセッサ11の制御に従って、アプリケーション画面などを電子装置10のユーザに表示するものであればよく、例えば液晶ディスプレイ、有機ELを用いたディスプレイやプラズマディスプレイなどである。 In one variation, the input device 12 and the display device 13 are separate forms located at different locations. In this case, the input device 12 is a device having functions equivalent to those of a touch panel or projected capacitive touch panel. The display device 13 may display an application screen or the like to the user of the electronic device 10 under the control of the processor 11. For example, the display device 13 may be a liquid crystal display, a display using organic EL, a plasma display, or the like.

1つの変形例では、角度決定部24は、最小二乗法以外の既知の方法を用いて、回帰直線の傾きを算出する。この場合、角度決定部24は、決定された回帰直線の傾きに対して180度回転させるか否かを示す回転量を決定せず、これに伴い、独立変数の軸及び従属変数の軸を決定しない。例えば、カルマンフィルタ又はパーティクルフィルタなどのアルゴリズムを用いることができる。 In one modified example, the angle determination unit 24 calculates the slope of the regression line using a known method other than the method of least squares. In this case, the angle determination unit 24 does not determine the rotation amount indicating whether to rotate the determined regression line by 180 degrees, and accordingly determines the axis of the independent variable and the axis of the dependent variable. do not. For example, algorithms such as Kalman filter or particle filter can be used.

1つの変形例では、角度決定部24は、変数Dを定めず、データポイントバッファに保持されているデータポイントのうち既定の保持時間を超えたと判断されたデータポイントの保持を終了しない。この場合、角度決定部24は、変数Iで定める時間ごとに、変数Iで定める時間ずつずらした特定の時間帯に格納されたデータポイントを参照することにより角度を決定する。 In one variation, the angle determiner 24 does not define a variable D and does not stop holding data points held in the data point buffer that are determined to have exceeded a predetermined hold time. In this case, the angle determination unit 24 determines the angle by referring to the data points stored in the specific time period shifted by the time defined by the variable I for each time defined by the variable I.

1つの変形例では、角度決定部24は、変数Vを定めない。この場合、角度決定部24は、独立変数の分散の値に関わらず、関数aop(x,y)を用いて角度を算出し、決定する。 In one variant, the angle determiner 24 does not define the variable V. In this case, the angle determination unit 24 calculates and determines the angle using the function aop(x, y) regardless of the value of the variance of the independent variable.

1つの変形例では、電子装置10は重力方向を判定することが可能な加速度センサを備える。角度決定部24は、加速度センサから取得された情報を用いて重み係数を決定する。例えば、スマートフォンが縦持ちされてタッチパネル17のy軸が重力方向となる場合、角度決定部24はwを2に決定する。一方、スマートフォンが横持ちされてタッチパネル17のx軸が重力方向となり、かつゲームアプリケーションが備えるゲームエンジンが縦横の座標の変換をしない場合、角度決定部24はwを0.5などの1より小さい値に決定する。 In one variant, electronic device 10 comprises an acceleration sensor capable of determining the direction of gravity. The angle determination unit 24 determines weighting factors using information obtained from the acceleration sensor. For example, when the smartphone is held vertically and the y-axis of the touch panel 17 is the direction of gravity, the angle determination unit 24 determines w to be 2. On the other hand, when the smartphone is held horizontally and the x-axis of the touch panel 17 is the direction of gravity, and the game engine provided in the game application does not convert the vertical and horizontal coordinates, the angle determination unit 24 sets w to less than 1, such as 0.5. Decide on a value.

1つの変形例では、角度決定部24は、タッチイベントを取得するとき、2つの変数からなる数値の組(x、y)を取得し、データポイント取得時間tを対応付けずに、2つの変数からなる数値の組(x、y)をデータポイントバッファに格納する。例えば、角度決定部24は、データポイント取得時間tに対応する情報をデータポイントバッファ以外の記憶装置14内のメモリ領域などに記憶し、データポイントバッファに格納するデータに対応付けて管理することができる。 In one modification, the angle determination unit 24 acquires a set of numerical values (x, y) consisting of two variables when acquiring a touch event, and does not associate the data point acquisition time t with the two variables A set of numbers (x, y) consisting of are stored in the data point buffer. For example, the angle determining unit 24 may store information corresponding to the data point acquisition time t in a memory area or the like in the storage device 14 other than the data point buffer, and manage the information in association with the data stored in the data point buffer. can.

以上に説明した処理又は動作において、あるステップにおいて、そのステップではまだ利用することができないはずのデータを利用しているなどの処理又は動作上の矛盾が生じない限りにおいて、処理又は動作を自由に変更することができる。また以上に説明してきた各実施例は、本発明を説明するための例示であり、本発明はこれらの実施例に限定されるものではない。本発明は、その要旨を逸脱しない限り、種々の形態で実施することができる。 In the processes or operations described above, as long as there is no contradiction in the process or operation, such as using data that cannot be used at that step in a certain step, the process or operation can be freely performed. can be changed. Moreover, each embodiment described above is an illustration for explaining the present invention, and the present invention is not limited to these examples. The present invention can be embodied in various forms without departing from the gist thereof.

10 電子装置
11 プロセッサ
12 入力装置
13 表示装置
14 記憶装置
15 通信装置
16 バス
17 タッチパネル
21 入力部
22 表示部
23 制御部
24 角度決定部
25 状態決定部
26 アプリケーション部
31、33、35 角度
32、34、36 方向
81、82、83、84 回帰直線
91、92a、92b、93a、93b、94a、94b、94c 角度
120 集合
121 仮想キャラクタ
122 角度
131 仮想カメラ
132 視線方向
133 2次元スクリーン
10 electronic device 11 processor 12 input device 13 display device 14 storage device 15 communication device 16 bus 17 touch panel 21 input unit 22 display unit 23 control unit 24 angle determination unit 25 state determination unit 26 application unit 31, 33, 35 angles 32, 34 , 36 directions 81, 82, 83, 84 regression lines 91, 92a, 92b, 93a, 93b, 94a, 94b, 94c angle 120 set 121 virtual character 122 angle 131 virtual camera 132 viewing direction 133 two-dimensional screen

Claims (14)

タッチパネルを備える電子装置において実行されるプログラムであって、該電子装置に、
前記タッチパネルへのユーザの操作により発生したタッチイベントに基づいて取得される第1の軸の値及び第2の軸の値により示されるデータポイントを保持するステップと、
前記保持されているデータポイントのうち所定の変数に基づく特定の時間帯に保持されたデータポイント基づいて回帰直線の傾きを決定するステップと、
前記特定の時間帯に保持されデータポイントの集合としての変位方向に基づいて前記決定された回帰直線の傾きを回転させる回転量を決定するステップと、
前記決定された回帰直線の傾き及び前記決定された回転量に基づいて、前記ユーザが仮想空間内の操作対象オブジェクトを制御するための角度を決定するステップと、
を実行させるプログラム。
A program to be executed in an electronic device having a touch panel, the electronic device comprising:
holding data points indicated by a first axis value and a second axis value obtained based on a touch event generated by a user's operation on the touch panel;
determining the slope of a regression line based on the retained data points held at a particular time period based on a predetermined variable ;
determining a rotation amount by which to rotate the slope of the determined regression line based on the displacement direction as a set of data points held in the specific time period ;
determining an angle for the user to control the operation target object in the virtual space based on the determined slope of the regression line and the determined amount of rotation;
program to run.
前記回転量を決定するステップは、
前記保持されているデータポイントにおける時系列的に前後するデータポイントの変位方向に基づいて、前記操作対象オブジェクトを制御するための角度を決定するにあたって、前記決定された回帰直線の傾きに対して180度回転させるか否かを示す回転量を決定する、請求項1に記載のプログラム。
The step of determining the amount of rotation includes:
In determining the angle for controlling the operation target object based on the displacement directions of the data points that chronologically precede and follow in the retained data points, 180 is applied to the slope of the determined regression line. 2. The program according to claim 1, which determines an amount of rotation indicating whether to rotate by degrees.
前記プログラムは、前記電子装置に、
前記保持されているデータポイントにおける前記第1の軸の値の変位量及び前記第2の軸の値の変位量に基づいて、独立変数の軸として該第1の軸及び該第2の軸のいずれか一方の軸を決定するステップと、他方の軸を従属変数の軸として決定するステップと、を更に実行させ、
前記回帰直線の傾きを決定するステップは、
前記決定された独立変数の軸及び従属変数の軸に更に基づいて、回帰直線の傾きを決定する、請求項1又は2に記載のプログラム。
The program causes the electronic device to:
of the first axis and the second axis as independent variable axes based on the variability of the first axis value and the variability of the second axis value at the retained data points; further performing the steps of determining one of the axes and determining the other axis as the axis of the dependent variable;
Determining the slope of the regression line comprises:
3. The program according to claim 1 or 2, further comprising determining a slope of a regression line further based on the determined independent variable axis and dependent variable axis.
前記いずれか一方の軸を決定するステップは、
前記保持されているデータポイントにおける、前記第1の軸の最大値と最小値の差分値及び前記第2の軸の最大値と最小値の差分値に基づいて、独立変数の軸として前記いずれか一方の軸を決定する、請求項3に記載のプログラム。
The step of determining one of the axes includes:
any of the above as an axis of an independent variable based on the difference between the maximum and minimum values of the first axis and the difference between the maximum and minimum values of the second axis in the retained data points 4. A program according to claim 3, for determining one axis.
前記いずれか一方の軸を決定するステップは、
前記保持されているデータポイントにおける、前記第1の軸の最大値と最小値の差分値に対して重み付けを行った値及び前記第2の軸の最大値と最小値の差分値の大きさを比較することにより、独立変数の軸として前記いずれか一方の軸を決定する、請求項3又は4に記載のプログラム。
The step of determining one of the axes includes:
A value obtained by weighting the difference between the maximum value and the minimum value of the first axis and the magnitude of the difference value between the maximum value and the minimum value of the second axis in the retained data points 5. The program according to claim 3 or 4, wherein said one axis is determined as the axis of the independent variable by comparison.
前記回転量を決定するステップは、
前記保持されているデータポイントにおける時系列的に前後する、前記決定された独立変数の軸の値の差分値の正負の数量を比較することにより、前記操作対象オブジェクトを制御するための角度を決定するにあたって、前記決定された回帰直線の傾きに対して180度回転させるか否かを示す回転量を決定する、請求項3から5のいずれか1項に記載のプログラム。
The step of determining the amount of rotation includes:
An angle for controlling the operation target object is determined by comparing positive and negative amounts of difference values of the determined independent variable axis values chronologically before and after the held data points. 6. The program according to any one of claims 3 to 5, further comprising determining a rotation amount indicating whether or not to rotate the determined regression line by 180 degrees with respect to the determined slope of the regression line.
前記回帰直線の傾きを決定するステップは、
前記保持されているデータポイントにおける、独立変数の平均及び従属変数の平均を決定するステップと、
前記決定された平均を用いて、前記保持されているデータポイントにおける、独立変数の偏差及び従属変数の偏差を決定するステップと、
前記決定された独立変数の偏差を用いて、前記保持されているデータポイントにおける独立変数の分散を決定するステップと、
前記決定された独立変数の偏差及び従属変数の偏差を用いて、前記保持されているデータポイントにおける共分散を決定するステップと、
前記決定された共分散を前記決定された独立変数の分散で割ることにより回帰直線の傾きを決定するステップと、
を含む請求項3から6のいずれか1項に記載のプログラム。
Determining the slope of the regression line comprises:
determining the mean of the independent variables and the mean of the dependent variables at the retained data points;
determining the deviation of the independent variables and the deviation of the dependent variables in the retained data points using the determined means;
using the determined independent variable deviations to determine the variance of the independent variables in the retained data points;
using the determined independent variable deviations and dependent variable deviations to determine covariances in the retained data points;
determining the slope of a regression line by dividing the determined covariance by the determined independent variable variance;
7. The program according to any one of claims 3 to 6, comprising
前記第1の軸は、前記タッチパネルのセンサが配列される方向の短手方向を示すX軸であり、
前記第2の軸は、前記タッチパネルのセンサが配列される方向の長手方向を示し、前記第1の軸に直交するY軸であり、
前記回帰直線の傾きを決定するステップは、
前記決定された独立変数の軸が前記第2の軸である場合、前記決定された共分散を前記決定された独立変数の分散で割ることにより決定された回帰直線の傾きに対応する角度を、90度から引くことにより回帰直線の傾きを決定する、請求項7に記載のプログラム。
The first axis is an X-axis indicating a lateral direction of the direction in which the sensors of the touch panel are arranged,
The second axis is a Y-axis that indicates the longitudinal direction of the direction in which the sensors of the touch panel are arranged and is orthogonal to the first axis,
Determining the slope of the regression line comprises:
if the determined independent variable axis is the second axis, the angle corresponding to the slope of the regression line determined by dividing the determined covariance by the determined independent variable variance; 8. The program of claim 7, wherein the slope of the regression line is determined by subtracting from 90 degrees.
前記第1の軸は、前記タッチパネルのセンサが配列される方向の短手方向を示すX軸であり、前記第2の軸は、前記タッチパネルのセンサが配列される方向の長手方向を示し、前記第1の軸に直交するY軸である、請求項1から8のいずれか1項に記載のプログラム。 The first axis is an X-axis indicating a short direction in the direction in which the sensors of the touch panel are arranged, the second axis indicates a longitudinal direction in the direction in which the sensors of the touch panel are arranged, and the 9. A program according to any preceding claim, wherein the Y-axis is orthogonal to the first axis. 前記角度を決定するステップは、
既定の処理時間ごとに角度を決定する、請求項1から9のいずれか1項に記載のプログラム。
Determining the angle comprises:
10. The program according to any one of claims 1 to 9, wherein the angle is determined every predetermined processing time.
請求項10に記載のプログラムを含む、前記タッチパネルを備える前記電子装置において実行されるゲームのための一組のプログラムであって、
前記既定の処理時間は、ゲームを実行するためのフレームレートに対応する時間であり、
前記既定の処理時間ごとに決定される角度に基づいて、前記既定の処理時間ごとに角度及び大きさを決定するステップと、
前記既定の処理時間ごとに決定される角度及び大きさに基づいて、前記タッチパネルに表示される前記操作対象オブジェクトを制御するステップと、
を実行させる一組のプログラム。
A set of programs for a game executed on the electronic device comprising the touch panel, comprising the program of claim 10,
The predetermined processing time is a time corresponding to a frame rate for executing the game,
determining an angle and a size for each predetermined processing time based on the angle determined for each predetermined processing time;
a step of controlling the operation target object displayed on the touch panel based on the angle and size determined for each predetermined processing time;
A set of programs that run
請求項10に記載のプログラムを含む、前記タッチパネルを備える前記電子装置において実行されるゲームのための一組のプログラムであって、
前記既定の処理時間は、ゲームを実行するためのフレームレートに対応する時間であり、
前記既定の処理時間ごとに決定される角度に基づいて、前記既定の処理時間ごとに角度及び大きさを決定するステップと、
前記既定の処理時間ごとに決定される角度及び大きさに基づいて、前記タッチパネルに表示されるゲーム画像を撮影するための前記操作対象オブジェクトである仮想カメラを制御するステップと、
を実行させる一組のプログラム。
A set of programs for a game executed on the electronic device comprising the touch panel, comprising the program of claim 10,
The predetermined processing time is a time corresponding to a frame rate for executing the game,
determining an angle and a size for each predetermined processing time based on the angle determined for each predetermined processing time;
a step of controlling a virtual camera, which is the operation target object for capturing a game image displayed on the touch panel, based on the angle and size determined for each predetermined processing time;
A set of programs that run
タッチパネルを備える電子装置であって、
前記タッチパネルへのユーザの操作により発生したタッチイベントに基づいて取得される第1の軸の値及び第2の軸の値により示されるデータポイントを保持し、
前記保持されているデータポイントのうち所定の変数に基づく特定の時間帯に保持されたデータポイント基づいて回帰直線の傾きを決定し、
前記特定の時間帯に保持されデータポイントの集合としての変位方向に基づいて前記決定された回帰直線の傾きを回転させる回転量を決定し、
前記決定された回帰直線の傾き及び前記決定された回転量に基づいて、前記ユーザが仮想空間内の操作対象オブジェクトを制御するための角度を決定する、
電子装置。
An electronic device comprising a touch panel,
holding data points indicated by a first axis value and a second axis value obtained based on a touch event generated by a user's operation on the touch panel;
determining a slope of a regression line based on data points retained at a particular time period based on a predetermined variable among the retained data points;
Determining a rotation amount for rotating the slope of the determined regression line based on the displacement direction as a set of data points held in the specific time period ,
determining an angle for the user to control the operation target object in the virtual space based on the determined slope of the regression line and the determined amount of rotation;
electronic device.
タッチパネルを備える電子装置において実行される方法であって、
前記タッチパネルへのユーザの操作により発生したタッチイベントに基づいて取得される第1の軸の値及び第2の軸の値により示されるデータポイントを保持するステップと、
前記保持されているデータポイントのうち所定の変数に基づく特定の時間帯に保持されたデータポイント基づいて回帰直線の傾きを決定するステップと、
前記特定の時間帯に保持されデータポイントの集合としての変位方向に基づいて前記決定された回帰直線の傾きを回転させる回転量を決定するステップと、
前記決定された回帰直線の傾き及び前記決定された回転量に基づいて、前記ユーザが仮想空間内の操作対象オブジェクトを制御するための角度を決定するステップと、
を有する方法。
A method performed in an electronic device comprising a touch panel, comprising:
holding data points indicated by a first axis value and a second axis value obtained based on a touch event generated by a user's operation on the touch panel;
determining the slope of a regression line based on the retained data points held at a particular time period based on a predetermined variable ;
determining a rotation amount by which to rotate the slope of the determined regression line based on the displacement direction as a set of data points held in the specific time period ;
determining an angle for the user to control the operation target object in the virtual space based on the determined slope of the regression line and the determined amount of rotation;
How to have
JP2018133541A 2018-07-13 2018-07-13 Programs, electronic devices, and methods Active JP7250451B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2018133541A JP7250451B2 (en) 2018-07-13 2018-07-13 Programs, electronic devices, and methods

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2018133541A JP7250451B2 (en) 2018-07-13 2018-07-13 Programs, electronic devices, and methods

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP2018094656A Division JP6389581B1 (en) 2018-05-16 2018-05-16 Program, electronic apparatus, and method

Publications (2)

Publication Number Publication Date
JP2019200765A JP2019200765A (en) 2019-11-21
JP7250451B2 true JP7250451B2 (en) 2023-04-03

Family

ID=68611263

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2018133541A Active JP7250451B2 (en) 2018-07-13 2018-07-13 Programs, electronic devices, and methods

Country Status (1)

Country Link
JP (1) JP7250451B2 (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3734820B1 (en) 2004-09-03 2006-01-11 任天堂株式会社 GAME PROGRAM, GAME DEVICE, AND INPUT DEVICE
WO2013038630A1 (en) 2011-09-13 2013-03-21 パナソニック株式会社 Information inputting device, and information inputting method
JP2014154055A (en) 2013-02-13 2014-08-25 Mitsubishi Electric Corp Image processor and image processing method
JP6389581B1 (en) 2018-05-16 2018-09-12 株式会社Cygames Program, electronic apparatus, and method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3734820B1 (en) 2004-09-03 2006-01-11 任天堂株式会社 GAME PROGRAM, GAME DEVICE, AND INPUT DEVICE
WO2013038630A1 (en) 2011-09-13 2013-03-21 パナソニック株式会社 Information inputting device, and information inputting method
JP2014154055A (en) 2013-02-13 2014-08-25 Mitsubishi Electric Corp Image processor and image processing method
JP6389581B1 (en) 2018-05-16 2018-09-12 株式会社Cygames Program, electronic apparatus, and method

Also Published As

Publication number Publication date
JP2019200765A (en) 2019-11-21

Similar Documents

Publication Publication Date Title
JP6389581B1 (en) Program, electronic apparatus, and method
US10761612B2 (en) Gesture recognition techniques
KR20190141748A (en) Method and device for detecting plane and / or quadtrees for use as a virtual substrate
US12121797B2 (en) Program, electronic device, and method
JP7162079B2 (en) A recording medium for recording a method, system and computer program for remotely controlling a display device via head gestures
KR20130098907A (en) Information processing apparatus, control method thereof, and storage medium
US10073609B2 (en) Information-processing device, storage medium, information-processing method and information-processing system for controlling movement of a display area
JP7250451B2 (en) Programs, electronic devices, and methods
CN118092749A (en) Touch area determination method, device, electronic device and storage medium
HK40037105A (en) Storage medium, electronic device, and method
JP7471782B2 (en) Program, electronic device, and method
HK40037105B (en) Storage medium, electronic device, and method
JP7143364B2 (en) Method, program and electronic device
JP6911216B1 (en) Methods, programs, and electronics
HK40046182A (en) Computer readable medium, electronic device, and method
JP7373090B1 (en) Information processing system, information processing device, program and information processing method
HK40046182B (en) Computer readable medium, electronic device, and method
HK40082831A (en) Method, program, and electronic device
CN117112094A (en) Control interaction method and device, storage medium and electronic device

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20210517

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20220629

A601 Written request for extension of time

Free format text: JAPANESE INTERMEDIATE CODE: A601

Effective date: 20220829

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20221027

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20230322

R150 Certificate of patent or registration of utility model

Ref document number: 7250451

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250