Method and device for processing position data in virtual space

By creating a virtual spherical space based on the spatial spherical coordinate system in the virtual space, using the position data mapping and angle adjustment of the visual center point, the problem of unintuitive processing of the target object position under single viewing is solved, and more efficient and accurate position display is achieved.

CN114053702BActive Publication Date: 2025-08-08BEIJING PERFECT WORLD SOFTWARE TECH DEV CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111425341.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-26
Publication Date
2025-08-08
Estimated Expiration
2041-11-26

AI Technical Summary

Technical Problem

The location processing of spatial scenes based on single-view observation in the existing virtual world is not intuitive enough and the operation is complicated, resulting in poor accuracy of position processing and affecting the observation effect.

Method used

The virtual spherical space is created based on the spatial spherical coordinate system, and the position of the target object in the virtual spherical space is adjusted through the position data mapping and angle data of the visual center point, so as to realize the intuitive display and operation of the target object.

Benefits of technology

It improves the location processing efficiency and accuracy of target objects in the virtual space, and enhances the observer's realistic visual experience and operation convenience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114053702B_ABST
    Figure CN114053702B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and device for processing position data in a virtual space. This method relates to the field of data processing technology and aims to address the problem of poor position processing accuracy in existing virtual world spatial scenes. The method primarily comprises: displaying a virtual spherical space containing a target object, the virtual spherical space being created based on a spatial spherical coordinate system; obtaining first position data for a position operation on the target object in the virtual world space; determining third position data of the first position data in the virtual spherical space based on second position data of the visual center point of the virtual spherical space; and displaying the target object at the location of the third position data. The method is primarily used for processing position data in a virtual space.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data processing, and in particular to a method and device for processing position data in a virtual space. Background Art

[0002] With the rapid development of virtual games, the spatial scenes in the virtual world are constantly changing with the game plot, and the demand for position processing of spatial scenes is also constantly increasing. In particular, for spatial scenes observed from a single viewpoint, such as observing various targets in the starry sky at night, it is necessary to fix the observation point and adjust the position of the observed target based on operations to meet the position processing requirements.

[0003] Currently, existing spatial scenes based on single-viewpoint observation typically construct the spatial position of the observed target using Cartesian coordinates. For example, the spatial position of the observed target is represented by (x, y, z) coordinate values, and the spatial position of the observed target is changed by changing the values in (x, y, z). However, because the observation point is fixed, changing the spatial position of the observed target by changing the values in (x, y, z) makes the spatial position change less intuitive and complex, reducing the accuracy of the position processing of the spatial scene in the virtual world, thereby affecting the observation effect between the observed target and the observer. Summary of the Invention

[0004] In view of this, the present invention provides a method and apparatus for processing position data in a virtual space, the main purpose of which is to solve the problem of poor accuracy in position processing of spatial scenes in existing virtual worlds.

[0005] According to one aspect of the present invention, a method for processing position data in a virtual space is provided, comprising:

[0006] Displaying a virtual spherical space with a target object, wherein the virtual spherical space is created based on a spatial spherical coordinate system;

[0007] Acquire first position data of a position operation performed on the target object in a virtual world space, and determine third position data of the first position data in the virtual spherical space based on second position data of a visual center point in the virtual spherical space;

[0008] The target object is displayed at the position point of the third position data.

[0009] Furthermore, before displaying the virtual spherical space with the target object, the method further includes:

[0010] Obtaining the radius of a sphere matching the visual center point and the target object;

[0011] A space spherical coordinate system is established in the virtual world space, and the virtual spherical space is determined in the space spherical coordinate system based on the spherical radius, and the target object is arranged in the virtual spherical space.

[0012] Furthermore, the visual center point is the coordinate origin of the spatial spherical coordinate system, and determining the third position data of the first position data in the virtual spherical space based on the second position data of the visual center point in the virtual spherical space includes:

[0013] emitting a ray from the coordinate origin to the position point of the first position data, and determining an intersection point of the ray and the virtual spherical space;

[0014] Angle data of the intersection point is determined by the coordinate origin and the ray, and third position data of the target object in the virtual spherical space is determined based on the angle data.

[0015] Furthermore, the angle data includes an azimuth angle and a pitch angle, and determining the angle data of the intersection point by using the coordinate origin and the ray, and determining the third position data of the target object in the virtual spherical space based on the angle data includes:

[0016] Determining the azimuth and elevation of the ray based on the coordinate origin, and determining the inverse of the azimuth and the elevation;

[0017] The opposite numbers of the azimuth angle and the pitch angle are respectively determined as the azimuth angle and the pitch angle of the target object in the virtual spherical space, wherein the third position data includes the azimuth angle and the pitch angle of the target object in the virtual spherical space.

[0018] Furthermore, configuring the target object in the spatial spherical coordinate system includes:

[0019] Acquiring spatial spherical configuration data of the target object;

[0020] The target object attribute characteristics and the target object scene characteristics in the spatial spherical configuration data are parsed, and the target object is configured in the spatial spherical coordinate system based on the target object attribute characteristics and the target object scene characteristics.

[0021] Furthermore, after displaying the virtual spherical space with the target object, the method further includes:

[0022] When a position operation on the target object is detected on the operation interface, fifth position data corresponding to the position operation in the screen space is converted into the virtual world space to obtain the first position data;

[0023] analyzing an operation speed parameter generated by performing a position operation on the target object;

[0024] Displaying the target object at the location of the third location data includes:

