Sphere Surface Role Control Method, System and Device

By combining dynamic correction, tangential projection, and terrain snapping, the problems of high computational overhead and unstable terrain snapping in spherical character control are solved, achieving efficient and stable spherical movement and terrain adaptation, thus improving operational performance and visual coherence.

CN122134929APending Publication Date: 2026-06-02GUANGDONG TIANYUN TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
GUANGDONG TIANYUN TECH CO LTD
Filing Date
2026-02-27
Publication Date
2026-06-02

Smart Images

  • Figure CN122134929A_ABST
    Figure CN122134929A_ABST
Patent Text Reader

Abstract

This invention provides a method, system, and device for controlling a character on a sphere's surface. A coordinate system dynamic correction module calculates the direction from the sphere's center to the character's current position in real time to determine a local ascent vector. Based on this local ascent vector, the character's rotational posture is corrected so that the character's feet always face the sphere's center, and a local coordinate system is constructed using the local ascent vector. A vector projection module acquires the camera's direction vector and performs orthogonal projection processing on it using the local coordinate system to generate a tangential movement vector parallel to the tangential plane of the ground surface. This tangential movement vector is then used to drive the character to perform displacement operations. A terrain adsorption module responds to the displacement operations by emitting a probe ray based on the local ascent vector direction determined by the local coordinate system to perform sampling processing on the ground grid, acquiring the intersection point between the probe ray and the ground grid, determining the character's target height based on the intersection point, and correcting the character's position using the target height so that the character adheres to the ground grid in real time during movement.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of 3D virtual simulation and game development technology, and more specifically, to a method, system and device for controlling characters on the surface of a sphere. Background Technology

[0002] In 3D virtual simulation, space exploration games, or miniature planet modeling scenarios, character control systems need to break away from the traditional "flat world" assumption. Because the direction of gravity in such scenarios is not constant upward along the Y-axis of the world coordinate system, but always points towards the center of the sphere, this places extremely high technical demands on the character's movement logic, posture synchronization, and stability in terrain adaptation.

[0003] Existing sphere character control schemes typically employ an integrated control approach based on a rigid body physics engine. This approach first loads a heavy-duty physics engine library (such as Ammo.js or Cannon.js) into the scene, then defines a radial gravitational field originating from the sphere's center, and finally uses the physics engine's built-in collision detection and dynamics simulation to achieve the character's attraction and movement.

[0004] However, this physics engine-based control scheme has obvious technical flaws. The introduction of the physics engine brings huge CPU computing overhead and memory consumption, resulting in low running efficiency on web or mobile devices and easily causing frame rate drops. At the same time, when the character moves at high speed on procedurally generated undulating terrain (such as complex mountains or canyons), the collision calculation of the physics engine is prone to "clipping" or "hanging" phenomena, and traditional planar movement vectors cannot guarantee that the character will always move smoothly along a great circle path on a sphere. Summary of the Invention

[0005] To address the aforementioned technical problems, this application provides a method and apparatus for controlling the role of a sphere's surface, thereby at least alleviating the aforementioned technical problems.

[0006] A method for controlling the role of a sphere surface includes: The coordinate system dynamic correction module calculates the direction from the center of the sphere to the current position of the character in real time to determine the local ascent vector. Based on the local ascent vector, the rotation posture of the character is corrected so that the bottom of the character's feet always faces the center of the sphere. The local coordinate system is constructed using the local ascent vector to constrain vector projection and ray sampling. The vector projection module obtains the camera direction vector and performs orthogonal projection processing on the camera direction vector using the local coordinate system to generate a tangential movement vector parallel to the tangential plane of the ground surface, and uses the tangential movement vector to drive the character to perform displacement operations; In response to the displacement operation, the terrain adsorption module emits a probe ray based on the local upward vector direction determined by the local coordinate system to perform sampling processing on the surface grid, obtains the intersection point of the probe ray and the surface grid, determines the target height of the character based on the intersection point, and uses the target height to correct the position of the character so that the character is in real time attached to the surface grid during movement.

[0007] A three-dimensional virtual simulation system or online game system that applies the spherical surface character control method described in any one of the claims of this application.

[0008] A spherical surface role control device includes a processor and a memory, the memory for storing a computer-executable program, and the processor for executing the computer-executable program to implement the method described in any one of the embodiments of this application.

[0009] This application's spherical surface character control scheme addresses the technical shortcomings of traditional physics engine-based schemes, such as high computational overhead, poor terrain-fitting stability, and complex spherical movement logic. It solves the problem of spherical posture imbalance caused by the fixed direction of gravity in traditional schemes by using a coordinate system dynamic correction module to calculate the local ascent vector in real time and correct the rotational attitude. Compared to traditional schemes that rely on physics engine libraries for gravity simulation, this application uses a local ascent vector determined by geometric vector calculations, ensuring that the character's feet always point towards the center of the sphere with high stability. This provides a precise attitude reference for free movement at any location on the sphere (such as the equator or Antarctica).

