CN104548596B - 一种射击游戏的瞄准方法及装置 - Google Patents

一种射击游戏的瞄准方法及装置 Download PDF

Info

Publication number
CN104548596B
CN104548596B CN201510054312.5A CN201510054312A CN104548596B CN 104548596 B CN104548596 B CN 104548596B CN 201510054312 A CN201510054312 A CN 201510054312A CN 104548596 B CN104548596 B CN 104548596B
Authority
CN
China
Prior art keywords
rotation
video camera
anglec
virtual video
acceleration magnitude
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
CN201510054312.5A
Other languages
English (en)
Other versions
CN104548596A (zh
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.)
Guangzhou quasi real network technology Co., Ltd.
Original Assignee
Guangzhou Travel Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangzhou Travel Network Technology Co Ltd filed Critical Guangzhou Travel Network Technology Co Ltd
Priority to CN201510054312.5A priority Critical patent/CN104548596B/zh
Priority to US14/903,605 priority patent/US9914047B2/en
Priority to PCT/CN2015/072789 priority patent/WO2016123816A1/zh
Priority to EP15816637.1A priority patent/EP3069766A4/en
Publication of CN104548596A publication Critical patent/CN104548596A/zh
Application granted granted Critical
Publication of CN104548596B publication Critical patent/CN104548596B/zh
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/20Input arrangements for video game devices
    • A63F13/21Input arrangements for video game devices characterised by their sensors, purposes or types
    • A63F13/211Input arrangements for video game devices characterised by their sensors, purposes or types using inertial sensors, e.g. accelerometers or gyroscopes
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/20Input arrangements for video game devices
    • A63F13/21Input arrangements for video game devices characterised by their sensors, purposes or types
    • A63F13/214Input arrangements for video game devices characterised by their sensors, purposes or types for locating contacts on a surface, e.g. floor mats or touch pads
    • A63F13/2145Input arrangements for video game devices characterised by their sensors, purposes or types for locating contacts on a surface, e.g. floor mats or touch pads the surface being also a display device, e.g. touch screens
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/50Controlling the output signals based on the game progress
    • A63F13/52Controlling the output signals based on the game progress involving aspects of the displayed game scene
    • A63F13/525Changing parameters of virtual cameras
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/50Controlling the output signals based on the game progress
    • A63F13/52Controlling the output signals based on the game progress involving aspects of the displayed game scene
    • A63F13/525Changing parameters of virtual cameras
    • A63F13/5255Changing parameters of virtual cameras according to dedicated instructions from a player, e.g. using a secondary joystick to rotate the camera around a player's character
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/80Special adaptations for executing a specific game genre or game mode
    • A63F13/837Shooting of targets
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/90Constructional details or arrangements of video game devices not provided for in groups A63F13/20 or A63F13/25, e.g. housing, wiring, connections or cabinets
    • A63F13/92Video game devices specially adapted to be hand-held while playing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/03Arrangements for converting the position or the displacement of a member into a coded form
    • G06F3/033Pointing devices displaced or positioned by the user, e.g. mice, trackballs, pens or joysticks; Accessories therefor
    • G06F3/0346Pointing devices displaced or positioned by the user, e.g. mice, trackballs, pens or joysticks; Accessories therefor with detection of the device orientation or free movement in a 3D space, e.g. 3D mice, 6-DOF [six degrees of freedom] pointers using gyroscopes, accelerometers or tilt-sensors
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/03Arrangements for converting the position or the displacement of a member into a coded form
    • G06F3/033Pointing devices displaced or positioned by the user, e.g. mice, trackballs, pens or joysticks; Accessories therefor
    • G06F3/0354Pointing devices displaced or positioned by the user, e.g. mice, trackballs, pens or joysticks; Accessories therefor with detection of 2D relative movements between the device, or an operating part thereof, and a plane or surface, e.g. 2D mice, trackballs, pens or pucks
    • G06F3/03547Touch pads, in which fingers can move on a surface
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0481Interaction techniques based on graphical user interfaces [GUI] based on specific properties of the displayed interaction object or a metaphor-based environment, e.g. interaction with desktop elements like windows or icons, or assisted by a cursor's changing behaviour or appearance
    • G06F3/04815Interaction with a metaphor-based environment or interaction object displayed as three-dimensional, e.g. changing the user viewpoint with respect to the environment or object
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0481Interaction techniques based on graphical user interfaces [GUI] based on specific properties of the displayed interaction object or a metaphor-based environment, e.g. interaction with desktop elements like windows or icons, or assisted by a cursor's changing behaviour or appearance
    • G06F3/0482Interaction with lists of selectable items, e.g. menus
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0484Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
    • G06F3/04842Selection of displayed objects or displayed text elements
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0487Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser
    • G06F3/0488Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser using a touch-screen or digitiser, e.g. input of commands through traced gestures
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F2300/00Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game
    • A63F2300/10Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game characterized by input arrangements for converting player-generated signals into game device control signals
    • A63F2300/105Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game characterized by input arrangements for converting player-generated signals into game device control signals using inertial sensors, e.g. accelerometers, gyroscopes
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F2300/00Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game
    • A63F2300/10Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game characterized by input arrangements for converting player-generated signals into game device control signals
    • A63F2300/1068Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game characterized by input arrangements for converting player-generated signals into game device control signals being specially adapted to detect the point of contact of the player on a surface, e.g. floor mat, touch pad
    • A63F2300/1075Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game characterized by input arrangements for converting player-generated signals into game device control signals being specially adapted to detect the point of contact of the player on a surface, e.g. floor mat, touch pad using a touch screen
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F2300/00Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game
    • A63F2300/20Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game characterised by details of the game platform
    • A63F2300/204Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game characterised by details of the game platform the platform being a handheld device
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2203/00Indexing scheme relating to G06F3/00 - G06F3/048
    • G06F2203/038Indexing scheme relating to G06F3/038
    • G06F2203/0381Multimodal input, i.e. interface arrangements enabling the user to issue commands by simultaneous use of input devices of different nature, e.g. voice plus gesture on digitizer