[0025] The target object is displayed at a position point of the third position data according to the operation speed parameter.

[0026] Furthermore, before displaying the virtual spherical space with the target object, the method further includes:

[0027] Disposing a virtual camera at a visual center point of the virtual spherical space to provide visual scene information of the virtual spherical space based on the virtual camera;

[0028] The display of the virtual spherical space with the target object includes:

[0029] Obtaining visual scene information corresponding to the virtual camera, wherein the visual scene information is used to represent visualization content corresponding to different virtual scenes based on visualization angles and visualization focus parameters of the virtual camera;

[0030] The output parameters of the virtual spherical space are adjusted based on the visual scene information, and the virtual spherical space with the target object is output based on the output parameters.

[0031] According to another aspect of the present invention, a device for processing position data in a virtual space is provided, comprising:

[0032] A first display module is used to display a virtual spherical space with a target object, wherein the virtual spherical space is created based on a spatial spherical coordinate system;

[0033] an acquisition module, configured to acquire first position data of a position operation performed on the target object in a virtual world space, and determine third position data of the first position data in the virtual spherical space based on second position data of a visual center point in the virtual spherical space;

[0034] The second display module is configured to display the target object at a location point of the third location data.

[0035] Furthermore, the device further comprises: an establishment module,

[0036] The acquisition module is further configured to acquire the radius of a sphere matching the visual center point and the target object;

[0037] The establishment module is used to establish a spatial spherical coordinate system in the virtual world space, determine the virtual spherical space in the spatial spherical coordinate system based on the spherical radius, and configure the target object in the virtual spherical space.

[0038] Furthermore, the visual center point is the coordinate origin of the spatial spherical coordinate system, and the acquisition module includes:

[0039] a mapping unit, configured to emit a ray from the coordinate origin to a position point of the first position data, and determine an intersection point of the ray and the virtual spherical space;

[0040] A determining unit is configured to determine angle data of the intersection point through a coordinate origin and the ray, and determine third position data of the target object in the virtual spherical space based on the angle data.

[0041] Furthermore, the angle data includes an azimuth angle and a pitch angle, and the determining unit includes:

[0042] a first determining subunit, configured to determine the azimuth and elevation of the ray based on the coordinate origin, and determine the inverses of the azimuth and elevation;

[0043] The second determining subunit is used to determine the opposite numbers of the azimuth angle and the pitch angle as the azimuth angle and the pitch angle of the target object in the virtual spherical space, respectively, wherein the third position data includes the azimuth angle and the pitch angle of the target object in the virtual spherical space.

[0044] Furthermore, the establishment module includes:

[0045] an acquisition unit, configured to acquire spatial spherical configuration data of the target object;

[0046] The configuration unit is configured to parse the target object attribute characteristics and the target object scene characteristics in the spatial spherical configuration data, and configure the target object in the spatial spherical coordinate system based on the target object attribute characteristics and the target object scene characteristics.

[0047] Furthermore, the device further comprises: a conversion module,

[0048] The conversion module is configured to, when a position operation on the target object is detected on the operation interface, convert fifth position data corresponding to the position operation in the screen space into the virtual world space to obtain the first position data;

[0049] The second display module is specifically configured to analyze an operation speed parameter generated by performing a position operation on the target object; and display the target object at the position of the third position data according to the operation speed parameter.

[0050] Furthermore, the device further includes: a configuration module,

[0051] The configuration module is configured to configure a virtual camera at a visual center point of the virtual spherical space, so as to provide visual scene information of the virtual spherical space based on the virtual camera;

[0052] The first display module is further configured to obtain visual scene information corresponding to the virtual camera, the visual scene information being used to represent visual content corresponding to different virtual scenes based on the visualization angle and visualization focus parameters of the virtual camera; adjust output parameters of the virtual spherical space based on the visual scene information, and output the virtual spherical space with the target object based on the output parameters.

[0053] According to another aspect of the present invention, a storage medium is provided, wherein the storage medium stores at least one executable instruction, wherein the executable instruction enables a processor to execute an operation corresponding to the method for processing position data in a virtual space as described above.

[0054] According to another aspect of the present invention, there is provided a terminal, comprising: a processor, a memory, a communication interface, and a communication bus, wherein the processor, the memory, and the communication interface communicate with each other via the communication bus;

[0055] The memory is used to store at least one executable instruction, and the executable instruction enables the processor to execute operations corresponding to the method for processing position data in the virtual space.

[0056] By means of the above technical solution, the technical solution provided by the embodiment of the present invention has at least the following advantages:

[0057] The present invention provides a method and device for processing position data in a virtual space. Compared with the prior art, an embodiment of the present invention displays a virtual spherical space with a target object, where the virtual spherical space is created based on a spatial spherical coordinate system; obtains first position data for performing a position operation on the target object in a virtual world space, and determines third position data of the first position data in the virtual spherical space based on second position data of a visual center point of the virtual spherical space; and displays the target object at the position point of the third position data, thereby achieving a more intuitive visualization effect of the spatial position, greatly reducing the display calculation cost of the target object, and thus improving the efficiency of processing the target object in the virtual space.

[0058] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are specifically listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0059] Various other advantages and benefits will become apparent to those skilled in the art upon reading the detailed description of the preferred embodiment below. The accompanying drawings are for illustration purposes only and are not to be considered as limiting the present invention. The same reference symbols are used throughout the drawings to represent the same components. In the drawings:

[0060] Figure 1 A flow chart of a method for processing position data in a virtual space provided by an embodiment of the present invention is shown;

[0061] Figure 2 A schematic diagram of virtual spherical space mapping provided by an embodiment of the present invention is shown;

[0062] Figure 3 A flow chart of another method for processing position data in a virtual space provided by an embodiment of the present invention is shown;

[0063] Figure 4 A flow chart of another method for processing position data in a virtual space provided by an embodiment of the present invention is shown;

[0064] Figure 5 A flow chart of a method for processing position data in a virtual space provided by another embodiment of the present invention is shown;

[0065] Figure 6 A schematic diagram of a camera viewing angle provided by an embodiment of the present invention is shown;

[0066] Figure 7 A flow chart of a method for processing position data in a virtual space provided by an embodiment of the present invention is shown;

[0067] Figure 8 A schematic diagram of a location data processing flow provided by an embodiment of the present invention is shown;

[0068] Figure 9 A block diagram showing the composition of a device for processing position data in a virtual space provided by an embodiment of the present invention is shown;

[0069] Figure 10 A schematic structural diagram of a terminal provided by an embodiment of the present invention is shown. DETAILED DESCRIPTION

[0070] Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. Rather, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.

[0071] In a spatial scene based on single-viewpoint observation, the spatial position of the observed target is usually constructed in Cartesian coordinates, such as by using (x, y, z) coordinate values to represent the spatial position of the observed target, and changing the values of each item in (x, y, z) to change the spatial position of the observed target. However, since the observation point is fixed, changing the spatial position of the observed target based on changing the values of each item in (x, y, z) will result in the spatial position change being less intuitive and complicated to operate, which reduces the accuracy of position processing of the spatial scene in the virtual world, thereby affecting the observation effect between the observed target and the observer. An embodiment of the present invention provides a method for processing position data in a virtual space, such as Figure 1 As shown, the method includes:

[0072] 101. Display a virtual spherical space with a target object.

[0073] In an embodiment of the present invention, the current execution entity can be any game engine, which constructs virtual world scenes suitable for different types of games, such as puzzle games and role-playing games, through the current game engine. This allows game content such as player characters, non-player characters, and scene objects to exist in the virtual world scenes, constructing different types of game stories. The virtual spherical space is created based on a spatial spherical coordinate system. The virtual spherical space and the virtual world space are jointly configured in the virtual world scene. The virtual world space is the virtual space of the entire world constructed in the game engine based on the Cartesian coordinate system. The virtual spherical space is created at the desired location in the virtual world space based on the spatial spherical coordinate system. In addition, the spatial spherical coordinate system is based on a preset coordinate origin as the sphere center and a virtual sphere with a spherical radius as the radius. The surface of the virtual sphere is configured with the target object expected to be observed by the observer. By calculating the azimuth and pitch angles at the coordinate origin, the position of the target object on the surface of the virtual sphere is determined, thereby achieving the creation of a virtual spherical space and displaying the virtual spherical space with each target object in the game interface.

[0074] It should be noted that the target object in the embodiment of the present invention is the object that the observer intends to observe, and may include but is not limited to virtual objects located in the sky of the virtual world, such as stars at night, and background virtual objects located in the virtual subspace of the virtual world, such as objects hidden in caves, etc., so that the observer located at a fixed coordinate origin can observe various virtual objects on the spherical surface more realistically.

[0075] 102. Acquire first position data of a position operation performed on the target object in the virtual world space, and determine third position data of the first position data in the virtual spherical space based on second position data of a visual center point in the virtual spherical space.

[0076] In an embodiment of the present invention, in order to make the observer be located at a fixed observation point in the virtual spherical space, such as when observing the target object on the spherical surface from the coordinate origin, the position of the target object can be always kept corresponding to the observer by operating the target object, and the first position data of the position operation performed by the observer on the target object in the virtual world space can be obtained, so as to determine the third position data of the first position data in the virtual spherical space by determining the second position data relative to the visual center point of the virtual spherical space. Among them, the first position data is the position content of the observer's trigger movement or expected position transformation operation on the target object, the second position data is the position content of the visual center relative to the virtual spherical space, preferably relative to the fixed coordinate origin of the virtual spherical space, and the third position data is the position content of the first position data mapped to the virtual spherical space based on the second position data, such as Figure 2 As shown, point O is the coordinate origin, point P is the operation point in the virtual world space, which is the first position data, and point Q is the mapping point (i.e., the intersection of the ray and the virtual spherical space) emitted from point O to point P to the virtual spherical space. Since the observer operates the screen (or the display interface on the screen) using a mouse or touch, the screen space position corresponding to the operation is converted into the virtual world space to obtain the first position data. Therefore, the first position data is Cartesian coordinate data in the virtual world space. Therefore, the first position data can be mapped and converted to position data in the virtual spherical space by using the coordinate origin as the corresponding second position data, so as to determine the expected position of the target object in the virtual spherical space in combination with a fixed spherical radius. Furthermore, in order to obtain a more accurate position of the target object in the virtual spherical space, the azimuth and pitch angles of the target object in the virtual spherical space can be determined based on the position corresponding to the coordinate origin and the first position data. The orientation of the target object is adjusted based on these two angles so that when the target object is displayed in the virtual spherical space, it is always facing the coordinate origin of the virtual spherical space, thereby enabling the observer to observe the target object directly.