[0010] This invention constructs a local coordinate system based on a local ascending vector and uses a vector projection module to generate a tangential movement vector to drive character displacement, solving the problem of movement logic failure in traditional solutions on a spherical surface. Compared to traditional solutions where characters easily fly off the surface or deviate from their movement trajectory when moving on a sphere, this application "flattens" the camera direction vector onto the current tangential plane of the ground through orthogonal projection, ensuring that the displacement direction is always parallel to the tangential direction of the sphere. This allows the character to move smoothly along a great circle path, significantly improving control smoothness in omnidirectional gravity environments.

[0011] By emitting detection rays through a terrain adsorption module for sampling and processing, and using the obtained intersection points to correct the character's target height, this approach overcomes the technical shortcomings of traditional physics engines, such as high collision detection overhead and susceptibility to clipping. Compared to the complex collision matrix calculations in traditional solutions, this application employs a reverse ray detection mechanism, combined with a local ascending vector to probe the ground vertically downwards from "high altitude." This allows for the acquisition of real-time heights of complex terrains with lower algorithmic complexity, enabling characters to maintain high ground-hugging stability in undulating height fields. This effectively eliminates the phenomenon of characters being suspended in mid-air or sinking into the ground, significantly reducing the CPU consumption of the system on mobile and web platforms.

[0012] Finally, through the organic combination of "dynamic correction, tangential projection, and terrain adsorption," a complete lightweight geometric control link is formed. This solution abandons expensive rigid body physics simulation and instead uses pure geometric vector calculation to achieve efficient spherical simulation. Compared with traditional solutions, this application greatly optimizes the running performance while ensuring the accuracy of character control and terrain adaptability, and is more adaptable to the real-time interaction needs in large-scale spherical scenes. Attached Figure Description

[0013] Figure 1 This is a schematic flowchart of a sphere surface role control method according to an embodiment of this application.

[0014] Figure 2 This is a structural diagram of a spherical surface role control device according to an embodiment of this application.

[0015] Figure 3 This is a hardware architecture diagram of a terminal device according to an embodiment of this application.

[0016] Figure 4 This is a schematic diagram of a sphere surface role control system based on tangent plane projection, according to an embodiment of this application. Detailed Implementation

[0017] like Figure 1 As shown, this is an embodiment of a spherical surface role control method according to this application, which includes: The coordinate system dynamic correction module calculates the direction from the center of the sphere to the current position of the character in real time to determine the local ascent vector. Based on the local ascent vector, the rotation posture of the character is corrected so that the bottom of the character's feet always faces the center of the sphere. The local coordinate system of constraint vector projection and ray sampling is constructed using the local ascent vector. The vector projection module obtains the camera direction vector and performs orthogonal projection processing on the camera direction vector using the local coordinate system to generate a tangential movement vector parallel to the tangential plane of the ground surface, and uses the tangential movement vector to drive the character to perform displacement operations; In response to the displacement operation, the terrain adsorption module emits a probe ray based on the local upward vector direction determined by the local coordinate system to perform sampling processing on the surface grid, obtains the intersection point of the probe ray and the surface grid, determines the target height of the character based on the intersection point, and uses the target height to correct the position of the character so that the character is in real time attached to the surface grid during movement.

[0018] Optionally, the coordinate system dynamic correction module specifically performs the following steps: Obtain the current 3D spatial coordinates representing the character's current position; Calculate the unit vector from the center of the sphere to the current three-dimensional spatial coordinates to determine the local ascending vector.

[0019] Preferably, the specific implementation process of the coordinate system dynamic correction module to obtain the current three-dimensional spatial coordinates representing the current position of the character is as follows: When constructing spherical virtual simulation application scenarios such as miniature planets or space simulations, this module first accesses the spatial transformation component of the character object in the virtual simulation engine in real time, and extracts the real-time spatial pose information of the character relative to the origin of the virtual scene to obtain the current three-dimensional spatial coordinates representing the current position of the character. The current three-dimensional spatial coordinates As the fundamental spatial vector describing the position of a character in a three-dimensional spherical environment, its components , , These correspond to the measurements of the world coordinate system along the three orthogonal axes, providing a precise spatial reference input for subsequent calculations of the local gravitational direction.