Abstract

本发明涉及一种射击游戏的瞄准方法,其应用于具有触摸显示屏的移动终端,包括如下步骤,定位步骤,当所述移动终端处于游戏界面时,获取虚拟摄像机当前的旋转角度;旋转步骤,当检测到所述游戏界面有接触时,获取接触对象的坐标位置,以使所述虚拟摄像机当前的旋转角度与所述坐标位置匹配;调整步骤,当检测到所述移动终端晃动时,通过所述移动终端的传感器获取相应的晃动角度,以使所述虚拟摄像机当前的旋转角度与所述晃动角度匹配。本发明还涉及一种射击游戏的瞄准装置。本发明方便虚拟摄像机准确进行转向瞄准,同时能够有效地提高玩家在游戏过程中的体验度。

Description

一种射击游戏的瞄准方法及装置
技术领域
本发明涉及一种移动游戏中的瞄准的技术,尤其涉及一种移动触屏终端上的射击游戏的瞄准方法及装置。
背景技术
移动游戏是一种用户通过移动通讯网络在移动触屏终端如手机、平板电脑等平台上操作的电子游戏业务,其包括棋牌游戏、角色游戏、策略游戏、动作游戏等。射击游戏作为动作游戏中一种,目前其通过虚拟摄像机进行瞄准射击的实现通常使用如下的方案,如现在移动触屏终端上的主流的FPS(如现代战争系列)和TPS(如火线指令系列)都使用了双摇杆的操作方案,这种方案就是在触屏上模拟两个摇杆,左摇杆控制目标移动,右摇杆控制虚拟摄像机的镜头瞄准射击。这套方案看似合理,但实际上并不符合人体工学:
首先,用右摇杆替代了鼠标操作,意味着要求完全用右手拇指完成之前要整个手臂配合才能完成的一系列复杂、精细、快速的操作。导致玩家在转向、瞄准的时候困难重重,操作结果错漏百出;
其次,虚拟摇杆不能像真实摇杆或鼠标那样给玩家的手予以反馈,任何操作都需要用户自己的眼睛去观察校准,进一步增加了操作难度。
以上两点会导致用户游戏时的体验挫折感升高,整体感觉下降,从而使得FPS和TPS在移动触屏设备上受众狭窄、发展困难,远达不到本该有的市场效果。
发明内容
针对现有技术的不足,本发明的目的旨在于提供一种方便虚拟摄像机准确进行转向瞄准,同时能有效提高游戏体验度的射击游戏的瞄准方法。
为实现上述目的,本发明采用如下技术方案:
一种射击游戏的瞄准方法,其应用于具有触摸显示屏的移动终端,其特征在于,包括如下步骤:
定位步骤,当所述移动终端处于游戏界面时,获取虚拟摄像机当前的旋转角度;
旋转步骤,当检测到所述游戏界面有接触时,获取接触对象的坐标位置,以使所述虚拟摄像机当前的旋转角度与所述坐标位置匹配;
调整步骤,当检测到所述移动终端晃动时,通过所述移动终端的传感器获取相应的晃动角度,以使所述虚拟摄像机当前的旋转角度与所述晃动角度匹配。
优选的,旋转步骤包括如下子步骤:
确定对象步骤,当检测到所述游戏界面有接触时,检测所有处于触摸状态的列表对象,获得处于点击游戏界面状态的列表对象并将其记为接触对象,获取所述接触对象的坐标位置;
辅助步骤,根据辅助函数创建一条以虚拟摄像机的近裁面为起点并穿过所述坐标位置的辅助射线,获取所述辅助射线的旋转角度;
确定增量步骤,通过循环函数得出所述虚拟摄像机当前的旋转角度到所述辅助射线的旋转角度的中间插值;
应用增量步骤,将中间插值应用到虚拟摄像机上,使得虚拟摄像机的旋转幅度与中间插值相等,记录虚拟摄像机旋转之后的旋转角度;
判断步骤,若虚拟摄像机旋转之后的旋转角度与辅助射线的旋转角度相匹配,则完成虚拟摄像机的初步移动,若否则返回确定增量步骤。
优选的,调整步骤中的传感器为陀螺仪,通过启动陀螺仪,获取陀螺仪的重力参数值以控制虚拟摄像机的旋转角度。
优选的,调整步骤中的传感器为重力传感器,通过启动重力传感器,实时获取重力传感器的加速度值,判断所述加速度值每秒产生的角变化量,若所述角变化量超过预设阈值,则根据变化后的角变化量控制虚拟摄像机的旋转角度。
优选的,所述加速度值为三维向量值,其由X轴加速度值、Y轴加速度值和Z轴加速度值构成,其中X轴加速度值、Y轴加速度值和Z轴加速度值的大小范围均在为-1至1之间。
本发明还提出一种射击游戏的瞄准装置,包括如下模块:
定位模块,用于当所述移动终端处于游戏界面时,获取虚拟摄像机当前的旋转角度;
旋转模块,用于当检测到所述游戏界面有接触时,获取接触对象的坐标位置,以使所述虚拟摄像机当前的旋转角度与所述坐标位置匹配;
调整模块,用于当检测到所述移动终端晃动时,通过所述移动终端的传感器获取相应的晃动角度,以使所述虚拟摄像机当前的旋转角度与所述晃动角度匹配。
优选的,所述旋转模块包括如下子模块:
确定对象模块,用于当检测到所述游戏界面有接触时,检测所有处于触摸状态的列表对象,获得处于点击游戏界面状态的列表对象并将其记为接触对象,获取所述接触对象的坐标位置;
辅助模块,用于根据辅助函数创建一条以虚拟摄像机的近裁面为起点并穿过所述坐标位置的辅助射线,获取所述辅助射线的旋转角度;
确定增量模块,用于通过循环函数得出所述虚拟摄像机当前的旋转角度到所述辅助射线的旋转角度的中间插值;
应用增量模块,用于将中间插值应用到虚拟摄像机上,使得虚拟摄像机的旋转幅度与中间插值相等,记录虚拟摄像机旋转之后的旋转角度;
判断模块,用于若虚拟摄像机旋转之后的旋转角度与辅助射线的旋转角度相匹配,则完成虚拟摄像机的初步移动,若否则返回确定增量模块。
优选的,调整模块中的传感器为陀螺仪,通过启动陀螺仪,获取陀螺仪的重力参数值以控制虚拟摄像机的旋转角度。
优选的,调整模块中的传感器为重力传感器,通过启动重力传感器,实时获取重力传感器的加速度值,判断所述加速度值每秒产生的角变化量,若所述角变化量超过预设阈值,则根据变化后的角变化量控制虚拟摄像机的旋转角度。
优选的,所述加速度值为三维向量值,其由X轴加速度值、Y轴加速度值和Z轴加速度值构成,其中X轴加速度值、Y轴加速度值和Z轴加速度值的大小范围均在为-1至1之间。
本发明的有益效果如下:该方法方便虚拟摄像机准确进行转向瞄准,同时能够有效地提高玩家对游戏的体验度;本方案采用触屏与重力传感器或陀螺仪相结合的方式,即在检测到接触对象后,完成虚拟摄像机的初步转动,通过重力传感器或陀螺仪对虚拟摄像机的旋转角度进行精确的调整,从而方便了虚拟摄像机准确瞄准的接触对象,进一步提高了玩家在游戏过程中的体验度。
附图说明
图1为本发明一种射击游戏的瞄准方法的较佳实施方式的流程图。
图2为本发明一种射击游戏的瞄准方法中旋转步骤的较佳实施方式的流程图。
具体实施方式
下面将结合附图以及具体实施方式,对本发明做进一步描述:
请参见图1,本实施例涉及一种射击游戏的瞄准方法,其应用于具有触摸显示屏的移动终端,包括如下步骤:
定位步骤S1,当移动终端处于游戏界面时,获取虚拟摄像机当前的旋转角度。其中,虚拟摄像机就是玩家在3D游戏中的“眼睛”,该虚拟摄像机拍摄到的景物就是玩家在屏幕上看到景物,全游戏中一个场景内只有唯一一个虚拟摄像机。该虚拟摄像机当前的旋转角度是一个四元数,四元数可以看做是一个四维向量,用来表示物体在空间中的旋转等。
旋转步骤S2,当检测到游戏界面有接触时,获取接触对象的坐标位置,以使虚拟摄像机当前的旋转角度与坐标位置匹配。具体的,在游戏过程中,这是一个粗调准星位置的步骤,即一检测到游戏界面有接触,虚拟摄像机进行旋转并对准有接触的范围,可以使得有接触的范围显示在移动终端的触摸显示屏上的预设位置,该预设位置可以是屏幕中央。该步骤可以通过点击触屏实现,对应键鼠FPS里玩家用肩肘快速滑动鼠标、转向并大致瞄准目标的操作,以此完成虚拟摄像机大幅转动的操作,此时旋转角度往往大于10度,当然也可以根据实际情况设定虚拟摄像机大幅转动的旋转角度大于多少度。
调整步骤S3,当检测到移动终端晃动时,通过移动终端的传感器获取相应的晃动角度,以使虚拟摄像机当前的旋转角度与晃动角度匹配。具体的,在游戏过程中,这是一个微调准星位置的步骤,当游戏中的接触范围显示在移动终端的触摸显示屏上的预设位置时,通过传感器来实现精确的瞄准。该步骤可以通过晃动移动终端、通过传感器来实现,对应键鼠FPS里玩家用手腕轻轻挪动鼠标、瞄准目标头部的操作,即以此完成虚拟摄像机细微转动的操作,此时旋转角度往往小于5度,当然也可以根据实际情况设定虚拟摄像机细微转动的旋转角度小于多少度。
如图2所示,旋转步骤S2可以包括如下子步骤:
确定对象步骤S2a,当点击游戏界面时,检测所有处于触摸状态的列表对象,获得处于点击游戏界面状态的列表对象并将其记为接触对象,获取接触对象的坐标位置touchPosition。
辅助步骤S2b,根据辅助函数创建一条以虚拟摄像机的近裁面为起点并穿过坐标位置touchPosition的辅助射线Ray,获取辅助射线Ray的旋转角度touchQ。该辅助函数可以是Unity函数ScreenPointToRay。
确定增量步骤S2c,通过循环函数得出虚拟摄像机当前的旋转角度到辅助射线的旋转角度touchQ的中间插值lerpQ。该循环函数可以是Update、FixedUpdate、InvokeRepeating以及协程while函数中的任一函数。中间插值lerpQ是一个不断靠拢辅助射线方向的四元数,因为四元数是一个可以规范化的四维向量,适用于各种插值,如线性插值算法:q(t)=(1-t)q1+t q2/||(1-t)q1+tq2||,更多信息可查阅《阴山学刊:自然科学版》2012年第1期郑军所著的“四元数插值算法实现游戏较色平滑旋转”。
应用增量步骤S2d,将中间插值lerpQ应用到虚拟摄像机上,使得虚拟摄像机的旋转幅度与中间插值lerpQ相等,记录虚拟摄像机旋转之后的旋转角度。
判断步骤S2e,若虚拟摄像机旋转之后的旋转角度与辅助射线的旋转角度相匹配,则完成虚拟摄像机的初步移动,此时虚拟摄像机的旋转角度与辅助射线Ray的旋转角度一致,若否则返回确定增量步骤S2c。
优选的,调整步骤中的传感器可以是为陀螺仪,通过启动陀螺仪,获取陀螺仪的重力参数值以控制虚拟摄像机的旋转角度。
具体的,陀螺仪启动之后,获取陀螺仪的重力参数X、Y轴的值,将X、Y轴的值乘以一定的放大倍数系数,即将获取的X、Y轴的值作为基础值,预定义此基础值的放大倍数系数,并自定义设定放大倍数系数越大则虚拟摄像机的旋转幅度越大,将放大后的X、Y轴的值作为四元数的欧拉角应用到虚拟摄像机。陀螺仪确定物体空间姿态的数值随着物体的旋转在不断改变,将不断获得的重力参数X、Y轴的值乘以自定义的放大倍数从而得出需要得到的虚拟摄像机的最终旋转角度。
当然,调整步骤中的传感器可以为重力传感器,也可以是其他能够获取相应晃动角度的传感器。在调整步骤中通过启动重力传感器,实时获取重力传感器的加速度值,判断加速度值每秒产生的角变化量,若角变化量超过预设阈值,则根据变化后的角变化量控制虚拟摄像机的旋转角度。进一步的,加速度值为三维向量值,其由X轴加速度值、Y轴加速度值和Z轴加速度值构成,其中X轴加速度值、Y轴加速度值和Z轴加速度值的大小范围均在为-1至1之间。
具体的,可根据Input.acceleration实时获取移动终端中的重力传感器的加速度值,此加速度值为一个三维向量,其中X轴上的数值的大小范围在-1至1之间,Y轴上的数值的大小范围在-1至1之间,Z轴上的数值的大小范围在-1之间1。其具体的原理可以是,将手机正面朝上平放,根据右手原则,将右手伸开手心朝上,四指并拢与大拇指垂直,大拇指指示方向为X轴,值为一个三维向量(0,0,0),四指指示方向为Y轴,值为一个三维向量(0,0,0),垂直手心向上为Z轴,值为一个三维向量(0,0,-1),旋转移动终端时,假设有一垂直向下的向量,那么X轴、Y轴、Z轴的值分别与该向量对比,方向一致时为1,方向相反时为-1,方向垂直时为0。
将X轴、Y轴的改变数值乘以一个预定义系数后应用到四元数中的欧拉角X轴、Y轴的值中,从而获得一个四元数并假设定义名称为accQ。即根据移动终端的不同空间姿态不断获得的一个三维向量,旋转移动终端时此三维向量值也在不断改变,比如X轴改变0.1,Y轴改变0.2,则用一个三维向量(0.1,0.2,0)表示。其中,预定义系数为单位时间内旋转改变多少角度,即角度/秒,如可预定义当X轴每改变0.1则改变5度,也就是说预定义系数越大,则应用到虚拟摄像机上时虚拟摄像机的旋转幅度越大。
计算实时的四元数accQ及其上一次的四元数accQ的夹角,只有夹角大于预设阈值时才应用实时的四元数accQ。具体的,判断夹角是否大于预设阈值,可以根据实时的四元数accQ及其上一次的四元数accQ获得一个旋转角度lastQ,根据角弧度换算1度大约为0.0174533弧度,用lastQ的弧度与0.0174533比较,若lastQ大于0.0174533时则认为lastQ大于预设阀值。
将四元数accQ的欧拉角应用到摄像机中,让摄像机随着移动终端的空间姿态而旋转移动,从而完成精准地瞄准接触对象的过程。具体的,四元数是一个四维向量(x,y,z,w),对空间物体的旋转等操作通过一个4×4矩阵实现,不能简单的取到向量的旋转角度,欧拉角是一个三维向量(x,y,z),表示X轴、Y轴、Z轴这三个轴的旋转角度,若取X轴、Y轴的旋转角度,可以实现四元数到欧拉角的转化,如在unity中封装为Quaternion.eulerAngles。
本实施例还提出一种射击游戏的瞄准装置,包括如下模块:
定位模块,用于当移动终端处于游戏界面时,获取虚拟摄像机当前的旋转角度;
旋转模块,用于当检测到游戏界面有接触时,获取接触对象的坐标位置,以使虚拟摄像机当前的旋转角度与坐标位置匹配;
调整模块,用于当检测到移动终端晃动时,通过移动终端的传感器获取相应的晃动角度,以使虚拟摄像机当前的旋转角度与晃动角度匹配。
优选的,旋转模块包括如下子模块:
确定对象模块,用于当点击游戏界面时,检测所有处于触摸状态的列表对象,获得处于点击游戏界面状态的列表对象并将其记为接触对象,获取接触对象的坐标位置;
辅助模块,用于根据辅助函数创建一条以虚拟摄像机的近裁面为起点并穿过坐标位置的辅助射线,获取辅助射线的旋转角度;
确定增量模块,用于通过循环函数得出虚拟摄像机当前的旋转角度到辅助射线的旋转角度的中间插值;
应用增量模块,用于将中间插值应用到虚拟摄像机上,使得虚拟摄像机的旋转幅度与中间插值相等,记录虚拟摄像机旋转之后的旋转角度;
判断模块,用于若虚拟摄像机旋转之后的旋转角度与辅助射线的旋转角度相匹配,则完成虚拟摄像机的初步移动,若否则返回确定增量模块。
优选的,调整模块中的传感器为陀螺仪,通过启动陀螺仪,获取陀螺仪的重力参数值以控制虚拟摄像机的旋转角度。
优选的,调整模块中的传感器为重力传感器,通过启动重力传感器,实时获取重力传感器的加速度值,判断所述加速度值每秒产生的角变化量,若所述角变化量超过预设阈值,则根据变化后的角变化量控制虚拟摄像机的旋转角度。
优选的,所述加速度值为三维向量值,其由X轴加速度值、Y轴加速度值和Z轴加速度值构成,其中X轴加速度值、Y轴加速度值和Z轴加速度值的大小范围均在为-1至1之间。
对于本领域的技术人员来说,可根据以上描述的技术方案以及构思,做出其它各种相应的改变以及变形,而所有的这些改变以及变形都应该属于本发明权利要求的保护范围之内。