[0077] It should be noted that the coordinate system of the virtual spherical space takes the center of the sphere as the origin, and the preset observation distance is used as the radius of the sphere to determine the sphere. The precise position of different target objects in the virtual spherical space is represented by angle data, so that the first position data determined by the observer in the virtual world space can be converted and mapped to the position in the virtual spherical space.

[0078] 103. Display the target object at the location point of the third location data.

[0079] In an embodiment of the present invention, in order to make the target object in the virtual spherical space consistent with the observer's viewing direction, thereby ensuring the observer's realistic visual experience in the game scene, the third position data is obtained by converting and mapping the first position data determined in the virtual world space, and the target object is displayed at the position point of the third position data, so that the observer can observe the target object head-on for operation processing, such as displaying the target object at the position point of the third position data in the virtual spherical space, so that the observer can drag the target object, so that the observer can ensure that the target object is always located in the virtual spherical space and in the positive direction of the observer when dragging the target object. Of course, the operation processing of the target object can also include the addition of scene special effects (such as adding twinkling special effects to stars), switching of visual scenes (such as zooming in on the visual display lens of the target object), etc., which are not specifically limited in the embodiment of the present invention.

[0080] It should be noted that, in one embodiment scenario, in order to ensure that the target object can always face the observer when the position operation is performed on the target object, the position is displayed according to the third position data when the position operation is performed on the target object in the virtual world space, that is, the visual effect of rotating the original visual angle of the visual center point to the angle of the third position data can be achieved, so that the target object is displayed at the position point of the third position data in the spherical coordinate system when moving, so that the target object faces the observation point, that is, the observer's visual direction faces the target object in the virtual spherical space.

[0081] In addition, in a scenario of an embodiment of the present invention, when a player observes multiple targets on a virtual spherical space based on a visual center point, one or more targets can be selected for position operations. At this time, when position operations are performed on the selected one or more targets, such as dragging, the positions of other unselected targets on the virtual spherical space remain unchanged, that is, the position operations on one or more targets are only based on the selection of the game player, and no position operations are performed on unselected targets. In an embodiment of the present invention, in order to make the position operation of the target object appear correlated and thus achieve a visual linkage effect, the linkage relationship between multiple target objects can be established so that when one target object is dragged, the positions of other target objects with a linkage relationship will also change. For example, the Big Dipper in the virtual night sky has a linkage relationship. When Tianshu is dragged, the positions of the other six stars in the Big Dipper will also change. The embodiment of the present invention does not make specific limitations. Specifically, after determining the third position data of the first target object targeted by the position operation performed by the game player in the virtual spherical space according to the method in the above embodiment, the updated position of the at least one second target object after the position operation is obtained based on the relative position relationship between the first target object and at least one second target object that is associated with the first target object before the position operation, and adjusting the orientation of each second target object to face the coordinate origin of the virtual sphere, and displaying the corresponding second target object at each updated position according to their respective orientations.

[0082] In one embodiment of the present invention, in order to further define and illustrate, Figure 3 As shown, before step 101, displaying the virtual spherical space with the target object, the method further includes: 201, obtaining a spherical radius matching the visual center point and the target object; 202, establishing a spatial spherical coordinate system in the virtual world space, and determining the virtual spherical space in the spatial spherical coordinate system based on the spherical radius, and configuring the target object in the virtual spherical space.

[0083] In order to ensure that the observer's line of sight is facing the target object when operating the target object, thereby improving the observer's operating experience and achieving a realistic spatial effect, a virtual spherical space is constructed. The visual center point is the fixed position where the observer observes the target object. In order to construct a hemispherical space with the visual center as the sphere center, a spherical radius matching the visual center point is obtained. This can be pre-configured based on the game scene requirements. For example, for a starry sky scene or a cave scene in the game, a spherical radius matching the visual center is pre-configured so that a spatial spherical coordinate system of a virtual spherical space with the visual center point as the sphere center is constructed according to this spherical radius. The embodiment of the present invention does not specifically limit the value of the spherical radius. At the same time, a target object expected to be configured in the virtual spherical space is obtained. At this time, the target object is an operation object in the original virtual world space, for example, a constellation in the original virtual world space, so that the target object is configured in the established spatial spherical coordinate system to obtain a virtual spherical space for output. In an embodiment of the present invention, the target object is stored in the current game engine in the form of model data, so that when constructing the virtual spherical space, the model data is configured in the virtual spherical space.

[0084] It should be noted that when the spatial spherical coordinate system of the virtual spherical space is made according to the spherical radius and the visual center point as the center of the sphere, since the virtual spherical space and the virtual world space coexist, a spatial spherical coordinate system is established in the virtual world space. The virtual world space is constructed based on Cartesian coordinates. In order to perform the conversion, the visual center point of the established spatial spherical coordinate system is used as the coordinate origin. The virtual spherical space is determined in the spatial spherical coordinate system based on the spherical radius. The precise position of different targets in the virtual spherical space is represented by angle data, that is, the orientation of the target in the virtual spherical space can be adjusted according to this angle data. The angle data includes azimuth and pitch angle. Correspondingly, the virtual spherical space is a hemisphere with a fixed radius. On this hemisphere, the expression of the spatial spherical coordinate system can be the angle data of the ray corresponding to the coordinate origin o to point a on this hemisphere, such as (Yaw_oa, Pitch_oa), which is the position data of point a mapped in the virtual spherical space.