[0020] Preferably, in the specific technical implementation of the coordinate system dynamic correction module for calculating the local ascending vector, the module defines the center of the virtual sphere as the coordinate origin (e.g., a position with coordinates of 0,0,0), and utilizes the obtained current three-dimensional spatial coordinates. Perform vector operations. Specifically, this module uses the current three-dimensional spatial coordinates... The coordinates of the virtual sphere's center are subtracted from the coordinates of the sphere's center to obtain a direction vector pointing from the Earth's center to the character's position. To ensure consistency between subsequent rotational posture correction and vector orthogonal projection calculations, this module performs normalization on the direction vector to determine the local ascending vector. The local ascending vector For a unit vector whose modulus satisfies a preset unit length (e.g., length 1.0), its technical essence conforms to the formula. ,in Represents the local ascending vector, Represents the current three-dimensional spatial coordinates. This represents a normalization function that scales the vector length to a unit ratio, thereby establishing a local gravity reference direction that dynamically drifts with the character's position.

[0021] Preferably, in a scenario, the local ascending vector In the specific implementation of constructing the local coordinate system, this module utilizes the local ascending vector. The vertical axis reference of the local coordinate system. The local ascending vector. The vector is passed to the attitude synchronization logic to calculate the local ascending vector from the character's current vertical axis. The quaternion rotation offset between them drives the character to perform a pose alignment action, ensuring that the character's feet always point vertically towards the center of the virtual sphere. Simultaneously, the determined local ascent vector... It participates in the projection calculation of the movement vector, serving as the normal vector defining the tangent plane of the ground surface, so that the externally input control commands can be constrained to be perpendicular to the local ascending vector. On the virtual cross-section, a movement component parallel to the ground surface is obtained. Furthermore, the local ascending vector... It also determines the emission polarity of the terrain sampling rays, guiding the probe rays along the local ascending vector. The terrain height detection is performed in the opposite direction, allowing the character to adapt to irregular surface undulations in real time based on the detected intersection position, ensuring the logical rigor and performance stability of motion control in the "omnidirectional gravity" environment.

[0022] Optionally, the coordinate system dynamic correction module performs the following steps when correcting the character's rotational posture: The quaternion algorithm is used to perform calculations to determine the rotational offset between the character's orientation vector and the local ascending vector; The rotation offset is applied to the character's world rotation parameters based on the quaternion algorithm, and the character's rotation posture is updated using the world rotation parameters so that the orientation vector is aligned with the local ascending vector.

[0023] Preferably, in the process of synchronizing the pose of a character in a scenario involving a miniature planet or sphere, the specific implementation process of the coordinate system dynamic correction module correcting the character's rotational posture is as follows: The module first extracts the local longitudinal component vector of the character body in the current local coordinate system from the character transformation component of the simulation system ( Character LocalUp Vector), which represents the character's current logical orientation from the bottom of their feet to the top of their head; synchronously, the module retrieves the target local up vector (which was calculated based on the current coordinates in the previous step) The target local up vector is a normalized vector pointing from the center of the sphere to the character's current position P. To ensure the character can stand perpendicular to the center of the sphere at any position on its surface, this module uses a quaternion algorithm to optimize the local up vector. With the target local ascending vector Orthogonal transformation calculations are performed. Specifically, the projection and rotation axis extraction processes are executed by calling the unit vector alignment function SetFromUnitVectors to generate a rotation offset that reflects the character's pose deviation. Alignment Quaternion). The rotational offset. It can accurately represent the minimum angular displacement rotation from the character's current local vertical axis towards the sphere's normal direction, and its technical essence follows the formula. ,in The starting vector for rotation, The target vector is rotated.

