Data processing method, apparatus, device, and medium
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-19
- Publication Date
- 2026-08-11
AI Technical Summary
然而,由于摄像机使用透视投影,三维对象投影到二维图像时会出现随深度变化的缩放、形状变形、透视畸变等现象,采用上述方式处理屏幕边缘或屏幕外的球形碰撞体时,导致误差过大
[0020]本申请实施例中,获取游戏虚拟对象对应的候选碰撞体组件,当候选碰撞体组件的形状为球形时,将候选碰撞体组件的第一球心投影至屏幕空间,得到第一球心投影点,将候选碰撞体组件的第一球面点投影至屏幕空间,得到第一球面投影点。将第一球心投影点到第一球面投影点之间的距离,作为候选碰撞体组件在屏幕空间内的投影圆所对应的第一初始半径。当第一球面投影点超出屏幕空间的可视化范围时,可以按照预先设计的特定函数,对第一初始半径进行缩放处理,得到候选碰撞体组件在屏幕空间内的组件投影区域。可以减轻相机透视带来的变形误差,从而提高碰撞体组件在屏幕空间中的映射准确性。
Smart Images

Figure CN122222807B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of electronic game technology, and in particular to a data processing method, apparatus, device, and medium. Background Technology
[0002] In the field of game design, the core of mapping 3D (Three-Dimensional) colliders to 2D (Two-Dimensional) screen space is to convert the 3D physical collision range into a 2D area on the screen plane for use in UI (User Interface) interaction, 2D gameplay judgment, screen space effects, aiming assistance and other scenarios.
[0003] Currently, methods for mapping 3D colliders to 2D screen space include: for a spherical collider, projecting the sphere's center onto the screen space to form a center A; taking a point on the sphere's surface perpendicular to the line of sight and equidistant from the sphere's center, and projecting this point onto the screen space to obtain point B; and using the length between center A and point B as the radius of the projection circle. However, because cameras use perspective projection, when a 3D object is projected onto a 2D image, phenomena such as scaling with depth, shape deformation, and perspective distortion occur. Using the above method to process spherical colliders at the screen edge or outside the screen results in excessively large errors. Summary of the Invention
[0004] This application provides a data processing method, apparatus, device, and medium that can reduce distortion errors caused by camera perspective and improve the mapping accuracy of collision body components in screen space.
[0005] One embodiment of this application provides a data processing method, including: Retrieve the candidate collider components corresponding to the game's virtual objects; When the candidate collider component is spherical, the first center of the sphere of the candidate collider component is projected onto the screen space to obtain the first center of the sphere projection point, and the first spherical point of the candidate collider component is projected onto the screen space to obtain the first spherical projection point. The distance between the first center projection point and the first surface projection point is determined as the first initial radius; When the first spherical projection point exceeds the visualization range of the screen space, the first initial radius is scaled according to the screen center and coordinate origin of the screen space to obtain the component projection area of the candidate collider component in the screen space.
[0006] One embodiment of this application provides a data processing apparatus, including: The collider acquisition module is used to acquire candidate collider components corresponding to virtual objects in the game. The spherical collider projection module is used to project the first center of the candidate collider component onto the screen space to obtain the first center of the sphere projection point, and to project the first spherical point of the candidate collider component onto the screen space to obtain the first spherical projection point when the candidate collider component is spherical. The spherical collider projection module is also used to determine the distance between the first sphere center projection point and the first sphere surface projection point as the first initial radius; The spherical collider projection module is also used to scale the first initial radius based on the screen center and coordinate origin of the screen space when the first spherical projection point exceeds the visualization range of the screen space, so as to obtain the component projection area of the candidate collider component in the screen space.
[0007] When the collider acquisition module obtains the candidate collider components corresponding to the game virtual object, it performs the following steps: Get the array of colliders corresponding to the game virtual object. The array of colliders includes at least one collider component. Obtain the array index of the collider array, and determine the candidate collider component indicated by the array index among at least one collider component contained in the collider array.
[0008] The spherical collider projection module projects the first spherical point of the candidate collider component onto the screen space. When the first spherical projection point is obtained, it is used to perform the following steps: In the vertical visual direction of the first sphere center, determine the first spherical point of the candidate collider component and obtain the three-dimensional coordinate information of the first spherical point; Obtain the camera view matrix, and based on the camera view matrix, convert the 3D coordinate information into the observation coordinate information of the first spherical point; Obtain the camera projection matrix, and based on the camera projection matrix, convert the observation coordinate information into the clipping coordinate information of the first spherical point; The clipping coordinate information is normalized to obtain standardized coordinate information. Based on the screen size of the screen space and the standardized coordinate information, the first spherical projection point of the first spherical point in the screen space is determined.
[0009] When the first spherical projection point exceeds the visualization range of the screen space, the spherical collider projection module scales the first initial radius based on the screen center and coordinate origin of the screen space to obtain the component projection area of the candidate collider component within the screen space, which is then used to perform the following steps: When the first spherical projection point exceeds the visualization range of the screen space, obtain the screen center and coordinate origin of the screen space; Get the first distance between the screen center and the first sphere projection point, get the second distance between the screen center and the first sphere projection point, and get the third distance between the coordinate origin and the screen center. The first scaling parameter is determined based on the first distance, the second distance, the third distance, and the first initial radius; The ratio of the first initial radius to the first scaling parameter is determined as the first projection radius. Based on the first projection radius, the component projection area of the candidate collider component in the screen space is determined.
[0010] When the spherical collider projection module determines the first scaling parameter based on the first distance, the second distance, the third distance, and the first initial radius, it performs the following steps: The first reference length is obtained by summing the squares of the first distance and the squares of the second distance. Obtain the constant parameter, sum the constant parameter with the square of the third distance, and obtain the second reference length; The second reference length is summed with the first initial radius to obtain the third reference length, and the ratio of the first reference length to the third reference length is determined as the first scaling parameter.
[0011] The data processing device also includes: A conventional projection module is used to determine a circular region based on a first initial radius when the first spherical projection point is within the visualization range, and to define the circular region as the component projection area of the candidate collider component in the screen space.
[0012] The data processing device also includes: The box-shaped collider projection module is used to project the vertices of the candidate collider component onto the screen space when the candidate collider component is hexahedral, thus obtaining the vertex projection points. The box-shaped collider projection module is also used to determine the component projection area of the candidate collider component in the screen space based on the vertex projection point.
[0013] The data processing device also includes: The capsule collider projection module is used to obtain the second and third centers of the candidate collider component when the candidate collider component is cylindrical-spherical; the candidate collider component with the shape of a cylindrical-spherical component includes two hemispheres and a cylinder; The capsule collision body projection module is also used to project the second sphere center onto the screen space to obtain the second sphere center projection point, and to project the third sphere center onto the screen space to obtain the third sphere center projection point; The capsule collision projection module is also used to determine the second spherical point on the hemisphere to which the second sphere center belongs, and to project the second spherical point onto the screen space to obtain the second spherical projection point; The capsule collision projection module is also used to determine the third spherical point on the hemisphere to which the third sphere center belongs, and to project the third spherical point onto the screen space to obtain the third spherical projection point. The capsule collider projection module is also used to determine the component projection area of the candidate collider component in the screen space based on the second sphere center projection point, the second sphere surface projection point, the third sphere center projection point, and the third sphere surface projection point.
[0014] When the capsule collider projection module determines the component projection area of the candidate collider component in the screen space based on the second sphere center projection point, the second sphere surface projection point, the third sphere center projection point, and the third sphere surface projection point, it performs the following steps: The distance between the second and third center projection points is determined as the projected height of the cylinder in the candidate collider assembly. The distance between the second sphere center projection point and the second sphere surface projection point is determined as the second initial radius, and the distance between the third sphere center projection point and the third sphere surface projection point is determined as the third initial radius; Based on the projection height, the second initial radius, the third initial radius, the relationship between the second spherical projection point and the visualization range, and the relationship between the third spherical projection point and the visualization range, the component projection area of the candidate collider component in the screen space is determined.
[0015] The capsule collider projection module, when determining the component projection area of the candidate collider component in the screen space based on the projection height, the second initial radius, the third initial radius, the relationship between the second spherical projection point and the visualization range, and the relationship between the third spherical projection point and the visualization range, performs the following steps: When the second spherical projection point is outside the visualization range and the third spherical projection point is within the visualization range, the fourth reference length is determined based on the distance between the screen center and the second spherical projection point, and the distance between the screen center and the second spherical projection point. Based on constant parameters and the distance between the origin of the coordinate system and the center of the screen, the fifth reference length is determined, and the sum of the fifth reference length and the second initial radius is determined as the sixth reference length. The ratio of the fourth reference length to the sixth reference length is determined as the second scaling parameter, and the ratio of the second initial radius to the second scaling parameter is determined as the second projection radius; Based on the projection height, the second projection radius, and the third initial radius, the component projection area of the candidate collider component in the screen space is determined.
[0016] The number of candidate collider components is M, where M is a positive integer; The data processing device also includes: The aiming assistance module is used to determine the object projection area of the game virtual object in the screen space based on the component projection area of each of the M candidate collider components. The aiming assistance module is also used to correct the aiming operation of business objects in game business based on the object's projection area.
[0017] One aspect of this application provides a computer device, including a memory and a processor. The memory is connected to the processor, the memory is used to store computer programs, and the processor is used to call the computer programs so that the computer device executes the method provided in one aspect of this application.
[0018] One aspect of this application provides a computer-readable storage medium storing a computer program adapted to be loaded and executed by a processor, so that a computer device having a processor performs the method provided in one aspect of this application.
[0019] According to one aspect of this application, a computer program product is provided, which may include a computer program stored in a computer-readable storage medium. A processor of a computer device reads the computer program from the computer-readable storage medium, and executes the computer program, causing the computer device to perform the method provided in the above aspect.
[0020] In this embodiment, candidate collider components corresponding to game virtual objects are obtained. When the candidate collider component is spherical, its first center point is projected onto the screen space to obtain a first center point projection point, and its first surface point is projected onto the screen space to obtain a first surface projection point. The distance between the first center point projection point and the first surface projection point is used as the first initial radius corresponding to the projection circle of the candidate collider component in the screen space. When the first surface projection point exceeds the visualization range of the screen space, the first initial radius can be scaled according to a pre-designed specific function to obtain the component projection area of the candidate collider component in the screen space. This can reduce the deformation error caused by camera perspective, thereby improving the mapping accuracy of the collider component in the screen space. Attached Figure Description
[0021] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0022] Figure 1 This is a schematic diagram of a network architecture provided in an embodiment of this application; Figure 2 This is a flowchart illustrating a data processing method provided in an embodiment of this application. Figure 1 ; Figure 3 This is a schematic diagram illustrating the positional relationship between a spherical projection point and the visualization range of the screen space, provided in an embodiment of this application. Figure 4 This is a schematic diagram of radius projection processing when the spherical projection point of a spherical collider assembly exceeds the visualization range, provided in an embodiment of this application. Figure 5 This is a flowchart illustrating a data processing method provided in an embodiment of this application. Figure 2 ; Figure 6 This is a schematic diagram of the radius projection processing of a capsule collider assembly provided in an embodiment of this application; Figure 7 This is a schematic diagram of a screen projection processing flow for a collision body component provided in an embodiment of this application; Figure 8 This is a schematic diagram of a screen projection processing scenario for a collision body component provided in an embodiment of this application; Figure 9 This is a schematic diagram of the structure of a data processing device provided in an embodiment of this application; Figure 10 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation
[0023] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.
[0024] A collider assembly refers to a geometric shape or set of objects used in physics simulation, collision detection, occlusion testing, and raycasting. Based on their shape, collider assemblies can be categorized into spherical collider assemblies, box-shaped collider assemblies, capsule-shaped collider assemblies, mesh collider assemblies, etc.
[0025] The capsule is a composite geometric structure with hemispherical ends and a cylindrical middle. It is used as a collision component for virtual game objects. Its spatial pose is bound to the object model to realize the physical collision, hit determination and auxiliary aiming area calculation of virtual game objects.
[0026] Game virtual objects refer to digital entities created, rendered, and involved in game logic interactions within the game environment. They are used to carry visual representations, physical attributes, behavioral logic, and player interaction content. Game virtual objects can include, but are not limited to, player characters, items, non-player characters (NPCs), vehicles, and scene objects within the game environment.
[0027] Screen space refers to the coordinate system that maps three-dimensional world coordinates to a two-dimensional screen (or viewport) coordinate system through camera view and projection transformation.
[0028] Camera perspective distortion refers to the phenomenon where, due to the camera using perspective projection (rather than orthographic projection), three-dimensional objects projected onto a two-dimensional image exhibit scaling, shape distortion, and perspective distortion that vary with depth. In short, distant objects appear smaller, parallel lines converge in the view, and the scaling is inconsistent in different directions on the plane.
[0029] Please see Figure 1 , Figure 1 This is a schematic diagram of a network architecture provided in an embodiment of this application. The network architecture may include a terminal cluster and a server 10d. The terminal cluster may include one or more terminal devices. No limitations are placed on the number of terminal devices included in the terminal cluster or the number of servers included in the network architecture. Figure 1 As shown, the terminal cluster may specifically include terminal device 10a, terminal device 10b, and terminal device 10c, etc. Each terminal device in the terminal cluster can connect to server 10d via the network so that each terminal device can interact with server 10d through the network connection.
[0030] in, Figure 1 The terminal devices in the terminal cluster shown include: smartphones, tablets, laptops, PDAs, desktop computers, wearable devices (such as smartwatches, smart bracelets, etc.), smart voice interaction devices, smart home appliances (such as smart TVs, etc.), in-vehicle devices, aircraft, and other electronic devices. This application does not limit the type of terminal device.
[0031] Figure 1 The server 10d shown can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms. This application does not limit the type of server 10d.
[0032] Please see Figure 2 , Figure 2 This is a flowchart illustrating a data processing method provided in an embodiment of this application. Figure 1 It is understandable that this data processing method can be executed by a computer device, which can be a terminal device, such as... Figure 1 Any terminal device in the terminal cluster shown can be a server, such as... Figure 1 The server 10d shown is not limited in this application. Figure 2 As shown, the data processing method may include the following steps S101 to S104: Step S101: Obtain the candidate collider component corresponding to the game virtual object.
[0033] Among them, virtual objects in games refer to virtual entities that constitute the interactive subjects and environmental elements within a game scene. They typically possess models, textures, animations, collider components, attribute data, and behavioral logic, and can be recognized, rendered, and displayed by the system, interacting with players or other objects.
[0034] A collider component is a functional component attached to and mounted on a virtual game object. The virtual game object provides the collider component with its host and spatial position reference. As a physical interaction unit, the collider component is mounted on the virtual game object and maintains the same spatial position and orientation as the virtual game object. It is used to realize collision detection and physical interaction between the virtual game object and other objects.
[0035] A game virtual object can have one or more collider components attached to it. A candidate collider component is any collider component attached to the game virtual object. When one or more collider components are attached to a game virtual object, these components can be combined into an array, either in an ordered or unordered manner. This array is called the collider array.
[0036] It is understood that one or more collider components in the collider array can have the same shape or different shapes. The shape of each collider component in the collider array can be any of the following: sphere, box (also called hexahedron), capsule (also called cylindrical sphere), mesh, etc. This application does not limit the shape of the collider components.
[0037] For ease of understanding, we will use the example of attaching multiple collider components to a single game virtual object. We obtain the collider array corresponding to the game virtual object, which may include at least one collider component attached to the game virtual object. We obtain the array index of the collider array, and among the at least one collider component contained in the array, we determine the candidate collider component indicated by the array index.
[0038] In this context, the array index refers to the sequence number or identifier used to uniquely identify, locate, and access a single collider component in the collider array; it can be considered the position number of the array element. Each collider component in the collider array can be referred to as an array element.
[0039] Optionally, the array index of the collider array can be a natural number starting from 0. For example, when the number of collider components attached to the game's virtual object is 8, the collider array can include 8 collider components, and the array index can be 0-7. The computer device can traverse the array starting from index 0, performing subsequent processing on each collider component in the collider array sequentially. When the array index is equal to 0, the computer device obtains the collider component indicated by array index 0 (such as the first collider component); at this time, the collider component indicated by array index 0 is called the candidate collider component.
[0040] Step S102: When the candidate collider component is spherical, the first center of the sphere of the candidate collider component is projected onto the screen space to obtain the first center of the sphere projection point, and the first spherical point of the candidate collider component is projected onto the screen space to obtain the first spherical projection point.
[0041] Specifically, in the process of mapping candidate collider components to screen space, different shaped candidate collider components are processed in different ways. When the shape of a candidate collider component is spherical, it can be called a spherical collider component. The center of the spherical collider component is obtained. For ease of understanding, the center of the spherical collider component can be called the first center of the sphere. The first center of the sphere is projected onto the screen space to obtain the first center of the sphere projection point.
[0042] Here, the first sphere center projection point refers to the center of the projection circle of the spherical candidate collider component (hereinafter referred to as the spherical collider component) in screen space. In other words, the first sphere center projection point is the projection center of the spherical collider component in screen space, representing the reference point for the position of the spherical collider component in the two-dimensional screen space. Centered on the first sphere center projection point, the projection radius can be combined to construct the projection circle of the spherical collider component in screen space, which is used to determine whether clicks, touches, and UI interactions fall within the range of the projection circle of the spherical collider component.
[0043] In one or more embodiments, projecting the first sphere center into the screen space may include: obtaining the three-dimensional coordinate information of the first sphere center, which refers to the coordinates of the first sphere center in world space, and can be represented as... World space refers to the global coordinate system of the entire game scene where the virtual objects reside. Obtain the camera view matrix, and based on this matrix, convert the 3D coordinates of the first sphere's center into the observation coordinates of the first sphere's center.
[0044] Wherein, the camera view matrix is a matrix of size 1000. The homogeneous transformation matrix is used to transform 3D coordinate information in world space to camera space. Essentially, it "translates and rotates" the entire game scene containing the virtual game object to the camera's viewpoint. The camera view matrix describes the camera's position and orientation in world space; camera space refers to a local coordinate system with the camera as the origin and the camera orientation as the Z-axis, also known as the viewing space.
[0045] A camera view matrix can be composed of three elements of the camera, including the camera position (representing the camera's coordinates in world space), the camera's observation target point (representing the point the camera is "looking at"), and the camera's overhead direction (representing the direction the camera is pointing upwards; it is a direction vector, not a position).
[0046] The observation coordinates of the first sphere center refer to the coordinates of the first sphere center in camera space, representing the position of the first sphere center relative to the camera with the camera as the origin. The coordinates obtained by multiplying the three-dimensional coordinates of the first sphere center in world space by the camera view matrix can be called the observation coordinates of the first sphere center.
[0047] Further, the camera projection matrix is obtained, and based on the camera projection matrix, the observation coordinates of the first sphere center are converted into the clipping coordinates of the first sphere center. The clipping coordinates of the first sphere center are normalized to obtain the standardized coordinates of the first sphere center. Based on the screen size of the screen space and the standardized coordinates of the first sphere center, the projection point of the first sphere center in the screen space is determined.
[0048] The camera projection matrix is a matrix of size 1000. The homogeneous transformation matrix is used to transform the view coordinate information in camera space to clip space, realizing perspective projection (objects appear larger when closer and smaller when farther away) or orthographic projection (size remains unchanged), which is the core step in transforming 3D to 2D. The camera projection matrix can be used to define the extent of the view frustum, which represents the 3D spatial region that the camera can "see". It is a frustum (perspective) or a cuboid (orthogonal).
[0049] Clipping space is a homogeneous coordinate space, with coordinates in the form of: , is the output of the projection transformation, situated between camera space and NDC (Normalized Device Coordinates); w represents the perspective division factor. The clipping coordinates of the first sphere center refer to its coordinate values in clip space; the coordinates obtained by multiplying the view coordinates of the first sphere center in camera space by the camera projection matrix can be called the clipping coordinates of the first sphere center. View frustum clipping is performed in clip space, removing primitives outside the view frustum; that is, only primitives within the view frustum are rendered, while primitives outside the view frustum are clipped.
[0050] Normalization refers to the process of performing perspective division on the clipping coordinate information. The normalized coordinate information of the first sphere center can be understood as the normalized device coordinate (NDC) value of the first sphere center. After viewport mapping, the normalized coordinate information of the first sphere center can be used to obtain the projection point of the first sphere center in screen space.
[0051] Perspective division refers to the operation of dividing the x, y, and z components of the clipping coordinate information by its w component, thereby transforming the coordinates from clipping space to normalized device coordinate space. Normalized device coordinates are the coordinates obtained after perspective division, a standard intermediate coordinate space in the graphics pipeline that is independent of resolution and camera.
[0052] Viewport mapping refers to the transformation process of linearly mapping normalized coordinate information from [-1, 1] to the actual screen pixel coordinate region. For example, suppose the normalized coordinate information of the first sphere center is denoted as... The screen size can be understood as the screen resolution, the width is denoted as width, and the height is denoted as height. Then the projection point of the first sphere center can be shown in formula (1): (1) Among them, in formula (1) , This represents the coordinates of the first sphere's center in screen space, i.e., the projection point of the first sphere's center. In other words, through viewport mapping, the standardized coordinate information of the first sphere's center is adjusted from the range of [-1,1] to the range of [0, width] and [0, height] pixels.
[0053] In one or more embodiments, a first spherical point of the candidate collider component (spherical collider component) can be determined in the vertical visual direction from the first sphere center. Optionally, any point on the spherical surface of the spherical collider component can be selected as the first spherical point. The three-dimensional coordinate information of the first spherical point in world space is obtained.
[0054] Obtain the camera view matrix, and based on the camera view matrix, convert the 3D coordinate information into the observation coordinate information of the first spherical point. Obtain the camera projection matrix, and based on the camera projection matrix, convert the observation coordinate information into the clipping coordinate information of the first spherical point. Normalize the clipping coordinate information to obtain standardized coordinate information. Based on the screen size in screen space and the standardized coordinate information, determine the first spherical projection point of the first spherical point in screen space.
[0055] The vertical visual direction refers to the screen plane direction perpendicular to the camera's line of sight, i.e., the two-dimensional plane direction used to calculate the aiming position and the area enclosed by the screen of the collider after projection; the camera's line of sight refers to the straight line radiating from the camera towards the distance. The first spherical point refers to the intersection of a ray emanating from the first sphere's center along the vertical visual direction and the surface (spherical surface) of the candidate collider component.
[0056] It is understandable that the way the first spherical point is projected onto the screen space is similar to the way the first sphere's center is projected onto the screen space, and will not be repeated here. The point on the screen space projected from the first spherical point can be called the first spherical projection point.
[0057] Step S103: Determine the distance between the first sphere center projection point and the first sphere surface projection point as the first initial radius.
[0058] Specifically, within the screen space, the length of the line connecting the first center projection point and the first surface projection point is determined as the first initial radius of the candidate collider component within the screen space. In other words, the first initial radius represents the distance between the first center projection point and the first surface projection point.
[0059] For example, suppose the first projection point of the sphere's center is denoted as point A, and the first projection point of the sphere's surface is denoted as P. Then the distance from point A to point P can be used as the first initial radius, denoted as... For example, point A is... Point P is ,So .
[0060] Step S104: When the first spherical projection point exceeds the visualization range of the screen space, the first initial radius is scaled according to the screen center and coordinate origin of the screen space to obtain the component projection area of the candidate collider component in the screen space.
[0061] Specifically, it can be determined whether the first spherical projection point is outside the visualization range of the screen space. If the first spherical projection point is within the visualization range of the screen space, the first initial radius can be used as the final projection radius of the candidate collider component in the screen space. A circular area is determined based on the first initial radius, and this circular area is determined as the component projection area of the candidate collider component in the screen space.
[0062] The visualization range refers to the two-dimensional pixel area ultimately rendered and displayed on the screen from the current camera's perspective, as well as the spatial range in three-dimensional space that can be "seen" by the camera and projected onto that area. This visualization range can also be called the screen visible range, screen visible area, viewport visible area, etc., and this application does not limit it to any particular term. It is understood that, from a two-dimensional plane perspective, the visualization range can be understood as the entire screen area. The component projection area refers to the projection area of the candidate collider component within the screen space. When the candidate collider component is spherical, its projection area within the screen space is circular.
[0063] Optionally, if the first spherical projection point exceeds the visualization range of the screen space, the first initial radius needs to be scaled based on the screen center and coordinate origin of the screen space to obtain the component projection area of the candidate collider component within the screen space. Here, the screen center refers to the center point of the screen area, and the coordinate origin refers to the origin of the coordinate system in the screen space; for example, the screen area is typically a rectangular area, where the screen center is the center point of the rectangular area, and the coordinate origin is a vertex of the rectangular area.
[0064] Please see Figure 3 , Figure 3 This is a schematic diagram illustrating the positional relationship between a spherical projection point and the visualization range of the screen space, provided in an embodiment of this application. Figure 3 The coordinate system shown represents the screen space coordinate system, with point O as the origin, line OD representing the horizontal axis, line OF representing the vertical axis, and rectangle ODEF representing the visible area of the screen space. It is understandable that, due to perspective distortion caused by the camera, the actual projection of the sphere onto the screen space appears as an ellipse, similar to the shape of objects appearing smaller as they recede into the distance.
[0065] like Figure 3 As shown, point A represents the projection point of the first sphere center of the candidate collider component within the screen space. When the first sphere projection point is point S1, it means that the first sphere projection point is within the visibility range of the screen space; when the first sphere projection point is point S2, it means that the first sphere projection point is outside the visibility range of the screen space.
[0066] In one or more embodiments, when the first spherical projection point exceeds the visualization range, the screen center and coordinate origin of the screen space are obtained; a first distance between the screen center and the first spherical projection point is obtained; a second distance between the screen center and the first spherical projection point is obtained; and a third distance between the coordinate origin and the screen center is obtained. Based on the first distance, the second distance, the third distance, and a first initial radius, a first scaling parameter is determined; the ratio of the first initial radius to the first scaling parameter is determined as a first projection radius; and based on the first projection radius, the component projection area of the candidate collider component within the screen space is determined.
[0067] Please see Figure 4 , Figure 4 This is a schematic diagram of radius projection processing when the spherical projection point of a spherical collider assembly exceeds the visualization range, as provided in an embodiment of this application. Figure 4 The coordinate system shown is the coordinate system of the screen space. Rectangle ODEF represents the visualization range of the screen space, and point C represents the center of the screen space, such as the center point of rectangle ODEF. Point A is the first center of the spherical candidate collider component, and the first projection point of the center of the spherical component in the screen space; point P is the first spherical point of the spherical candidate collider component, and the first spherical projection point in the screen space; the origin of the coordinate system is point O.
[0068] like Figure 4 As shown, calculate the first distance between point C (the center of the screen) and point A (the first projection point of the sphere's center), denoted as . Calculate the second distance between point C and point P (the first spherical projection point), denoted as . Calculate the third distance between point O (the origin) and point C, denoted as . Among them, the first distance Second distance and the third distance The calculation method can be found in the aforementioned first initial radius. The calculation method will not be elaborated here.
[0069] First distance The square of the second distance The squares of the values are summed to obtain the first reference length; a constant parameter is obtained, and this constant parameter is then compared with the third distance. Summing the squares of the first initial radius yields the second reference length; the second reference length is then summed with the first initial radius. The summation operation is performed to obtain the third reference length, and the ratio of the first reference length to the third reference length is determined as the first scaling parameter.
[0070] The constant parameter can be a value set according to actual needs. This embodiment uses a constant parameter value of 1 as an example. The first reference length can be represented as... , The first reference length can be understood as the square of the length of the CA vector plus the square of the length of the CP vector. The second reference length can be expressed as... This can be understood as the length of the OC vector plus 1. The third reference length can be represented as... .
[0071] The first scaling parameter can be expressed as: This represents the ratio of the first reference length to the third reference length. First initial radius. The ratio between the first projection radius and the first scaling parameter can be called the first projection radius. The first projection radius refers to the final result after scaling and mapping the first initial radius when the first spherical projection point exceeds the visualization range. The first projection radius can be expressed as... Based on the first projection radius Point A and a circle can be defined in screen space. The area of this circle can be used as the projection area of the candidate collider component in screen space.
[0072] In this embodiment, candidate collider components corresponding to game virtual objects are obtained. When the candidate collider component is spherical, its first center point is projected onto the screen space to obtain a first center point projection point, and its first surface point is projected onto the screen space to obtain a first surface projection point. The distance between the first center point projection point and the first surface projection point is used as the first initial radius corresponding to the projection circle of the candidate collider component in the screen space. When the first surface projection point exceeds the visualization range of the screen space, the first initial radius can be scaled according to a pre-designed specific function to obtain the component projection area of the candidate collider component in the screen space. This can reduce the deformation error caused by camera perspective, thereby improving the mapping accuracy of the collider component in the screen space.
[0073] Please see Figure 5 , Figure 5 This is a flowchart illustrating a data processing method provided in an embodiment of this application. Figure 2 It is understandable that this data processing method can be executed by a computer device, which can be a terminal device, such as... Figure 1 Any terminal device in the terminal cluster shown can be a server, such as... Figure 1 The server 10d shown is not limited in this application. Figure 5 As shown, the data processing method may include the following steps S201 to S213: Step S201: Obtain the candidate collider component corresponding to the game virtual object.
[0074] For details on the implementation process of step S201, please refer to [link / reference]. Figure 2 The description of step S101 in the corresponding embodiment will not be repeated here.
[0075] Step S202: When the shape of the candidate collider component is a hexahedron, the vertices of the candidate collider component are projected onto the screen space to obtain the vertex projection points.
[0076] Specifically, when the candidate collider component is hexahedral in shape, it can be called a box-shaped collider component. The eight vertices of the box-shaped collider component are obtained, and each vertex is projected onto screen space to obtain the vertex projection point of each vertex in screen space. In other words, each vertex of the box-shaped collider component corresponds to a point in screen space. The method of projecting each vertex of the box-shaped collider component onto screen space is the same as the method of projecting the first sphere center onto screen space described above, and will not be repeated here.
[0077] Step S203: Determine the component projection area of the candidate collider component in the screen space based on the vertex projection point.
[0078] Specifically, based on the positional relationships between the eight vertices of the candidate collider component (which is hexahedral in shape), the eight vertex projection points in screen space are connected to obtain a convex polygon. For example, in a candidate collider component with a hexahedral shape, the vertex projection points corresponding to two vertices with the same side length can be connected, while the vertex projection points corresponding to vertices with different side lengths do not need to be connected, thus obtaining a convex polygon. This convex polygon can serve as the component projection area of the box-shaped collider component in screen space.
[0079] Step S204: When the shape of the candidate collider component is a cylindrical sphere, obtain the second and third sphere centers of the candidate collider component.
[0080] Specifically, when the candidate collider assembly is shaped like a cylindrical sphere, it can be called a capsule collider assembly. The capsule collider assembly can consist of two hemispheres and a cylinder, with the two hemispheres located at opposite ends of the cylinder. The centers of the two hemispheres of the candidate collider assembly (capsule collider assembly) are obtained and referred to as the second center and the third center, respectively.
[0081] Step S205: Project the second sphere center onto the screen space to obtain the second sphere center projection point; project the third sphere center onto the screen space to obtain the third sphere center projection point.
[0082] The second sphere center projection point refers to the center of the projection circle in screen space of one hemisphere of the candidate collider assembly (capsule collider assembly) which is shaped like a cylindrical sphere. The third sphere center projection point refers to the center of the projection circle in screen space of the other hemisphere of the capsule collider assembly.
[0083] The second and third sphere center projection points refer to the projection centers of the two hemispheres of the capsule collider assembly in screen space, which can be used as the position reference points of the capsule collider assembly in the two-dimensional screen space. The method by which the second and third sphere centers are projected into screen space is similar to the method by which the first sphere center is projected into screen space, and will not be repeated here.
[0084] Step S206: Determine the second spherical point on the hemisphere to which the center of the second sphere belongs, and project the second spherical point onto the screen space to obtain the second spherical projection point.
[0085] Step S207: Determine the third spherical point on the hemisphere to which the third sphere center belongs, and project the third spherical point onto the screen space to obtain the third spherical projection point.
[0086] Specifically, for the capsule collider component, any point can be selected on the surface of the hemisphere containing the second sphere's center as the second spherical point, and projected onto the screen space to obtain the second spherical projection point. Similarly, any point can be selected on the surface of the hemisphere containing the third sphere's center as the third spherical point, and projected onto the screen space to obtain the third spherical projection point.
[0087] Optionally, a second spherical point is determined on the hemisphere to which the second sphere center belongs, according to the perpendicular visual direction of the second sphere center; and a third spherical point is determined on the hemisphere to which the third sphere center belongs, according to the perpendicular visual direction of the third sphere center. The method of projecting the second and third spherical points into screen space is the same as the method of projecting the first sphere center into screen space, and will not be repeated here.
[0088] Step S208: The distance between the second and third sphere center projection points is determined as the projection height of the cylinder in the candidate collider assembly.
[0089] Specifically, within the screen space, the second and third sphere center projection points can be connected, and the length of the line connecting the second and third sphere center projection points is determined as the projected height of the cylinder in the capsule collider assembly. For example, assuming the second sphere center projection point is denoted as point M and the third sphere center projection point as point N, the projected height of the cylinder can be denoted as... , which represents the distance between the second center projection point M and the third center projection point N, such as the Euclidean distance.
[0090] Step S209: Determine the distance between the second sphere center projection point and the second sphere surface projection point as the second initial radius, and determine the distance between the third sphere center projection point and the third sphere surface projection point as the third initial radius.
[0091] Specifically, within the screen space, the length of the line connecting the second center projection point and the second surface projection point is determined as the second initial radius of the hemisphere to which the second center belongs within the screen space. Similarly, the length of the line connecting the third center projection point and the third surface projection point is determined as the third initial radius of the hemisphere to which the third center belongs within the screen space.
[0092] Step S210: When the second spherical projection point is outside the visualization range and the third spherical projection point is within the visualization range, determine the fourth reference length based on the distance between the screen center and the second spherical projection point, and the distance between the screen center and the second spherical projection point.
[0093] The radius projection processing method for the two hemispheres in the capsule collider component is the same as that for the spherical collider component. The component projection area within the screen space of the candidate collider component can be determined based on the projection height, the second initial radius, the third initial radius, the relationship between the second spherical projection point and the visualization range, and the relationship between the third spherical projection point and the visualization range.
[0094] For example, when both the second and third spherical projection points are within the visualization range of the screen space, the second and third initial radii are directly used as the final result, along with the projection height of the cylinder, to determine the component projection area of the capsule collider component in the screen space.
[0095] Optionally, when the second spherical projection point is within the visualization range of the screen space and the third spherical projection point is outside the visualization range, the third initial radius is scaled according to the screen center and the origin of the coordinates to obtain the final result, and together with the second initial radius and the projection height, the component projection area of the capsule collider component in the screen space is determined.
[0096] Optionally, when the second spherical projection point is outside the visualization range and the third spherical projection point is within the visualization range, the second initial radius is scaled according to the screen center and the origin of the coordinates to obtain the final result, and together with the third initial radius and the projection height, the component projection area of the capsule collider component in the screen space is determined.
[0097] Optionally, when both the second and third spherical projection points are outside the visualization range, the second and third initial radii are scaled according to the screen center and the coordinate origin to obtain the final result, and together with the projection height, the component projection area of the capsule collider component in the screen space is determined.
[0098] Understandably, the following description uses an example where the second spherical projection point is outside the visualization range, while the third spherical projection point is within the visualization range. Please refer to [link / reference]. Figure 6 , Figure 6 This is a schematic diagram of the radius projection processing of a capsule collision body assembly provided in an embodiment of this application. Figure 6 Point M represents the second sphere center projection point of the capsule collider component in the screen space, point N represents the third sphere center projection point of the capsule collider component in the screen space, point R represents the second spherical projection point of the capsule collider component in the screen space, and point T represents the third spherical projection point of the capsule collider component in the screen space.
[0099] Assuming the screen center is point C and the origin is point O, when point R is outside the visible area of the screen space, but point T is within the visible area, the fourth reference length can be expressed as: ,in This represents the distance between the center of the screen (point C) and the projection point of the second sphere center (point M). This indicates the distance between the center of the screen and the projection point of the second spherical surface.
[0100] Step S211: Determine the fifth reference length based on the constant parameters and the distance between the origin of the coordinate system and the center of the screen. Then, determine the sixth reference length by combining the fifth reference length and the second initial radius.
[0101] like Figure 6 As shown, taking a constant parameter value of 1 as an example, the fifth reference length can be represented as: At this point, the fifth reference length is the same as the second reference length mentioned above. The sixth reference length can be expressed as... ,in This represents the second initial radius, which is the distance between the projection point of the second sphere center and the projection point of the second sphere surface.
[0102] Step S212: The ratio of the fourth reference length to the sixth reference length is determined as the second scaling parameter, and the ratio of the second initial radius to the second scaling parameter is determined as the second projection radius.
[0103] The second scaling parameter can be expressed as: , indicating the fourth reference length With the sixth reference length The ratio. The second projection radius refers to the ratio of the second initial radius when the second spherical projection point is outside the visualization range. The final result after scaling and mapping, the second projection radius can be expressed as: .
[0104] Step S213: Determine the component projection area of the candidate collider component in the screen space based on the projection height, the second projection radius, and the third initial radius.
[0105] Specifically, based on the second projection radius and the third initial radius, the widths of the cylinder at both ends of the capsule collider assembly within the screen space can be determined; based on the projection height of the cylinder and the widths of the cylinder at both ends, the projection area of the cylinder within the screen space can be determined.
[0106] Based on the second sphere center projection point (point M) and the second projection radius, a semicircle can be determined in the screen space; based on the third sphere center projection point (point N) and the third initial radius, a semicircle can also be determined in the screen space; then the two semicircles and the projection area of the cylinder determined above are determined as the component projection area of the capsule collision body component in the screen space.
[0107] In this embodiment, different processing methods can be used for candidate collider components of different shapes during the projection of candidate collider components onto the screen space. For spherical collider components and capsule collider components (including two hemispheres), function mapping scaling can be used to fit the accurate graphic of the collider component in the screen space, which can reduce the deformation error caused by camera perspective and thus improve the mapping accuracy of the collider component in the screen space.
[0108] Please see Figure 7 , Figure 7 This is a schematic diagram of a screen projection processing flow for a collision body component provided in an embodiment of this application. Figure 7 As shown, the screen projection processing flow of the collider component includes the following steps S301 to S316: S301, traverse the array of colliders.
[0109] Specifically, in game-assisted aiming scenarios, all collider components attached to the game's virtual object can be retrieved, and these collider components can be stored in a collider array. When performing screen projection processing on the collider components attached to the game's virtual object, the collider components in the collider array can be traversed.
[0110] S302, the initial value of the array index is 0.
[0111] S303, Is the array index valid?
[0112] S304, extract data from a collider.
[0113] Specifically, each collider component in the collider array can correspond to an array index, which allows access to the collider components in the array sequentially. For example, if the initial value of the array index is 0, and the current array index is valid, the collider data indicated by array index 0 is extracted from the collider array; this collider data can be called a candidate collider component. If the current array index is invalid, step S316 is executed.
[0114] Is S305 spherical?
[0115] S306, project the center of the sphere, and project any point on the sphere to obtain point P1.
[0116] S307, is point P1 outside the visualization range?
[0117] S308 calculates the function mapping relationship and scales the graph.
[0118] Specifically, if the extracted candidate collider component is spherical, then the center of the sphere (first center) of the candidate collider component is projected onto the screen space to obtain the first center projection point. At the same time, any point on the spherical surface of the candidate collider component can be projected to obtain point P1 (first spherical projection point).
[0119] We can determine whether point P1 is outside the visible area of the screen space. If point P1 is outside the visible area, we can proceed according to... Figure 2 The relevant description of step S104 in the corresponding embodiment is as follows: calculate the function mapping relationship of the first initial radius (the distance between the first sphere center projection point and point P1) and scale the graphic to obtain the component projection area of the current candidate collider component in the screen space, and continue to execute step S315.
[0120] Is S309 a hexahedron?
[0121] S310 projects 8 vertices respectively.
[0122] Specifically, if the current candidate collider component is hexahedral, then the eight vertices of the candidate collider component are projected to obtain the vertex projection points of these eight vertices in the screen space; based on the eight vertex projection points, the component projection area of the candidate collider component in the screen space can be determined, and step S315 is then executed.
[0123] S311, is it a cylindrical sphere?
[0124] S312, project the centers of the two hemispheres, and project any point on the hemisphere to obtain point P2.
[0125] S313, does point P2 exceed the visibility range?
[0126] S314 calculates the function mapping relationship and scales the graph.
[0127] Specifically, if the current candidate collider component is a cylindrical sphere, the centers of the two hemispheres of the candidate collider component can be projected to obtain the second center projection point and the third center projection point. In addition, any point on the surface of the hemisphere can be projected to obtain point P2 (the third spherical projection point or the second spherical projection point).
[0128] The distance between the second and third center projection points can be used as the projected height of the cylinder of the candidate collider assembly. The radius projection processing of the two hemispheres of the candidate collider assembly is the same as that of the spherical collider assembly, and will not be described again here.
[0129] For example, if point P2 is outside the visualization range, then it can be done according to... Figure 5 The relevant descriptions of steps S204 to S213 in the corresponding embodiments are as follows: calculate the function mapping relationship and scale the graphics to obtain the component projection area of the current candidate collider component in the screen space, and continue to execute step S315.
[0130] S315, array index +1.
[0131] S316, Collider component conversion complete.
[0132] Specifically, after completing the screen projection processing of the current candidate collider component, the array index can be incremented by 1, such as updating the array index from 0 to 1, and the next collider data can be extracted from the collider array. Steps S305 to S314 are repeated until all collider components in the collider array have completed the screen projection processing, and the conversion of collider components ends.
[0133] For example, suppose the number of collider components attached to a virtual game object is M, where M is a positive integer; that is, the collider array includes M collider components, with array indices from 0 to M-1. Based on the component projection area of each of the M candidate collider components, the object projection area of the virtual game object in screen space is determined; based on this object projection area, the aiming operation of the business object in the game can be corrected.
[0134] The object projection area refers to the region formed by the component projection areas of all collider components mounted on the same game virtual object. The business object refers to the game player, game account, player character, etc., within the game scene where the game virtual object is located; this application does not limit this. Game business refers to the video game to which the game virtual object belongs, such as a game that the player is currently playing.
[0135] Please see Figure 8 , Figure 8 This is a schematic diagram illustrating a screen projection process for a collider component according to an embodiment of this application. In an assisted aiming scenario, the screen projection processing scheme proposed in this application is used to project the collider component mounted on a virtual game object. Figure 8 As shown, when the game virtual object 20a is at the edge of the screen, the perspective distortion caused by the camera becomes more pronounced, easily resulting in excessive shape errors in the spherical collider components and capsule collider components mounted on the game virtual object 20a after projection into the screen space. The screen projection processing scheme proposed in this application embodiment can determine the projection area of the collider components within the screen space, such as... Figure 8 The area shown is 20b (dashed line area).
[0136] like Figure 8 As shown, region 20b closely matches the actual shape of the game's virtual object 20a, which helps improve aiming accuracy in assisted aiming scenarios. In this embodiment, function mapping scaling is used to fit the accurate graphic of the collider component in screen space, achieving a balance between performance and accuracy. This improves the efficiency of collider component transformation into screen space on low-end devices. While ensuring the accuracy of the transformed graphic in assisted aiming, performance consumption can be reduced, allowing assisted aiming to be enabled throughout the game and enhancing the gaming experience.
[0137] It is understood that in the specific implementation of this application, data such as the player's game account and player character in the game application may be involved. When the above embodiments of this application are applied to specific products or technologies, permission or consent from relevant institutions or departments, or the user himself or himself or himself or her or his or her ...
[0138] Please see Figure 9 , Figure 9 This is a schematic diagram of the structure of a data processing device provided in an embodiment of this application. Figure 9 As shown, the data processing device 1 may include: a collision body acquisition module 101 and a spherical collision body projection module 102. The collider acquisition module 101 is used to acquire candidate collider components corresponding to game virtual objects; The spherical collider projection module 102 is used to project the first center of the candidate collider component onto the screen space to obtain the first center of the sphere projection point, and to project the first spherical point of the candidate collider component onto the screen space to obtain the first spherical projection point when the candidate collider component is spherical. The spherical collider projection module 102 is also used to determine the distance between the first sphere center projection point and the first sphere surface projection point as the first initial radius; The spherical collider projection module 102 is also used to scale the first initial radius according to the screen center and coordinate origin of the screen space when the first spherical projection point exceeds the visualization range of the screen space, so as to obtain the component projection area of the candidate collider component in the screen space.
[0139] In one or more embodiments, when the collider acquisition module 101 acquires the candidate collider component corresponding to the game virtual object, it performs the following steps: Get the array of colliders corresponding to the game virtual object. The array of colliders includes at least one collider component. Obtain the array index of the collider array, and determine the candidate collider component indicated by the array index among at least one collider component contained in the collider array.
[0140] In one or more embodiments, when the spherical collider projection module 102 projects a first spherical point of a candidate collider component onto the screen space to obtain the first spherical projection point, it performs the following steps: In the vertical visual direction of the first sphere center, determine the first spherical point of the candidate collider component and obtain the three-dimensional coordinate information of the first spherical point; Obtain the camera view matrix, and based on the camera view matrix, convert the 3D coordinate information into the observation coordinate information of the first spherical point; Obtain the camera projection matrix, and based on the camera projection matrix, convert the observation coordinate information into the clipping coordinate information of the first spherical point; The clipping coordinate information is normalized to obtain standardized coordinate information. Based on the screen size of the screen space and the standardized coordinate information, the first spherical projection point of the first spherical point in the screen space is determined.
[0141] In one or more embodiments, when the first spherical projection point exceeds the visualization range of the screen space, the spherical collider projection module 102 scales the first initial radius based on the screen center and coordinate origin of the screen space to obtain the component projection area of the candidate collider component in the screen space, for performing the following steps: When the first spherical projection point exceeds the visualization range of the screen space, obtain the screen center and coordinate origin of the screen space; Get the first distance between the screen center and the first sphere projection point, get the second distance between the screen center and the first sphere projection point, and get the third distance between the coordinate origin and the screen center. The first scaling parameter is determined based on the first distance, the second distance, the third distance, and the first initial radius; The ratio of the first initial radius to the first scaling parameter is determined as the first projection radius. Based on the first projection radius, the component projection area of the candidate collider component in the screen space is determined.
[0142] In one or more embodiments, when the spherical collider projection module 102 determines the first scaling parameter based on the first distance, the second distance, the third distance, and the first initial radius, it performs the following steps: The first reference length is obtained by summing the squares of the first distance and the squares of the second distance. Obtain the constant parameter, sum the constant parameter with the square of the third distance, and obtain the second reference length; The second reference length is summed with the first initial radius to obtain the third reference length, and the ratio of the first reference length to the third reference length is determined as the first scaling parameter.
[0143] In one or more embodiments, the data processing device 1 further includes: a conventional projection module 103; The conventional projection module 103 is used to determine a circular region based on a first initial radius when the first spherical projection point is within the visualization range, and to determine the circular region as the component projection area of the candidate collider component in the screen space.
[0144] In one or more embodiments, the data processing device 1 further includes: a box-shaped collider projection module 104; The box-shaped collider projection module 104 is used to project the vertices of the candidate collider component onto the screen space when the shape of the candidate collider component is a hexahedron, so as to obtain the vertex projection points. The box-shaped collider projection module 104 is also used to determine the component projection area of the candidate collider component in the screen space based on the vertex projection point.
[0145] In one or more embodiments, the data processing device 1 further includes: a capsule collision body projection module 105; The capsule collider projection module 105 is used to obtain the second and third centers of the candidate collider assembly when the candidate collider assembly is cylindrical-spherical; the candidate collider assembly with the shape of a cylindrical-spherical includes two hemispheres and a cylinder; The capsule collision body projection module 105 is also used to project the second sphere center onto the screen space to obtain the second sphere center projection point, and to project the third sphere center onto the screen space to obtain the third sphere center projection point. The capsule collision projection module 105 is also used to determine the second spherical point on the hemisphere to which the second sphere center belongs, and to project the second spherical point onto the screen space to obtain the second spherical projection point. The capsule collision body projection module 105 is also used to determine the third spherical point on the hemisphere to which the third sphere center belongs, and to project the third spherical point onto the screen space to obtain the third spherical projection point. The capsule collider projection module 105 is also used to determine the component projection area of the candidate collider component in the screen space based on the second sphere center projection point, the second sphere surface projection point, the third sphere center projection point, and the third sphere surface projection point.
[0146] In one or more embodiments, when the capsule collider projection module 105 determines the component projection area of the candidate collider component in the screen space based on the second sphere center projection point, the second spherical surface projection point, the third sphere center projection point, and the third spherical surface projection point, it performs the following steps: The distance between the second and third center projection points is determined as the projected height of the cylinder in the candidate collider assembly. The distance between the second sphere center projection point and the second sphere surface projection point is determined as the second initial radius, and the distance between the third sphere center projection point and the third sphere surface projection point is determined as the third initial radius; Based on the projection height, the second initial radius, the third initial radius, the relationship between the second spherical projection point and the visualization range, and the relationship between the third spherical projection point and the visualization range, the component projection area of the candidate collider component in the screen space is determined.
[0147] In one or more embodiments, when the capsule collider projection module 105 determines the component projection area of the candidate collider component in the screen space based on the projection height, the second initial radius, the third initial radius, the relationship between the second spherical projection point and the visualization range, and the relationship between the third spherical projection point and the visualization range, it performs the following steps: When the second spherical projection point is outside the visualization range and the third spherical projection point is within the visualization range, the fourth reference length is determined based on the distance between the screen center and the second spherical projection point, and the distance between the screen center and the second spherical projection point. Based on constant parameters and the distance between the origin of the coordinate system and the center of the screen, the fifth reference length is determined, and the sum of the fifth reference length and the second initial radius is determined as the sixth reference length. The ratio of the fourth reference length to the sixth reference length is determined as the second scaling parameter, and the ratio of the second initial radius to the second scaling parameter is determined as the second projection radius; Based on the projection height, the second projection radius, and the third initial radius, the component projection area of the candidate collider component in the screen space is determined.
[0148] In one or more embodiments, the number of candidate collider components is M, where M is a positive integer; The data processing device 1 also includes: an aiming assistance module 106; The aiming assistance module 106 is used to determine the object projection area of the game virtual object in the screen space based on the component projection area of each of the M candidate collider components. The aiming assistance module 106 is also used to correct the aiming operation of the business object in the game business based on the object projection area.
[0149] According to one embodiment of this application, the foregoing Figure 2 The data processing method shown can be related to the steps involved by Figure 9 The data processing apparatus 1 shown is executed by each module. For example, Figure 2 The step S101 shown can be performed by Figure 9 The collider acquisition module 101 shown is used to execute this. Figure 2 Steps S102 to S104 shown can be derived from Figure 9 The spherical collider projection module 102 shown is used to perform the above.
[0150] According to one embodiment of this application, Figure 9 The modules in the data processing device 1 shown can be individually or entirely combined into one or more modules, or some of the modules can be further divided into at least two functionally smaller units to achieve the same operation without affecting the technical effects of the embodiments of this application. The above modules are based on logical function division. In practical applications, the function of one module can also be implemented by at least two units, or the function of at least two modules can be implemented by one module. In other embodiments of this application, the data processing device 1 may also include other modules or units. In practical applications, these functions can also be implemented with the assistance of other modules, and can be implemented collaboratively by at least two modules.
[0151] In this embodiment, by using function mapping scaling to fit the accurate graphic of the collider component in screen space, the distortion error caused by camera perspective can be reduced, thereby improving the mapping accuracy of the collider component in screen space and achieving a balance between performance and accuracy. This improves the efficiency of collider component translation into screen space on lower-spec devices. While ensuring the accuracy of the converted graphic for aiming assistance, performance consumption can be reduced, allowing aiming assistance to be enabled throughout the game and enhancing the gaming experience.
[0152] Please see Figure 10 , Figure 10 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Figure 10 As shown, the computer device 1000 can be a terminal device, for example, the one described above. Figure 1 The terminal device 10a in the corresponding embodiment; or it can be a server, for example, Figure 1 The server 10d shown is illustrated below. For ease of understanding, the computer device is described below as a terminal device; the computer device 1000 may include: a processor 1001, a network interface 1004, and a memory 1005. Furthermore, the computer device 1000 may also include: a user interface 1003, and at least one communication bus 1002. The communication bus 1002 is used to implement communication between these components. The user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a Wi-Fi interface). The memory 1005 may be high-speed RAM or non-volatile memory, such as at least one disk storage device. Optionally, the memory 1005 may also be at least one storage device located remotely from the aforementioned processor 1001. Figure 10 As shown, the memory 1005, which is a computer-readable storage medium, may include an operating system, a network communication module, a user interface module, and a device control application.
[0153] The network interface 1004 in the computer device 1000 can also provide network communication functions, and the optional user interface 1003 can also include a display screen and a keyboard. Figure 10 In the computer device 1000 shown, the network interface 1004 provides network communication functionality; the user interface 1003 is mainly used to provide an input interface for the user; and the processor 1001 can be used to call the device control application stored in the memory 1005 to achieve: Retrieve the candidate collider components corresponding to the game's virtual objects; When the candidate collider component is spherical, the first center of the sphere of the candidate collider component is projected onto the screen space to obtain the first center of the sphere projection point, and the first spherical point of the candidate collider component is projected onto the screen space to obtain the first spherical projection point. The distance between the first center projection point and the first surface projection point is determined as the first initial radius; When the first spherical projection point exceeds the visualization range of the screen space, the first initial radius is scaled according to the screen center and coordinate origin of the screen space to obtain the component projection area of the candidate collider component in the screen space.
[0154] It should be understood that the computer device 1000 described in the embodiments of this application can execute the foregoing text. Figure 2 , Figure 5 as well as Figure 7 The description of the data processing method in any of the embodiments can also be performed as described above. Figure 9 The description of the data processing device 1 in the corresponding embodiments will not be repeated here. Furthermore, the beneficial effects of using the same method will also not be repeated here.
[0155] Furthermore, it should be noted that this application embodiment also provides a computer-readable storage medium, which stores a computer program executed by the aforementioned data processing device 1. The computer program includes computer instructions, and when the processor executes the computer instructions, it can execute the aforementioned... Figure 2 , Figure 5 as well as Figure 7 The description of the data processing method in any of the embodiments is redundant and will not be repeated here. Similarly, the beneficial effects of using the same method will not be repeated here either. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc. For technical details not disclosed in the embodiments of the computer-readable storage medium involved in this application, please refer to the description of the method embodiments of this application. As an example, program instructions can be deployed and executed on a single computer device, or on multiple computer devices located in one location, or on multiple computer devices distributed across multiple locations and interconnected via a communication network. Multiple computer devices distributed across multiple locations and interconnected via a communication network can constitute a blockchain system.
[0156] Furthermore, it should be noted that this application also provides a computer program product, which may include a computer program that can be stored in a computer-readable storage medium. The processor of a computer device reads the computer program from the computer-readable storage medium, and the processor can execute the computer program, causing the computer device to perform the aforementioned... Figure 2 , Figure 5 as well as Figure 7 The description of the data processing method in any of the embodiments is redundant and will not be repeated here. Similarly, the beneficial effects of using the same method will not be repeated here either. For technical details not disclosed in the computer program products or computer program embodiments related to this application, please refer to the description of the method embodiments of this application.
[0157] It is understood that in the description of the embodiments of this application, "when," "if," and "if" all refer to the device making corresponding processing under certain objective circumstances, and are not limited to a time, nor do they require the device to have a judgment action when it is implemented, nor do they mean that there are other limitations.
[0158] The terms "first," "second," etc., in the specification, claims, and drawings of this application are used to distinguish different media content, not to describe a specific order. Furthermore, the term "comprising," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, apparatus, product, or device that includes a series of steps or units is not limited to the listed steps or modules, but may optionally include steps or modules not listed, or may optionally include other step units inherent to these processes, methods, apparatuses, products, or devices.
[0159] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this application.
[0160] The methods and related apparatus provided in this application are described with reference to the method flowcharts and / or structural diagrams provided in this application. Specifically, each block of the method flowchart and / or structural diagram, as well as combinations of blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data display device to create a machine, such that the instructions executable by the processor of the computer or other programmable data display device generate instructions for implementing the process. Figure 1 A schematic diagram of one or more processes and / or structures. Figure 1 The computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data display device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 A schematic diagram of one or more processes and / or structures. Figure 1 The functions specified in one or more boxes. These computer program instructions may also be loaded onto a computer or other programmable display device to cause a series of operational steps to be performed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable device for implementing the process. Figure 1 A process or multiple processes and / or structures illustrate the steps of the functions specified in one or more boxes.
[0161] In the embodiments of this application, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.
[0162] The above-disclosed embodiments are merely preferred embodiments of this application and should not be construed as limiting the scope of this application. Therefore, any equivalent variations made in accordance with the claims of this application shall still fall within the scope of this application.
Claims
1. A data processing method, characterized in that, include: Retrieve the candidate collider components corresponding to the game's virtual objects; When the candidate collider component is spherical, the first center of the sphere of the candidate collider component is projected onto the screen space to obtain the first center of the sphere projection point, and the first spherical point of the candidate collider component is projected onto the screen space to obtain the first spherical projection point. The distance between the first center projection point and the first surface projection point is determined as the first initial radius; When the first spherical projection point exceeds the visualization range of the screen space, obtain the screen center and coordinate origin of the screen space; Obtain the first distance between the screen center and the first sphere projection point, obtain the second distance between the screen center and the first sphere projection point, and obtain the third distance between the coordinate origin and the screen center; The first scaling parameter is determined based on the first distance, the second distance, the third distance, and the first initial radius; The ratio of the first initial radius to the first scaling parameter is determined as the first projection radius. Based on the first projection radius, the component projection area of the candidate collider component in the screen space is determined.
2. The method according to claim 1, characterized in that, The process of obtaining the candidate collider component corresponding to the game virtual object includes: Obtain the array of colliders corresponding to the game virtual objects, wherein the array of colliders includes at least one collider component; Obtain the array index of the collider array, and determine the candidate collider component indicated by the array index among at least one collider component contained in the collider array.
3. The method according to claim 1, characterized in that, The step of projecting the first spherical point of the candidate collider assembly onto the screen space to obtain the first spherical projection point includes: In the vertical visual direction of the first sphere center, determine the first spherical point of the candidate collider component and obtain the three-dimensional coordinate information of the first spherical point; Obtain the camera view matrix, and convert the three-dimensional coordinate information into the observation coordinate information of the first spherical point based on the camera view matrix; Obtain the camera projection matrix, and convert the observation coordinate information into the clipping coordinate information of the first spherical point based on the camera projection matrix; The cropping coordinate information is normalized to obtain standardized coordinate information. Based on the screen size of the screen space and the standardized coordinate information, the first spherical projection point of the first spherical point in the screen space is determined.
4. The method according to claim 1, characterized in that, The step of determining the first scaling parameter based on the first distance, the second distance, the third distance, and the first initial radius includes: The first reference length is obtained by summing the square of the first distance and the square of the second distance. Obtain a constant parameter, and sum the constant parameter with the square of the third distance to obtain the second reference length; The second reference length is summed with the first initial radius to obtain the third reference length, and the ratio of the first reference length to the third reference length is determined as the first scaling parameter.
5. The method according to claim 1, characterized in that, The method further includes: When the first spherical projection point is within the visualization range, a circular region is determined based on the first initial radius, and the circular region is determined as the component projection region of the candidate collider component in the screen space.
6. The method according to claim 1, characterized in that, The method further includes: When the candidate collider component is hexahedral, the vertices of the candidate collider component are projected onto the screen space to obtain vertex projection points; Based on the vertex projection point, the component projection area of the candidate collider component in the screen space is determined.
7. The method according to claim 1, characterized in that, The method further includes: When the candidate collider assembly is shaped like a cylindrical sphere, the second and third centers of the sphere are obtained; the candidate collider assembly shaped like a cylindrical sphere comprises two hemispheres and a cylinder; The second sphere center is projected onto the screen space to obtain the second sphere center projection point; the third sphere center is projected onto the screen space to obtain the third sphere center projection point. Determine a second spherical point on the hemisphere to which the second sphere center belongs, and project the second spherical point onto the screen space to obtain a second spherical projection point; A third spherical point is determined on the hemisphere to which the third sphere center belongs, and the third spherical point is projected onto the screen space to obtain the third spherical projection point; Based on the second sphere center projection point, the second spherical projection point, the third sphere center projection point, and the third spherical projection point, the component projection area of the candidate collider component in the screen space is determined.
8. The method according to claim 7, characterized in that, The step of determining the component projection area of the candidate collider component in the screen space based on the second sphere center projection point, the second spherical surface projection point, the third sphere center projection point, and the third spherical surface projection point includes: The distance between the second and third center projection points is determined as the projected height of the cylinder in the candidate collider assembly. The distance between the second sphere center projection point and the second sphere surface projection point is determined as the second initial radius, and the distance between the third sphere center projection point and the third sphere surface projection point is determined as the third initial radius; Based on the projection height, the second initial radius, the third initial radius, the relationship between the second spherical projection point and the visualization range, and the relationship between the third spherical projection point and the visualization range, the component projection area of the candidate collider component in the screen space is determined.
9. The method according to claim 8, characterized in that, The step of determining the component projection area of the candidate collider component within the screen space based on the projection height, the second initial radius, the third initial radius, the relationship between the second spherical projection point and the visualization range, and the relationship between the third spherical projection point and the visualization range includes: When the second spherical projection point is outside the visualization range and the third spherical projection point is within the visualization range, a fourth reference length is determined based on the distance between the screen center and the second spherical projection point, and the distance between the screen center and the second spherical projection point. Based on constant parameters and the distance between the origin of the coordinate system and the center of the screen, a fifth reference length is determined, and the sum of the fifth reference length and the second initial radius is determined as a sixth reference length. The ratio of the fourth reference length to the sixth reference length is determined as the second scaling parameter, and the ratio of the second initial radius to the second scaling parameter is determined as the second projection radius; The component projection area of the candidate collider component in the screen space is determined based on the projection height, the second projection radius, and the third initial radius.
10. The method according to any one of claims 1 to 9, characterized in that, The number of candidate collider components is M, where M is a positive integer; The method further includes: Based on the component projection area of each of the M candidate collider components, the object projection area of the game virtual object in the screen space is determined. Based on the object's projection area, the aiming operation of the business object in the game business is corrected.
11. A data processing apparatus, characterized in that, include: The collider acquisition module is used to acquire candidate collider components corresponding to virtual objects in the game. The spherical collider projection module is used to project the first center of the candidate collider component onto the screen space to obtain the first center of the sphere projection point, and to project the first spherical point of the candidate collider component onto the screen space to obtain the first spherical projection point when the candidate collider component is spherical. The spherical collider projection module is also used to determine the distance between the first sphere center projection point and the first sphere surface projection point as the first initial radius; The spherical collider projection module is also used to obtain the screen center and coordinate origin of the screen space when the first spherical projection point exceeds the visualization range of the screen space. The spherical collider projection module is also used to obtain a first distance between the center of the screen and the first spherical center projection point, a second distance between the center of the screen and the first spherical projection point, and a third distance between the origin of the coordinate system and the center of the screen. The spherical collider projection module is further configured to determine a first scaling parameter based on the first distance, the second distance, the third distance, and the first initial radius; The spherical collider projection module is further configured to determine the ratio of the first initial radius to the first scaling parameter as the first projection radius, and to determine the component projection area of the candidate collider component in the screen space based on the first projection radius.
12. A computer device, characterized in that, Including memory and processor; The memory is connected to the processor, the memory is used to store computer programs, and the processor is used to invoke the computer programs so that the computer device performs the method according to any one of claims 1 to 10.
13. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program adapted to be loaded and executed by a processor to cause a computer device having the processor to perform the method of any one of claims 1 to 10.
14. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, implements the method according to any one of claims 1 to 10.