[0085] In one embodiment of the present invention, in order to further define and illustrate, Figure 4 As shown, the visual center point is the coordinate origin of the spatial spherical coordinate system, and step 202 determines the third position data of the first position data in the virtual spherical space based on the second position data of the visual center point of the virtual spherical space, including: 301, emitting a ray from the coordinate origin to the position point of the first position data, and determining the intersection of the ray and the virtual spherical space; 302, determining the angle data of the intersection through the coordinate origin and the ray, and determining the third position data of the target object in the virtual spherical space based on the angle data.

[0086] Because the embodiment of the present invention uses the visual center point as the coordinate origin for constructing a spatial spherical coordinate system, after obtaining the first position data for performing a position operation on the target object, it is necessary to determine the third position data of the first position data in the virtual spherical space based on the second position data, i.e., the position of the visual center point. Specifically, a ray is emitted from the coordinate origin point to the position point of the first position data, and the ray is mapped to the virtual spherical space based on the direction of the ray, thereby obtaining a mapping point in the virtual spherical space as the third position data. At this time, the spatial spherical coordinate system based on the virtual spherical space represents the third position data. For example, the position point of the coordinate origin of the visual center point of the virtual spherical space is point A, and the position point of the first position data of the target object operation in the virtual world space is point B. Then a ray is emitted from A to B, and intersects in the virtual spherical space to determine the third position data, recorded as point C. The position of C is the target position where the target object is displayed. At this time, the azimuth and pitch angles of the ray AB are represented as (Yaw_AB, Pitch_AB). The third position data of the target object in the virtual spherical space is determined based on the angle data of the ray AB. At this time, the third position data is the position of point C, and the precise position of the target object in the virtual spherical space can be represented by (-Yaw_AB, -Pitch_AB), that is, the orientation of the target object in the virtual spherical space is adjusted, so that the first position data determined by the observer in the virtual world space can be converted and mapped to the position in the virtual spherical space, and the observer can observe the target object directly.

[0087] In one embodiment of the present invention, in order to further define and illustrate, Figure 5 As shown, the angle data includes azimuth and pitch angles. Step 302 determines the angle data of the intersection point through the coordinate origin and the ray, and determines the third position data of the target object in the virtual spherical space based on the angle data, including: 401, determining the azimuth and pitch angles of the ray based on the coordinate origin, and determining the opposite numbers of the azimuth and pitch angles; 402, determining the opposite numbers of the azimuth and pitch angles as the azimuth and pitch angles of the target object in the virtual spherical space, respectively.

[0088] In order to accurately determine the angle data of the mapping point determined by the coordinate origin and the ray, and thus determine the third position data of the target object in the virtual spherical space based on the angle data, the azimuth and pitch angle of the ray are determined based on the coordinate origin, such as Figure 6As shown, since the azimuth and pitch angles of the coordinate origin are mapped to the point where the third position data is located based on the coordinate origin, accordingly, after determining the opposite numbers of the azimuth and pitch angles, the opposite numbers of the azimuth and pitch angles are respectively determined as the azimuth and pitch angles of the target object in the virtual spherical space. For example, the expressions corresponding to the azimuth and azimuth of the ray AB emitted from the position point of the coordinate origin are (Yaw_AB, Pitch_AB). At this time, the front of the target object is perpendicular to the ray AB, that is, facing the position point A of the coordinate origin where the observer is located. Correspondingly, the expressions of the azimuth and pitch angles of the target object in the virtual spherical space after determining the opposite numbers are (-Yaw_AB, -Pitch_AB). Therefore, the orientation of the target object is adjusted by the azimuth and pitch angles of the target object in the virtual spherical space, and the third position data of the target object in the virtual spherical space is determined more accurately, so that the target object is displayed at the position point, so that the observer is facing the target object, achieving the observer's observation effect and gaming experience.

[0089] In one embodiment of the present invention, in order to further define and illustrate, Figure 7 As shown, step 202 configures the target object in the spatial spherical coordinate system, including: 501, obtaining the spatial spherical configuration data of the target object; 502, parsing the target object attribute characteristics and target object scene characteristics in the spatial spherical configuration data, and configuring the target object in the spatial spherical coordinate system based on the target object attribute characteristics and the target object scene characteristics.

[0090] To ensure a rich configuration of objects in the virtual spherical space, thereby achieving the diversity of the virtual spherical space and facilitating the realization of multi-scene presentation, when configuring objects, spatial spherical configuration data for the objects is obtained. This data is then used to align the objects with the spatial spherical coordinate system based on the object attribute characteristics and target scene characteristics analyzed from the spatial spherical configuration data. The spatial spherical configuration data is used to represent the visual effect data expected to be displayed when the objects are applied to different game scenes. Developers can pre-generate different spatial spherical configuration data for different game scenes. In this case, the spatial spherical configuration data includes, but is not limited to, object attribute characteristics, target scene characteristics, and may also include scene sound characteristics, scene special effects characteristics, and other features to facilitate the diversified presentation of the virtual spherical space. In addition, when configuring the target object, the target object attribute characteristics and target object scene characteristics in the spatial spherical configuration data are analyzed. The target object attribute characteristics are the attribute content of the target object's own content, including but not limited to the target object's color, target object size and other characteristics, so as to be displayed in the virtual spherical space. The target object scene characteristics are the characteristics displayed by the target object for a specific scene, including but not limited to the scene special effects and other content. For example, for the starry sky scene, the target object is a star, and the target scene characteristics can be configured as the star's flashing frequency, flashing color, etc. For the cave scene, the target object is an ancient monument, and the target scene characteristics can be configured as the transparency of the ancient monument, the ancient monument's luminous characteristics, etc. The embodiment of the present invention does not make specific limitations.