Claims (8)

1.一种射击游戏的瞄准方法,其应用于具有触摸显示屏的移动终端,其特征在于,包括如下步骤:
定位步骤,当所述移动终端处于游戏界面时,获取虚拟摄像机当前的旋转角度;
旋转步骤,当检测到所述游戏界面有接触时,获取接触对象的坐标位置,以使所述虚拟摄像机当前的旋转角度与所述坐标位置匹配;
调整步骤,当检测到所述移动终端晃动时,通过所述移动终端的传感器获取相应的晃动角度,以使所述虚拟摄像机当前的旋转角度与所述晃动角度匹配;
所述旋转步骤包括如下子步骤:
确定对象步骤,当检测到所述游戏界面有接触时,检测所有处于触摸状态的列表对象,获得处于点击游戏界面状态的列表对象并将其记为接触对象,获取所述接触对象的坐标位置;
辅助步骤,根据辅助函数创建一条以虚拟摄像机的近裁面为起点并穿过所述坐标位置的辅助射线,获取所述辅助射线的旋转角度;
确定增量步骤,通过循环函数得出所述虚拟摄像机当前的旋转角度到所述辅助射线的旋转角度的中间插值;
应用增量步骤,将中间插值应用到虚拟摄像机上,使得虚拟摄像机的旋转幅度与中间插值相等,记录虚拟摄像机旋转之后的旋转角度;
判断步骤,若虚拟摄像机旋转之后的旋转角度与辅助射线的旋转角度相匹配,则完成虚拟摄像机的初步移动,若否则返回确定增量步骤。
2.如权利要求1所述的射击游戏的瞄准方法,其特征在于,调整步骤中的传感器为陀螺仪,启动陀螺仪,获取陀螺仪的重力参数值以控制虚拟摄像机的旋转角度。
3.如权利要求1所述的射击游戏的瞄准方法,其特征在于,调整步骤中的传感器为重力传感器,通过启动重力传感器,实时获取重力传感器的加速度值,判断所述加速度值每秒产生的角变化量,若所述角变化量超过预设阈值,则根据变化后的角变化量控制虚拟摄像机的旋转角度。
4.如权利要求3所述的射击游戏的瞄准方法,其特征在于,所述加速度值为三维向量值,其由X轴加速度值、Y轴加速度值和Z轴加速度值构成,其中X轴加速度值、Y轴加速度值和Z轴加速度值的大小范围均在为-1至1之间。
5.一种射击游戏的瞄准装置,其应用于具有触摸显示屏的移动终端,其特征在于,包括如下模块:
定位模块,用于当所述移动终端处于游戏界面时,获取虚拟摄像机当前的旋转角度;
旋转模块,用于当检测到所述游戏界面有接触时,获取接触对象的坐标位置,以使所述虚拟摄像机当前的旋转角度与所述坐标位置匹配;
调整模块,用于当检测到所述移动终端晃动时,通过所述移动终端的传感器获取相应的晃动角度,以使所述虚拟摄像机当前的旋转角度与所述晃动角度匹配;
所述旋转模块包括子模块:
确定对象模块,用于当检测到所述游戏界面有接触时,检测所有处于触摸状态的列表对象,获得处于点击游戏界面状态的列表对象并将其记为接触对象,获取所述接触对象的坐标位置;
辅助模块,用于根据辅助函数创建一条以虚拟摄像机的近裁面为起点并穿过所述坐标位置的辅助射线,获取所述辅助射线的旋转角度;
确定增量模块,用于通过循环函数得出所述虚拟摄像机当前的旋转角度到所述辅助射线的旋转角度的中间插值;
应用增量模块,用于将中间插值应用到虚拟摄像机上,使得虚拟摄像机的旋转幅度与中间插值相等,记录虚拟摄像机旋转之后的旋转角度;
判断模块,用于若虚拟摄像机旋转之后的旋转角度与辅助射线的旋转角度相匹配,则完成虚拟摄像机的初步移动,若否则返回确定增量模块。
6.如权利要求5所述的射击游戏的瞄准装置,其特征在于,调整模块中的传感器为陀螺仪,启动陀螺仪,获取陀螺仪的重力参数值以控制虚拟摄像机的旋转角度。
7.如权利要求5所述的射击游戏的瞄准装置,其特征在于,调整模块中的传感器为重力传感器,通过启动重力传感器,实时获取重力传感器的加速度值,判断所述加速度值每秒产生的角变化量,若所述角变化量超过预设阈值,则根据变化后的角变化量控制虚拟摄像机的旋转角度。
8.如权利要求7所述的射击游戏的瞄准装置,其特征在于,所述加速度值为三维向量值,其由X轴加速度值、Y轴加速度值和Z轴加速度值构成,其中X轴加速度值、Y轴加速度值和Z轴加速度值的大小范围均在为-1至1之间。
CN201510054312.5A 2015-02-02 2015-02-02 一种射击游戏的瞄准方法及装置 Active CN104548596B (zh)