[0024] Preferably, in the specific technical implementation of the coordinate system dynamic correction module, the rotation offset is determined. Then, it is used as an incremental operator to update the character's pose in the pose reconstruction calculation. The module extracts the character's current pose quaternion in the world coordinate system ( The Player World Rotation Quaternion stores the character's global space rotation state before the current correction is performed; subsequently, the module assigns the rotation offset... Applied to the quaternion of the character's pose The specific processing method involves performing rotational cascading through quaternion multiplication operations, and then calculating the rotational offset. Left-multiply by the quaternion of the character's pose This allows us to obtain the updated world rotation parameters. The technical essence of this logical processing follows the quaternion cascade formula. By compensating for rotation amount By overlaying it onto the original pose data, the coordinate system of the character's body in world space was aligned.

[0025] Preferably, in a scenario, when updating the character's rotation pose using the world rotation parameters, the updated character pose quaternion... The transformation matrix of the character object is written back into the object's transformation matrix. This process directly drives the character's 3D model to reshape its physical posture, ensuring that the character's orientation vector, which was originally fixed upwards relative to the world coordinate system, is aligned in real-time with the geocentric normal at any latitude and longitude on the sphere's surface. This dynamic alignment mechanism, based on quaternions, not only avoids the gimbal lock-up problem common in traditional Euler angle calculations but also ensures high smoothness in the character's rotational posture transitions when rapidly crossing special regions on the sphere where gravitational direction changes drastically, such as the equator or the North and South Poles. The updated rotational posture not only keeps the character's feet always facing the center of the sphere but also provides an accurate local reference for the subsequent vector projection module. This allows externally inputted movement commands to be accurately projected onto the tangent plane beneath the character's feet, ensuring a perfect match between the movement trajectory and the sphere's curvature.

[0026] Optionally, the vector projection module further performs the following steps: Obtain the control input vector; Extract the component vector of the camera in the world coordinate system, wherein the component vector includes at least a forward component and a right component; A linear synthesis is performed on the control input vector, the forward component, and the rightward component to generate the camera orientation vector.

[0027] Preferably, the specific implementation process of the vector projection module to obtain the control input vector is as follows: In a 3D virtual simulation or online game character movement control scenario, this module intercepts the raw hardware signal stream generated by the user's operating terminal (such as a keyboard, gamepad, or joystick) through a real-time acquisition mechanism. The raw hardware signal stream is converted into a standardized displacement signal corresponding to the logical axis, and axial mapping and amplitude normalization processing are performed to obtain a control input vector representing the user's operating intention. The control input vector contains numerical information representing the movement intensity and polarity (such as a two-dimensional numerical pair containing the longitudinal axis increment and the lateral axis increment), providing a basic operational dimension for subsequent spatial synthesis of the target motion vector by combining camera field-of-view features.

[0028] Preferably, in the specific technical implementation of the vector projection module for extracting the camera's component vectors in the world coordinate system, this module obtains the transformation matrix of the virtual camera object in the global space in real time. By performing matrix decomposition or a specific axial vector separation operation on the transformation matrix, the camera's component vectors in the world coordinate system are obtained. Specifically, through the axial vector separation operation, at least the unit component vector pointing forward from the camera's field of view, i.e., the forward component (…), is obtained. ), and the unit vector pointing to the right side of the camera's field of view, i.e., the rightward component ( The obtained forward and rightward components serve as spatial references for defining the character's movement reference system. Their orientation is updated in real time with the dynamic rotation of the camera's posture, ensuring that the character's movement direction is always logically aligned with the user's field of view.

[0029] Preferably, in a scenario, when performing linear synthesis on the control input vector, the forward component, and the rightward component to generate a camera orientation vector, this module uses the obtained forward and rightward components as the synthesis foundation and introduces component weights from the control input vector. Specifically, this module performs scalar multiplication on the longitudinal weight component extracted from the control input vector and the forward component, and simultaneously performs scalar multiplication on the lateral weight component extracted from the control input vector and the rightward component. Finally, it performs vector accumulation on the two resulting intermediate weighted vectors. The technical essence of the linear synthesis follows the formula... ,in This represents the generated camera orientation vector. This represents the vertical weight component extracted from the control input vector (e.g., determined based on the W / S key state). Floating-point values ​​between 1 and 1.0 This represents the extracted forward component. This represents the lateral weight component extracted from the control input vector (such as a floating-point value between -1.0 and 1.0 determined based on the A / D key state). This represents the extracted rightward component. The camera orientation vector obtained through the above accumulation process converges the user's control intention and the current viewpoint spatial features of the camera. As the processing object for subsequent projection operations, it can effectively filter out invalid displacement components perpendicular to the ground surface through normal projection processing in the local coordinate system, thereby enabling the character to perform omnidirectional smooth movement on the surface of an irregular sphere in a way that conforms to human visual intuition.

[0030] Optionally, when performing orthogonal projection processing on the camera direction vector, the vector projection module specifically performs the following steps: Calculate the projection component vector of the camera orientation vector in the direction of the local ascending vector; The projection component vector is removed from the camera orientation vector to generate the tangential translation vector.

[0031] Preferably, in the process of controlling the motion of a sphere surface in a 3D virtual simulation or space simulation scene, the specific implementation process of the vector projection module performing orthogonal projection processing on the camera direction vector is as follows: The module first receives the camera direction vector synthesized and determined by the preceding steps. Simultaneously, the local ascent vector output in real time by the coordinate system dynamic correction module is acquired. The camera orientation vector The original movement vector represents the user's operational intent and the camera's field of view orientation, while the local ascending vector... This represents the normalized normal vector pointing from the center of the sphere to the character's current position P. To ensure the character doesn't fly off the ground or sink into the center while walking on the sphere, this module calculates the camera orientation vector. In the local ascending vector The distribution along the direction is determined by using a vector projection decomposition algorithm to determine the normal projection correlation strength between the two, so as to obtain the projection component vector of the camera direction vector in the local ascending vector direction.

[0032] Preferably, in the specific implementation of the vector projection module, the process of generating the projection component vector of the camera orientation vector in the local ascending vector direction follows the principle of geometric orthogonal decomposition. This module utilizes the camera orientation vector... With the local ascending vector Performing a vector dot product operation yields the vector representing the camera orientation. The projection length scalar in the normal direction, and then the projection length scalar is compared with the local ascending vector. A scalar multiplication process is performed to obtain the projected component vector of the camera orientation vector, representing the movement component perpendicular to the ground surface, in the local ascending vector direction. Next, the module performs a vector subtraction operation from the original camera orientation vector... The projection component vector of the camera orientation vector in the local ascending vector direction is subtracted to generate the tangential translation vector. The technical essence of the orthogonal projection processing follows the formula. ,in This represents the generated tangential translation vector. The input camera orientation vector. The local upward vector representing the opposite direction of gravity is subtracted from the projected component after the dot product operation to ensure that the displacement vector coincides precisely with the tangent of the Earth's surface.

[0033] Preferably, in a scene, the generated tangential movement vector The specific application details in the overall scheme are as follows: the tangential movement vector It is a two-dimensional restricted vector located in the tangent plane of the ground surface, and its direction is always parallel to the virtual tangent plane where the character's feet are located, thus effectively eliminating the camera direction vector. Local rising vector along the middle Invalid movement trends in the direction of or opposite to the direction of motion. The generated tangential movement vector. This is then passed to the movement execution logic as the power input that drives the character to generate physical displacement. This is achieved through the tangential movement vector. The character's current 3D spatial coordinates are updated stepwise along the spherical curvature, allowing the character to move spherically along a great circle path in a geometrically logical manner without relying on a heavy rigid body physics engine. Simultaneously, the resulting character displacement operation serves as an asynchronous trigger source for the terrain snapping module, guiding subsequent inverse ray sampling logic to perform height compensation at the new position after movement, ensuring the character maintains a high degree of ground-hugging coupling even in complex, undulating terrain.

[0034] Optionally, before performing sampling processing, the terrain adsorption module further performs the following steps: Based on the character's current position coordinates and the tangential movement vector, calculate the predicted displacement coordinates; Starting from the predicted displacement coordinates, displacement offset processing is performed along the positive direction of the local ascending vector to determine the sampling starting point position for sampling processing of the surface grid.

[0035] Preferably, the specific implementation process of the terrain adsorption module in calculating and predicting displacement coordinates is as follows: In the simulation scenario of character movement on the surface of a sphere, when the vector projection module generates the tangential movement vector used to drive the character's displacement... Then, the terrain snapping module obtains the current position coordinates P, which represent the character's current position. Subsequently, the terrain snapping module compares the current position coordinates P with the tangential movement vector. Perform vector overlay calculations to generate predicted displacement coordinates that characterize the movement trend of the character in the current motion frame. The obtained predicted displacement coordinates It can pre-determine the spatial position components of the character after tangential movement on the sphere, providing accurate spatial positioning basis for subsequent terrain height detection in the local vertical dimension.

[0036] Preferably, in the specific technical implementation of the terrain adsorption module performing displacement offset processing to determine the sampling starting point position, this module utilizes the local ascending vector determined in the previous step. With the preset sampling start height The offset calculation is performed. Specifically, this module calculates the local ascending vector. With the sampling start height A scalar multiplication process is performed to obtain the lift offset vector representing the vertical height compensation. Next, the module converts the predicted displacement coordinates... A vector addition process is performed with the aforementioned shift offset vector to generate the sampling start point position for performing sampling processing on the surface grid. The technical essence of this logical processing follows a formula. ,in This represents the location of the sampling start point. Represents the predicted displacement coordinates. This represents the local ascent vector that characterizes the opposite direction of local gravity. This represents the initial sampling height to ensure the X-ray source is within a safe range above the Earth's surface. This "predictive displacement followed by uplift" process ensures that subsequent detection rays can cover irregular surface features with high stability.

[0037] Preferably, in a scenario, the sampling start point location is determined. The technical contribution of the overall solution lies in constructing a "high-altitude vertical sampling" mechanism. The generated sampling starting point location... As the starting point for emitting probe rays in subsequent steps, the terrain adsorption module is driven from the sampling starting point position. Along the local ascending vector The detection ray is emitted in the opposite direction. This reverse sampling method, from the outside in, solves the problem in traditional schemes where rays emitted from the character's center easily get stuck in the ground surface during high-speed movement, thus fundamentally preventing "clipping" or "grounding" phenomena. The obtained sampling starting point position is then used... Emitting a probe ray ensures that the probe path always starts above the ground, thus making the intersection of the probe ray and the ground grid highly geometrically valid. This provides a physically reliable sampling basis for accurately determining the target height of the character and correcting the character's real-time position coordinates.

[0038] Optionally, when the terrain adsorption module emits detection rays, it specifically performs the following steps: The probe ray is emitted from the sampling starting point in the opposite direction of the local ascending vector, and the probe ray is used to probe the surface grid.

[0039] Preferably, the specific implementation process of the terrain adsorption module emitting the detection ray is as follows: the module first calls the sampling starting point position determined in the previous process. As the physical source of the probe beam, and to obtain the local ascending vector output by the coordinate system dynamic correction module. To establish a detection path perpendicular to the center of the sphere, this module adjusts the local ascending vector. Perform a vector inversion operation to obtain the ray detection direction that is consistent with the current local gravity direction. The direction of the ray detection The technical essence follows the formula ,in This represents the direction of the generated ray detection. This represents the inverse vector after performing inverse scaling on the local ascending vector. Subsequently, this module combines this with the sampling start point position. With the direction of the ray detection Parametric line segment construction is performed to generate the probe ray. The resulting probe ray carries spatial addressing logic, providing a geometric basis for subsequent precise terrain sampling in a complex spherical height field.

[0040] Preferably, in the specific technical implementation of the terrain adsorption module using the probe ray to detect the surface grid, the module uses the generated probe ray as a geometric sampling operator to project it onto the terrain collision layer of the virtual scene, driving the probe ray along the ray detection direction. Intersection detection processing is performed on the surface mesh that constructs the virtual terrain. During the detection process, this module executes a ray detection algorithm based on bounding box detection or triangular facet intersection testing to calculate the geometric interference state between the detection ray and the surface mesh in real time. Through this detection processing, the detection ray geometrically intersects with the surface mesh during spatial movement, thereby generating sampling detection results that reflect the actual terrain undulations below the predicted position of the character's movement.

[0041] Preferably, in a scenario where the probe ray is used to probe the surface grid to obtain intersection points, this module performs a geometric intersection operation on the sampled probe results. Specifically, this module determines the intersection points of the probe ray and the surface grid by analyzing the intersection properties of the probe ray and the surface grid. The technical essence of the intersection points conforms to the formula... ,in The intersection point is defined. The function represents the ray intersection calculation, and Ray represents the probe ray. The obtained intersection point is then passed to the height correction process, where the height value is extracted and combined with a preset height offset to determine the character's target height. This processing method, which emits the probe ray from the sampling starting point to detect the surface mesh, constructs a "high-altitude dive" reverse sampling mechanism. This ensures that even when the character is performing high-speed displacement operations or crossing the surface mesh with severe undulations (such as deep pits or cliff edges), it can accurately lock onto the physical support surface of the ground. This effectively alleviates the "clipping" or "hanging" problems caused by insufficient calculation frequency in traditional physics engines, and significantly improves the ground-hugging coupling of the spherical character control in complex terrain.

[0042] Optionally, when the terrain adsorption module determines the target height of the character based on the intersection point, it specifically performs the following steps: Determine the coordinates of the first intersection point between the probe ray and the surface grid; The height value is extracted from the coordinates of the first intersection point, and a preset height offset is used to calculate the height. The calculated result is then determined as the target height.

[0043] Preferably, the specific implementation process of the terrain adsorption module determining the coordinates of the first intersection point between the probe ray and the surface mesh is as follows: In a control scenario involving an uneven spherical surface, the terrain adsorption module acquires the probe ray emitted from high altitude in the previous steps and the surface mesh representing the terrain geometry. The terrain adsorption module drives the probe ray to perform ray-triangular facet intersection detection along the local gravity direction towards the surface mesh, in order to capture the physical contact point generated by the collision between the probe ray and the surface mesh on its spatial path. By performing the intersection detection action, the terrain adsorption module obtains the coordinates of the first intersection point (…). The first intersection point coordinates precisely pinpoint the spatial location of the terrain surface closest to the sphere below the character's predicted displacement path, providing a definite geometric anchor point for subsequent height adaptation.

[0044] Preferably, in the specific technical implementation where the terrain adsorption module extracts the height value from the coordinates of the first intersection point and calculates using the preset height offset, the module obtains the coordinates of the first intersection point (…). After that, the component analysis operation is performed. Specifically, the terrain adsorption module starts from the coordinates of the first intersection point ( The elevation component (height value) is extracted from the data and distributed radially relative to the center of the sphere. This value represents the original elevation of the current terrain. Subsequently, the terrain adsorption module retrieves a pre-set elevation offset (…). Height offset), the height offset ( This represents the safe clearance between the character's foot center and the ground surface (e.g., the distance between the root node of the character model's skeleton and the sole of the foot). The terrain snapping module will extract the height value and the height offset ( As the input operator, a vector accumulation calculation based on the local ascending vector is performed to generate the corresponding calculation result.

[0045] Preferably, in a given scenario, when the terrain adsorption module determines the calculated result as a specific implementation of the target height, the terrain adsorption module performs a height remapping operation. The calculation process follows the following fundamental technical principles: .in, Represents the determined target height result ( The target height result defines the final world coordinates of the character after the terrain snapping is performed; The coordinates of the first intersection point resulting from the collision between the probe ray and the surface mesh ( ); The height offset represents the correction for a suspended or through-the-mold state. The obtained target height result ( This data is then written back to the character's spatial positioning component, driving the character's real-time position coordinates to be forcibly aligned with the undulations of the surface mesh. This implementation of the technical logic allows the character's height to exhibit a high degree of ground-hugging smoothness when rapidly traversing surface areas with significant elevation differences. This effectively avoids the technical bottleneck that could cause the character to sink underground or float in the air due to physics engine collision calculation delays, significantly enhancing the visual coherence of the spherical surface movement simulation.

[0046] Optionally, the terrain adsorption module further performs the following steps: Extract the terrain normal features corresponding to the surface grid from the coordinates of the first intersection point; Foot tilt correction processing is performed based on the terrain normal features to obtain the corrected foot tilt.

[0047] Preferably, the specific implementation process of the terrain adsorption module extracting the terrain normal features corresponding to the surface mesh from the first intersection point coordinates is as follows: When the character moves along the surface of the sphere to a complex terrain area with undulating changes (such as the edge of a meteorite crater or a mountain slope), the terrain adsorption module obtains the coordinates of the first intersection point generated by the collision of the probe ray with the surface mesh (Mesh). The first intersection point coordinates). Subsequently, the terrain adsorption module retrieves the coordinates corresponding to the first intersection point from the surface mesh. The index of the triangular facet containing the given facet is used to query and parse the unit normal vector of that facet in 3D space, thereby obtaining the terrain normal feature. The obtained terrain normal features ( , terrain normal features). It can accurately reflect the geometric tilt of the small surface area where the character is currently located, providing the necessary surface orientation parameters for the subsequent smooth fit between the feet and the ground.

[0048] Preferably, in the specific technical implementation of the terrain adsorption module performing foot tilt correction processing based on the terrain normal features, the module receives the extracted terrain normal features ( ) and the local ascending vector output by the coordinate system dynamic correction module ( The terrain adsorption module uses the vector angle calculation formula or quaternion alignment algorithm to calculate the terrain normal features (local ascending vector). ) relative to the local ascending vector ( The spatial deflection of ) to generate tilt-corrected quaternions ( The terrain adsorption module then uses the generated tilt-corrected quaternion (...). The terrain snapping module performs vector superposition operations with the character's current foot bone rotation components. Through this real-time mapping of rotation components, the terrain snapping module performs fine-tuning actions on the character model's foot posture to obtain the corrected foot tilt.

[0049] Preferably, in a scenario, the technical effect of obtaining the corrected foot tilt angle on the overall solution is as follows: When a character crosses a steep slope (e.g., a slope greater than a preset angle) in an extremely lightweight spherical simulation environment... When the terrain features (such as the terrain surface) are being considered, the corrected foot tilt is passed to the animation state machine or transformation component, driving the character model's foot mesh to perform rotation compensation. This process ensures that the character's foot plane is aligned with the terrain normal feature (such as the terrain surface). The defined tangent plane reaches a quasi-parallel state, thus effectively avoiding the visual clipping defects commonly found in non-planar terrain, such as heels "hanging in the air" or toes "sinking into the ground." Utilizing the aforementioned terrain normal features ( ) and the local ascending vector ( The geometric linkage enables characters to exhibit a high degree of standing stability and terrain adaptability without relying on complex rigid body physics engine collision bodies. This provides definite technical support for improving the visual realism in spherical application scenarios.

[0050] This application also provides a three-dimensional virtual simulation system or online game system that applies the spherical surface character control method described in any of the above embodiments.

[0051] like Figure 2 As shown, a spherical surface role control device according to an embodiment of this application includes a processor and a memory; the memory is used to store a computer-executable program; the processor is used to execute the computer-executable program to implement the spherical surface role control method according to any embodiment of this application.

[0052] like Figure 3 As shown, this is a terminal device according to an embodiment of the present application, which includes: an instruction input interface, a memory, a processor, and a graphics rendering module. The instruction input interface receives external raw control signals, the processor calls instructions in the memory to perform spherical coordinate dynamic correction, vector projection, and terrain snapping calculations, and the graphics rendering module finally completes real-time rendering based on the position coordinates and attitude data output by the processor.

[0053] like Figure 4As shown in the figure, a spherical surface character control system based on tangent plane projection according to an embodiment of this application includes: a control input terminal, a spherical surface character control device as described in any one of the above claims, and a simulation rendering engine; the control input terminal is used to acquire user interaction commands and convert the interaction commands into raw control signals and send them to the spherical surface character control device; the simulation rendering engine is used to acquire the corrected position coordinates and rotation posture output by the spherical surface character control device, and accordingly perform synchronous rendering updates of the character screen in the virtual scene.

[0054] The above Figures 2-4 For an exemplary explanation, please refer to the above. Figure 1 The description will not be repeated here.

[0055] The above description is merely an exemplary embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A method for controlling the role of a sphere surface, characterized in that, include: The coordinate system dynamic correction module calculates the direction from the center of the sphere to the current position of the character in real time to determine the local ascent vector. Based on the local ascent vector, the rotation posture of the character is corrected so that the bottom of the character's feet always faces the center of the sphere. The local coordinate system of constraint vector projection and ray sampling is constructed using the local ascent vector. The vector projection module obtains the camera direction vector and performs orthogonal projection processing on the camera direction vector using the local coordinate system to generate a tangential movement vector parallel to the tangential plane of the ground surface, and uses the tangential movement vector to drive the character to perform displacement operations; In response to the displacement operation, the terrain adsorption module emits a probe ray based on the local upward vector direction determined by the local coordinate system to perform sampling processing on the surface grid, obtains the intersection point of the probe ray and the surface grid, determines the target height of the character based on the intersection point, and uses the target height to correct the position of the character so that the character is in real time attached to the surface grid during movement.

2. The sphere surface role control method according to claim 1, characterized in that, The coordinate system dynamic correction module specifically performs the following steps: Obtain the current 3D spatial coordinates representing the character's current position; Calculate the unit vector from the center of the sphere to the current three-dimensional spatial coordinates to determine the local ascending vector.

3. The sphere surface role control method according to claim 1, characterized in that, When correcting the character's rotational posture, the coordinate system dynamic correction module performs the following steps: The quaternion algorithm is used to perform calculations to determine the rotational offset between the character's orientation vector and the local ascending vector; The rotation offset is applied to the character's world rotation parameters based on the quaternion algorithm, and the character's rotation posture is updated using the world rotation parameters so that the orientation vector is aligned with the local ascending vector.

4. The method for controlling the role of a sphere surface according to claim 1, characterized in that, The vector projection module also performs the following steps: Obtain the control input vector; Extract the component vector of the camera in the world coordinate system, wherein the component vector includes at least a forward component and a right component; A linear synthesis is performed on the control input vector, the forward component, and the rightward component to generate the camera orientation vector.

5. The method for controlling the role of a sphere surface according to claim 1, characterized in that, When the vector projection module performs orthogonal projection processing on the camera direction vector, it specifically executes the following steps: Calculate the projection component vector of the camera orientation vector in the direction of the local ascending vector; The projection component vector is removed from the camera orientation vector to generate the tangential translation vector.

6. The method for controlling the role of a sphere surface according to claim 1, characterized in that, Before performing sampling processing, the terrain adsorption module performs the following steps: Based on the character's current position coordinates and the tangential movement vector, calculate the predicted displacement coordinates; Starting from the predicted displacement coordinates, displacement offset processing is performed along the positive direction of the local ascending vector to determine the sampling starting point position for sampling processing of the surface grid.

7. The spherical surface role control method according to claim 6, characterized in that, When the terrain adsorption module emits detection rays, it specifically performs the following steps: The probe ray is emitted from the sampling starting point in the opposite direction of the local ascending vector, and the probe ray is used to probe the surface grid.

8. The sphere surface role control method according to claim 7, characterized in that, When the terrain adsorption module determines the target height of the character based on the intersection point, it specifically performs the following steps: Determine the coordinates of the first intersection point between the probe ray and the surface grid; The height value is extracted from the coordinates of the first intersection point, and a preset height offset is used to calculate the height. The calculated result is then determined as the target height.

9. A three-dimensional virtual simulation system or online game system that applies the spherical surface character control method according to any one of claims 1-8.

10. A spherical surface role control device, characterized in that, It includes a processor and a memory, the memory being used to store a computer-executable program, and the processor being used to execute the computer-executable program to carry out the method according to any one of claims 1-8.