[0091] It should be noted that, since there can be multiple target objects in the embodiment of the present invention, the target objects are configured in the spatial spherical coordinate system in step 202. Specifically, all target objects to be positioned are pre-configured in a virtual spherical space for the observer to observe. When the observer needs to perform a position operation, the position of the selected target object is moved to the direction facing the observer.

[0092] In one embodiment of the present invention, for further limitation and explanation, after step 101 displays a virtual spherical space with a target object, the method further includes: when a position operation on the target object is detected in the operation interface, converting the fifth position data corresponding to the position operation in the screen space into the virtual world space to obtain the first position data.

[0093] Since the embodiment of the present invention is applicable to game users in different scenarios, when operating a game character as an observer, the operation can be based on click touch or click mouse. Therefore, it is necessary to first detect whether the game operator on the operation interface triggers the position operation, such as Figure 8As shown, the fifth position data generated by the position operation at the spatial position of the operation interface is transferred to the virtual world space, that is, obtained as the first position data, thereby improving the processing accuracy of the position data.

[0094] Correspondingly, in an embodiment of the present invention, the step of displaying the target object at the position point of the third position data includes: analyzing the operation speed parameters generated by performing position operation on the target object; and displaying the target object at the position point of the third position data according to the operation speed parameters.

[0095] In a specific implementation scenario, a game player's position manipulation of a target object can be obtained through an operation interface. Specifically, when a game player selects or drags a target object in a virtual spherical space at a spatial position corresponding to the operation interface, in order to ensure that the target object is always facing the player's perspective, the operation speed parameter generated by the position manipulation can be analyzed to display the target object at a position corresponding to third position data in the virtual spherical space based on the operation speed parameter, thereby achieving the position manipulation. The operation speed parameter is used to represent the speed at which the game player triggers the position movement in the operation interface, such as the speed at which the player clicks and moves the mouse. This serves as a speed reference value for displaying the target object at the position point of the third position data in the virtual spherical space. Whether to directly move the target object to the position corresponding to the third position data according to the operation speed parameter can be determined by directly configuring the movement speed as the operation speed parameter or configuring it according to a ratio of the operation speed parameter. This embodiment of the present invention does not specifically limit this, thereby demonstrating different speed efficiencies for displaying the target object at the position point of the third position data.

[0096] In one embodiment of the present invention, for further definition and explanation, before step 101 displays the virtual spherical space with the target object, the method further includes: configuring a virtual camera at the visual center point of the virtual spherical space to provide visual scene information of the virtual spherical space based on the virtual camera.

[0097] In order to make the observer's visual direction match the viewing angle of the game character, the virtual camera in the game engine is configured at the visual center point, so that when the game engine is making the game, it can produce the viewing angle of the game character based on the shooting angle of the virtual camera, such as Figure 6 As shown, the visualization effect of game users' operations is greatly improved.

[0098] Correspondingly, in an embodiment of the present invention, the step of displaying a virtual spherical space with a target object includes: obtaining visual scene information corresponding to the virtual camera; adjusting output parameters of the virtual spherical space based on the visual scene information, and outputting the virtual spherical space with the target object based on the output parameters.

[0099] In a specific implementation scenario, since the shooting angle of the virtual camera is the observation angle of the game player, after configuring the virtual camera at the visual center point, the displayed virtual spherical space can specifically obtain the visual scene information corresponding to the virtual camera, adjust the output parameters of the virtual spherical space based on the visual scene information, and display the virtual spherical space with the target object based on the output parameters. Specifically, since the virtual camera can display a game scene to the game player, the visual scene information output by the camera as the game scene is used to represent the visual content corresponding to different virtual scenes based on the visualization angle and visualization focus parameters of the virtual camera. The visualization angle is used to represent the angle at which the virtual camera displays the virtual scene, and the visualization focus parameters are used to represent the focus of the virtual camera displaying the virtual scene. Furthermore, the observable content specifically displayed to the game player through the visual scene information includes but is not limited to scene object model data, player character model data, etc., which is not specifically limited in the embodiments of the present invention. Furthermore, since the game scene is pre-set in the game engine, visual scene information matching the game scene can be obtained. In this case, the visual scene information represents the entire scene content observable by the game player. Therefore, the output parameters of the virtual spherical space are adjusted based on the visual scene information. The output parameters include, but are not limited to, the output distance ratio, output color value, output transparency, and other content representing the output parameters of the virtual spherical space, thereby enhancing the player's visualization experience. For example, in a starry sky scene, the visual scene information represents the scene content of the entire hemisphere observable by the player. In this case, the corresponding adjusted output parameters may include an output distance ratio matching the virtual world scene, and a night sky scene with a black color value. In a cave scene, since caves are suitable for both dark and illuminated environments, the visual scene information represents the scene content of the target objects observable by the player with light. In this case, the corresponding adjusted output parameters may include a black color value for the area visible except for the torch range, or a transparent or preset focal length display of the ancient monuments, while the entire cave wall is displayed with a preset non-transparent or blurred character display effect for other ancient monuments. This is not specifically limited in this embodiment of the present invention.