Priority Applications (4)

Application Number Priority Date Filing Date Title
CN201510054312.5A CN104548596B (zh) 2015-02-02 2015-02-02 一种射击游戏的瞄准方法及装置
US14/903,605 US9914047B2 (en) 2015-02-02 2015-02-11 Aiming method and device for shooting game
PCT/CN2015/072789 WO2016123816A1 (zh) 2015-02-02 2015-02-11 一种射击游戏的瞄准方法及装置
EP15816637.1A EP3069766A4 (en) 2015-02-02 2015-02-11 Aiming method and apparatus for shooting game

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510054312.5A CN104548596B (zh) 2015-02-02 2015-02-02 一种射击游戏的瞄准方法及装置

Publications (2)

Publication Number Publication Date
CN104548596A CN104548596A (zh) 2015-04-29
CN104548596B true CN104548596B (zh) 2017-05-24

Family

ID=53066325

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510054312.5A Active CN104548596B (zh) 2015-02-02 2015-02-02 一种射击游戏的瞄准方法及装置

Country Status (4)

Country Link
US (1) US9914047B2 (zh)
EP (1) EP3069766A4 (zh)
CN (1) CN104548596B (zh)
WO (1) WO2016123816A1 (zh)

Families Citing this family (24)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106293029B (zh) * 2015-05-30 2020-12-08 深圳富泰宏精密工业有限公司 便携式电子装置及其摄像模组控制方法
CN105094526B (zh) * 2015-06-26 2019-03-08 安一恒通(北京)科技有限公司 智能调整客户端浏览器窗口的方法和装置
CN105068706B (zh) * 2015-07-31 2018-11-20 广州周游网络科技有限公司 一种射击游戏的滑动转向方法及装置
CN105148520A (zh) * 2015-08-28 2015-12-16 上海甲游网络科技有限公司 一种射击游戏的自动瞄准的方法及装置
CN107029425B (zh) * 2016-02-04 2020-06-19 网易(杭州)网络有限公司 一种射击游戏的操控系统、方法及终端
CN107029428B (zh) * 2016-02-04 2020-06-19 网易(杭州)网络有限公司 一种射击游戏的操控系统、方法及终端
JP6389208B2 (ja) * 2016-06-07 2018-09-12 株式会社カプコン ゲームプログラム及びゲーム装置
US10179286B2 (en) * 2016-08-26 2019-01-15 Minkonet Corporation Method of replaying game video using camera information calibration
CN106780674B (zh) * 2016-11-28 2020-08-25 网易(杭州)网络有限公司 镜头移动方法和装置
JP6678566B2 (ja) * 2016-12-26 2020-04-08 株式会社コーエーテクモゲームス ゲームプログラム、記録媒体、ゲーム処理方法
WO2018214029A1 (zh) * 2017-05-23 2018-11-29 深圳市大疆创新科技有限公司 用于操纵可移动装置的方法和设备
CN107168611B (zh) * 2017-06-16 2018-12-28 网易(杭州)网络有限公司 信息处理方法、装置、电子设备及存储介质
CN109550246B (zh) * 2017-09-25 2022-03-25 腾讯科技(深圳)有限公司 游戏客户端的控制方法、装置、存储介质和电子装置
CN107803024B (zh) * 2017-09-28 2021-06-25 网易(杭州)网络有限公司 一种射击控制方法及装置
CN107913515B (zh) * 2017-10-25 2019-01-08 网易(杭州)网络有限公司 信息处理方法及装置、存储介质、电子设备
CN114247131A (zh) * 2018-02-09 2022-03-29 鲸彩在线科技(大连)有限公司 辅助定位方法、装置及设备
CN109011573B (zh) * 2018-07-18 2022-05-31 网易(杭州)网络有限公司 一种游戏中的射击控制方法和装置
CN109395382A (zh) * 2018-09-12 2019-03-01 苏州蜗牛数字科技股份有限公司 一种针对摇杆的线性优化方法
CN109814736A (zh) * 2018-12-05 2019-05-28 苏州蜗牛数字科技股份有限公司 一种摇杆数值的处理方法
CN109701279B (zh) * 2018-12-24 2023-06-02 努比亚技术有限公司 游戏控制方法、移动终端及计算机可读存储介质
CN109718559A (zh) * 2018-12-24 2019-05-07 努比亚技术有限公司 游戏控制方法、移动终端及计算机可读存储介质
CN110585716A (zh) * 2019-09-20 2019-12-20 腾讯科技(深圳)有限公司 虚拟道具控制方法、装置、设备及存储介质
CN111111184B (zh) * 2019-12-26 2023-12-12 珠海金山数字网络科技有限公司 一种虚拟镜头调整方法及装置
CN112156472B (zh) * 2020-10-23 2023-03-10 腾讯科技(深圳)有限公司 虚拟道具的控制方法、装置、设备及计算机可读存储介质

Family Cites Families (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3269797B2 (ja) * 1997-12-12 2002-04-02 株式会社ナムコ 画像生成装置及び情報記憶媒体
JP3662435B2 (ja) * 1998-12-17 2005-06-22 コナミ株式会社 射的ビデオゲーム装置
FI117488B (fi) * 2001-05-16 2006-10-31 Myorigo Sarl Informaation selaus näytöllä
US9901814B2 (en) * 2006-11-17 2018-02-27 Nintendo Co., Ltd. Game system and storage medium storing game program
JP5730463B2 (ja) * 2008-07-11 2015-06-10 任天堂株式会社 ゲームプログラムおよびゲーム装置
JP2010237882A (ja) * 2009-03-30 2010-10-21 Namco Bandai Games Inc プログラム、情報記憶媒体及び画像生成システム
JP2011255119A (ja) * 2010-06-11 2011-12-22 Nintendo Co Ltd 情報処理プログラム、情報処理装置、情報処理システム及び情報処理方法
JP6243586B2 (ja) * 2010-08-06 2017-12-06 任天堂株式会社 ゲームシステム、ゲーム装置、ゲームプログラム、および、ゲーム処理方法
KR101492310B1 (ko) * 2010-11-01 2015-02-11 닌텐도가부시키가이샤 조작 장치 및 정보 처리 장치
JP5829020B2 (ja) * 2010-12-22 2015-12-09 任天堂株式会社 ゲームシステム、ゲーム装置、ゲームプログラム、および、ゲーム処理方法
TW201334843A (zh) * 2012-02-20 2013-09-01 Fu Li Ye Internat Corp 具有觸控面板媒體的遊戲控制方法及該遊戲媒體
JP6104515B2 (ja) * 2012-03-30 2017-03-29 株式会社バンダイナムコエンターテインメント プログラム、情報記憶媒体、電子機器及びサーバシステム
TW201343227A (zh) * 2012-04-25 2013-11-01 Fu Li Ye Internat Corp 具有觸控面板裝置媒體的互動遊戲控制方法
US9561436B2 (en) * 2013-02-26 2017-02-07 Gree, Inc. Shooting game control method and game system

Also Published As

Publication number Publication date
US20160317913A1 (en) 2016-11-03
EP3069766A4 (en) 2017-07-19
EP3069766A1 (en) 2016-09-21
US9914047B2 (en) 2018-03-13
WO2016123816A1 (zh) 2016-08-11
CN104548596A (zh) 2015-04-29

Similar Documents

Publication Publication Date Title
CN104548596B (zh) 一种射击游戏的瞄准方法及装置
CA2825834C (en) Automated frame of reference calibration for augmented reality
JP5959047B2 (ja) 表示制御システム、表示制御方法、表示制御プログラム、および表示制御装置
CN105074625B (zh) 信息处理设备、信息处理方法及计算机可读记录介质
CN108196669B (zh) 游戏角色模型的修正方法、装置、处理器及头戴式显示设备
CN106582012A (zh) 一种vr场景下的攀爬操作处理方法和装置
US9669300B2 (en) Motion detection for existing portable devices
CN104956648B (zh) 用于在固定参照系中感测物体在空间中的取向的方法和设备
CN103514619A (zh) 二维角色表现三维动作的系统及方法
CN109952552A (zh) 视觉提示系统
WO2016036425A1 (en) Motion detection for portable devices
JP6099237B2 (ja) 表示制御システム、表示制御方法、表示制御プログラム、および表示制御装置
JP7129839B2 (ja) 訓練装置、訓練システム、訓練方法、及びプログラム
CN112827169B (zh) 游戏图像处理方法和装置、存储介质及电子设备
CN106803856A (zh) 视频播放控制方法和装置
CN108553888A (zh) 增强现实交互方法及装置
CN109985385B (zh) 一种游戏设备及其游戏角色的控制方法和装置
CN110741327B (zh) 基于增强现实及数字图像处理的泥胶玩具系统及其方法
US7643028B2 (en) Image generation program product and image generation device
WO2020016225A1 (en) Method and control unit for controlling a virtual reality display, virtual reality display and virtual reality system
WO2022014700A1 (ja) 端末装置、仮想オブジェクト操作方法、及び仮想オブジェクト操作プログラム
US11620801B2 (en) Information-processing device, storage medium, information-processing system, and information-processing method
TWI286719B (en) System of simulating flight navigation and the method of using the same
CN111343446B (zh) 视频图像翻转显示方法及装置
CN117101138A (zh) 虚拟角色的控制方法、装置、电子设备以及存储介质

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right

Effective date of registration: 20170411

Address after: 516050 Guangzhou, Guangdong, Tangxia, the second floor of the two society of the public, room 69, No. 603, room

Applicant after: Guangzhou Travel Network Technology Co., Ltd.

Address before: 510650 Tianhe District, Guangzhou, Tangxia West Road, No. 601 Tian Hui building, room, room 69

Applicant before: Chen Rong

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20171229

Address after: Room 69, room 69, Guangzhou, Tianhe District, Tianhe District, Guangzhou, Guangdong

Patentee after: Guangzhou quasi real network technology Co., Ltd.

Address before: 516050 Guangzhou, Guangdong, Tangxia, the second floor of the two society of the public, room 69, No. 603, room

Patentee before: Guangzhou Travel Network Technology Co., Ltd.

TR01 Transfer of patent right
PE01 Entry into force of the registration of the contract for pledge of patent right

Denomination of invention: Aiming method and device of shooting games

Effective date of registration: 20190804

Granted publication date: 20170524

Pledgee: China Co truction Bank Corp Guangzhou Tianhe subbranch

Pledgor: Guangzhou quasi real network technology Co., Ltd.

Registration number: Y2019440000001

PE01 Entry into force of the registration of the contract for pledge of patent right
PC01 Cancellation of the registration of the contract for pledge of patent right

Date of cancellation: 20200817

Granted publication date: 20170524

Pledgee: China Co. truction Bank Corp Guangzhou Tianhe subbranch

Pledgor: Guangzhou quasi real network technology Co.,Ltd.

Registration number: Y2019440000001

PC01 Cancellation of the registration of the contract for pledge of patent right
PE01 Entry into force of the registration of the contract for pledge of patent right

Denomination of invention: Aiming method and device of shooting game

Effective date of registration: 20200817

Granted publication date: 20170524

Pledgee: China Co. truction Bank Corp Guangzhou Tianhe subbranch

Pledgor: Guangzhou quasi real network technology Co.,Ltd.

Registration number: Y2020980005092

PE01 Entry into force of the registration of the contract for pledge of patent right