[0100] An embodiment of the present invention provides a method for processing position data in a virtual space. Compared with the prior art, the embodiment of the present invention displays a virtual spherical space with a target object, where the virtual spherical space is created based on a spatial spherical coordinate system; obtains first position data for performing a position operation on the target object in the virtual world space, and determines third position data of the first position data in the virtual spherical space based on second position data of a visual center point of the virtual spherical space; and displays the target object at the position point of the third position data, thereby achieving a more intuitive visualization effect of the spatial position, greatly reducing the calculation cost of operating the position data, and thus improving the efficiency of position processing in the virtual space.

[0101] Furthermore, as a response to the above Figure 1 The embodiment of the present invention provides a device for processing position data in a virtual space, such as Figure 9 As shown, the device includes:

[0102] A first display module 61 is used to display a virtual spherical space with a target object, where the virtual spherical space is created based on a spatial spherical coordinate system;

[0103] an acquisition module 62 for acquiring first position data of a position operation performed on the target object in the virtual world space, and determining third position data of the first position data in the virtual spherical space based on second position data of a visual center point in the virtual spherical space;

[0104] The second display module 63 is configured to display the target object at the location of the third location data.

[0105] Furthermore, the device further comprises: an establishment module,

[0106] The acquisition module is further used to acquire the spherical radius matching the visual center point and the target object to be positionally operated;

[0107] The establishment module is used to establish a space spherical coordinate system in the virtual world space based on the spherical radius, and configure the target object in the space spherical coordinate system to obtain a virtual spherical space.

[0108] Furthermore, the visual center point is the coordinate origin of the spatial spherical coordinate system, and the acquisition module includes:

[0109] a mapping unit, configured to emit a ray from the coordinate origin to a position point of the first position data, and determine an intersection point of the ray and the virtual spherical space;

[0110] A determining unit is configured to determine angle data of the intersection point through a coordinate origin and the ray, and determine third position data of the target object in the virtual spherical space based on the angle data.

[0111] Furthermore, the angle data includes an azimuth angle and a pitch angle, and the determining unit includes:

[0112] a first determining subunit, configured to determine the azimuth and elevation of the ray based on the coordinate origin, and determine the inverses of the azimuth and elevation;

[0113] The second determining subunit is used to determine the opposite numbers of the azimuth angle and the pitch angle as the azimuth angle and the pitch angle of the target object in the virtual spherical space, respectively, wherein the third position data includes the azimuth angle and the pitch angle of the target object in the virtual spherical space.

[0114] Furthermore, the establishment module includes:

[0115] an acquisition unit, configured to acquire spatial spherical configuration data of the target object;

[0116] The configuration unit is configured to parse the target object attribute characteristics and the target object scene characteristics in the spatial spherical configuration data, and configure the target object in the spatial spherical coordinate system based on the target object attribute characteristics and the target object scene characteristics.

[0117] Furthermore, the device further comprises: a conversion module,

[0118] The conversion module is configured to, when a position operation on the target object is detected on the operation interface, convert fifth position information generated by the position operation into the virtual world space based on the spatial position of the operation interface to obtain first position data;

[0119] The second display module is specifically used to analyze the operation speed parameters generated by the position operation on the third position data when the operation interface receives the position operation of the target object in the virtual spherical space; and move the target object in the virtual spherical space to the position point corresponding to the third position data based on the operation speed parameters.

[0120] Furthermore, the device further includes: a configuration module,

[0121] The configuration module is configured to configure a virtual camera at a visual center point of the virtual spherical space, so as to provide visual scene information of the virtual spherical space based on the virtual camera;

[0122] The first display module is further configured to obtain visual scene information corresponding to the virtual camera, the visual scene information being used to represent visual content corresponding to different virtual scenes based on the visualization angle and visualization focus parameters of the virtual camera; adjust output parameters of the virtual spherical space based on the visual scene information, and output the virtual spherical space with the target object based on the output parameters.

[0123] An embodiment of the present invention provides a device for processing position data in a virtual space. Compared with the prior art, the embodiment of the present invention displays a virtual spherical space with a target object, where the virtual spherical space is created based on a spatial spherical coordinate system; obtains first position data for performing a position operation on the target object in the virtual world space, and determines third position data of the first position data in the virtual spherical space based on second position data of a visual center point of the virtual spherical space; and displays the target object at the position point of the third position data, thereby achieving a more intuitive visualization effect of the spatial position, greatly shortening the calculation cost of operating the position data, and thus improving the efficiency of position processing in the virtual space.

[0124] According to one embodiment of the present invention, a storage medium is provided, wherein the storage medium stores at least one executable instruction. The computer-executable instruction can execute the method for processing position data in a virtual space in any of the above method embodiments.

[0125] Figure 10 A schematic structural diagram of a terminal provided according to an embodiment of the present invention is shown. The specific embodiment of the present invention does not limit the specific implementation of the terminal.

[0126] like Figure 10 As shown, the terminal may include: a processor (processor) 702 , a communication interface (Communications Interface) 704 , a memory (memory) 706 , and a communication bus 708 .

[0127] The processor 702 , the communication interface 704 , and the memory 706 communicate with each other via a communication bus 708 .

[0128] The communication interface 704 is used to communicate with other devices such as clients or other servers.

[0129] The processor 702 is configured to execute the program 710 , and specifically to execute the relevant steps in the embodiment of the method for processing position data in the virtual space.

[0130] Specifically, the program 710 may include program codes, which include computer operation instructions.

[0131] Processor 702 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement embodiments of the present invention. The one or more processors included in the terminal may be processors of the same type, such as one or more CPUs, or processors of different types, such as one or more CPUs and one or more ASICs.

[0132] The memory 706 is used to store the program 710. The memory 706 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.

[0133] The program 710 may be specifically configured to cause the processor 702 to perform the following operations:

[0134] Displaying a virtual spherical space with a target object, wherein the virtual spherical space is created based on a spatial spherical coordinate system;

[0135] Acquire first position data of a position operation performed on the target object in a virtual world space, and determine third position data of the first position data in the virtual spherical space based on second position data of a visual center point in the virtual spherical space;

[0136] The target object is displayed at the position point of the third position data.

[0137] Obviously, those skilled in the art will appreciate that the various modules or steps of the present invention described above can be implemented using a general-purpose computing device, centralized on a single computing device, or distributed across a network of multiple computing devices. Alternatively, they can be implemented using program code executable by a computing device, which can then be stored in a storage device and executed by the computing device. In some cases, the steps shown or described can be performed in a different order than that shown, or can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, the present invention is not limited to any particular combination of hardware and software.

[0138] The foregoing description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Those skilled in the art will readily appreciate that various modifications and variations of the present invention are possible. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present invention shall be included within the scope of protection of the present invention.

Claims

1. A method for processing position data in a virtual space, characterized in that: include: Displaying a virtual spherical space with a target object, wherein the virtual spherical space is created based on a spatial spherical coordinate system; Acquire first position data of a position operation performed on the target object in a virtual world space, and determine third position data of the first position data in the virtual spherical space based on second position data of a visual center point in the virtual spherical space; displaying the target object at the location point of the third location data; Before displaying the virtual spherical space with the target object, the method further includes: Obtaining the radius of a sphere matching the visual center point and the target object; A space spherical coordinate system is established in the virtual world space, and the virtual spherical space is determined in the space spherical coordinate system based on the spherical radius, and the target object is arranged in the virtual spherical space.

2. The method according to claim 1, characterized in that The visual center point is the coordinate origin of the spatial spherical coordinate system, and determining the third position data of the first position data in the virtual spherical space based on the second position data of the visual center point in the virtual spherical space includes: emitting a ray from the coordinate origin to the position point of the first position data, and determining an intersection point of the ray and the virtual spherical space; Angle data of the intersection point is determined by the coordinate origin and the ray, and third position data of the target object in the virtual spherical space is determined based on the angle data.

3. The method according to claim 2, characterized in that The angle data includes an azimuth angle and a pitch angle, and the angle data of the intersection point is determined by using the coordinate origin and the ray, and the third position data of the target object in the virtual spherical space is determined based on the angle data. The method includes: Determining the azimuth and elevation of the ray based on the coordinate origin, and determining the inverse of the azimuth and the elevation; The opposite numbers of the azimuth angle and the pitch angle are respectively determined as the azimuth angle and the pitch angle of the target object in the virtual spherical space, wherein the third position data includes the azimuth angle and the pitch angle of the target object in the virtual spherical space.

4. The method according to claim 1, wherein The configuring the target object in the virtual spherical space includes: Acquiring spatial spherical configuration data of the target object; The target object attribute characteristics and the target object scene characteristics in the spatial spherical configuration data are parsed, and the target object is configured in the spatial spherical coordinate system based on the target object attribute characteristics and the target object scene characteristics.

5. The method according to claim 1, wherein After displaying the virtual spherical space with the target object, the method further includes: When a position operation on the target object is detected on the operation interface, fifth position data corresponding to the position operation in the screen space is converted into the virtual world space to obtain the first position data; analyzing an operation speed parameter generated by performing a position operation on the target object; Displaying the target object at the location of the third location data includes: The target object is displayed at a position point of the third position data according to the operation speed parameter.

6. The method according to any one of claims 1 to 5, characterized in that Before displaying the virtual spherical space with the target object, the method further includes: Disposing a virtual camera at a visual center point of the virtual spherical space to provide visual scene information of the virtual spherical space based on the virtual camera; The display of the virtual spherical space with the target object includes: Obtaining visual scene information corresponding to the virtual camera, wherein the visual scene information is used to represent visualization content corresponding to different virtual scenes based on visualization angles and visualization focus parameters of the virtual camera; The output parameters of the virtual spherical space are adjusted based on the visual scene information, and the virtual spherical space with the target object is output based on the output parameters.

7. A device for processing position data in a virtual space, characterized in that: include: A first display module is used to display a virtual spherical space with a target object, wherein the virtual spherical space is created based on a spatial spherical coordinate system; an acquisition module, configured to acquire first position data of a position operation performed on the target object in a virtual world space, and determine third position data of the first position data in the virtual spherical space based on second position data of a visual center point in the virtual spherical space; a second display module, configured to display the target object at a location point of the third location data; The device further comprises: an establishment module, The acquisition module is further configured to acquire the radius of a sphere matching the visual center point and the target object; The establishment module is used to establish a spatial spherical coordinate system in the virtual world space, determine the virtual spherical space in the spatial spherical coordinate system based on the spherical radius, and configure the target object in the virtual spherical space.

8. A storage medium storing at least one executable instruction, wherein the executable instruction enables a processor to execute an operation corresponding to the method for processing position data in a virtual space according to any one of claims 1 to 6.

9. A terminal comprising: A processor, a memory, a communication interface, and a communication bus, wherein the processor, the memory, and the communication interface communicate with each other via the communication bus; The memory is used to store at least one executable instruction, and the executable instruction enables the processor to execute an operation corresponding to the method for processing position data in a virtual space according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Game picture processing method and device, computer equipment and storage medium

    CN113546407A