Method and apparatus for displaying position of virtual object with high stability
By acquiring the structure of virtual scene objects and establishing anomaly handling boundaries during the map drawing stage, monitoring and discarding abnormal data, and using path graph matching to display the location of virtual objects, the problem of unstable user location display in virtual scenes is solved, improving user experience and navigation efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-24
- Publication Date
- 2026-03-31
AI Technical Summary
In virtual environments, users cannot accurately know their location, leading to a poor user experience and the problem of getting lost.
During the map drawing phase, the object structure of the virtual scene is obtained and anomaly handling boundaries are established. Abnormal running data is monitored and discarded, and the relative positions of virtual objects are displayed using path graph matching.
It improves the stability and robustness of location display in virtual scenes, solves the problem of users getting lost, and enhances the interactive experience and navigation efficiency.
Smart Images

Figure CN121392178B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer vision technology, and in particular to a highly stable method and apparatus for displaying the position of virtual objects. Background Technology
[0002] With the development of computer technology, various forms of electronic devices have greatly enriched people's daily lives. For example, people can use electronic devices to perform various interactions in virtual scenes. Such virtual scenes can include, for example, game scenes, virtual simulation scenes, and virtual reality scenes.
[0003] However, in related technologies, due to the large size of the virtual scene, users often cannot know their location in the virtual scene. Summary of the Invention
[0004] In view of this, embodiments of this application provide a highly stable method and apparatus for displaying the location of virtual objects, in order to solve the problem in the prior art that the user's location cannot be displayed in a virtual scene.
[0005] A first aspect of this application provides a highly stable method for displaying the location of virtual objects. The method includes: during a map drawing phase, acquiring the object structure of a virtual scene and establishing an anomaly handling boundary; within the anomaly handling boundary, treating virtual objects in the virtual scene as general engine objects, acquiring coordinate data corresponding to the general engine objects based on the object structure, and drawing a path map based on the coordinate data; monitoring the running status of the data processing process within the anomaly handling boundary, and discarding the abnormal data corresponding to the running abnormality if a running abnormality is detected in any processing cycle; during the virtual scene running phase, acquiring the location information of virtual objects within the anomaly handling boundary, matching the location information with the path map to determine the relative position of the virtual objects in the path map, and displaying the relative position of the virtual objects in the path map.
[0006] A second aspect of this application provides a highly stable virtual object position display device. The device includes: a drawing module, configured to, during a map drawing phase, acquire the object structure of a virtual scene and establish an anomaly handling boundary; within the anomaly handling boundary, treat virtual objects in the virtual scene as general engine objects, acquire coordinate data corresponding to the general engine objects based on the object structure, and draw a path map based on the coordinate data; monitor the running status of the data processing process within the anomaly handling boundary, and if a running anomaly is detected in any processing cycle, discard the anomaly data corresponding to the running anomaly; and a display module, configured to, during the virtual scene running phase, acquire the position information of virtual objects within the anomaly handling boundary, match the position information with the path map to determine the relative position of the virtual objects in the path map, and display the relative position of the virtual objects in the path map.
[0007] A third aspect of this application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the above-described method.
[0008] A fourth aspect of this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the above-described method.
[0009] The beneficial effects of this application embodiment compared with the prior art are as follows: In the map drawing stage, the method in this application embodiment obtains the object structure of the virtual scene and establishes anomaly handling boundaries; within the anomaly handling boundaries, the virtual objects in the virtual scene are used as general engine objects, the coordinate data corresponding to the general engine objects are obtained based on the object structure, and a path map is drawn based on the coordinate data; the running status of the data processing process within the anomaly handling boundaries is monitored, and if a running anomaly is detected in any processing cycle, the abnormal data corresponding to the running anomaly is discarded; in the virtual scene running stage, the position information of the virtual objects is obtained within the anomaly handling boundaries, the position information is matched with the path map to determine the relative position of the virtual objects in the path map, and the relative position of the virtual objects in the path map is displayed. By establishing exception handling boundaries during map drawing and runtime, and mapping virtual objects to general engine objects for encapsulation, runtime exceptions during memory reading or drawing can be effectively intercepted and isolated. While discarding abnormal data, the main program's rendering loop is ensured to remain uninterrupted, thus solving the stability problem of virtual scene crashes or location display failures caused by external tool intervention in existing technologies. Based on this, the method combines path graph matching and real-time display mechanisms, which not only achieves highly robust location monitoring, but also intuitively solves the problem of users getting lost in large-scale virtual scenes due to the lack of built-in maps. This significantly improves the interactive experience and navigation efficiency, and avoids the problem of the inability to display the user's location in virtual scenes in existing technologies. Attached Figure Description
[0010] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0011] Figure 1 This is a flowchart illustrating a highly stable method for displaying the position of a virtual object, as provided in the application embodiment.
[0012] Figure 2This is a schematic diagram of the structure of a highly stable virtual object position display device provided in an embodiment of this application;
[0013] Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0014] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.
[0015] The following describes in detail, with reference to the accompanying drawings, a method and apparatus for displaying the position of a highly stable virtual object according to an embodiment of this application.
[0016] Figure 1 This is a flowchart illustrating a highly stable method for displaying the position of a virtual object, as provided in an embodiment of this application. Figure 1 As shown, the method includes:
[0017] S101. During the map drawing stage, obtain the object structure of the virtual scene and establish exception handling boundaries;
[0018] S102. Within the exception handling boundary, virtual objects in the virtual scene are treated as general engine objects. Based on the object structure, the coordinate data corresponding to the general engine object is obtained, and a path map is drawn based on the coordinate data.
[0019] S103. Monitor the running status of the data processing process within the exception handling boundary. If an operation exception is detected in any processing cycle, discard the exception data corresponding to the operation exception.
[0020] S104. During the virtual scene operation phase, obtain the position information of the virtual object within the exception handling boundary, match the position information with the path graph to determine the relative position of the virtual object in the path graph, and display the relative position of the virtual object in the path graph.
[0021] Taking virtual game scenarios as an example, in existing virtual game scenarios, the map size is usually large, and some games do not provide built-in maps within the scenario. Players often find it difficult to accurately determine their location and direction of movement when exploring or advancing tasks. In this situation, players need to rely on memory or temporary markers to identify paths, which not only results in a poor user experience but also easily leads to getting lost, re-exploring, or missing key areas, seriously affecting immersion and game efficiency.
[0022] To avoid the above problems, this application provides a highly stable method for displaying the position of virtual objects. This application first performs map drawing and reads the object structure of the virtual scene. The object structure includes at least: type information (such as the class name of the object, inheritance relationship or implemented interface), component hierarchy (such as root component, child components and their subordinate relationships), and field / property / method identifiers (such as the name and return type used to access pose information, such as GetActorLocation, transform.position, etc.).
[0023] This application does not limit the method of obtaining the object structure of the virtual scene. For example, by compiling Dumper-7 to generate the Dumper7.dll file, and using Cheat Engine to inject the dll file into the virtual scene process b1-Win64-Shipping.exe, after the Dumper7.dll is injected, it will search the virtual scene memory and search for the features of the UE engine. After matching, it will use the reflection system of the UE engine to store the object structure of the virtual scene to the hard disk in the form of C++ SDK, thus realizing the acquisition of the object structure of the virtual scene.
[0024] During the parsing of object structures, virtual objects in the virtual scene are treated as generic engine objects. These virtual objects are objects with a base class or interface that can be placed in the scene and contain transformation components (such as Transform or SceneComponent) for describing pose. Taking a virtual game scene as an example, the player character usually belongs to this type of generic engine object. Its structure naturally contains world coordinate information, which can be directly used by the system for subsequent position acquisition and path mapping.
[0025] In some examples, within the exception handling boundary, virtual objects in the virtual scene are treated as general engine objects. The coordinate data corresponding to the general engine object is obtained based on the object structure, and a path graph is drawn based on the coordinate data. The process of obtaining the coordinate data corresponding to the general engine object based on the object structure includes: determining the access path corresponding to the coordinate data of the general engine object based on the attribute information of the object structure; and obtaining the coordinate data from the general engine object based on the access path.
[0026] Specifically, during the map rendering phase, the system parses the object structure of the virtual scene and reads the attribute information of the object structure, including class name, inheritance relationship, and the components it contains. By analyzing this attribute information, the system can determine the fields or methods related to position or pose, thereby determining the access path corresponding to the general engine object.
[0027] For example, in Unreal Engine, if an object inherits from AActor, its object structure contains RootComponent, and world coordinates can be accessed through the RootComponent->GetComponentLocation() method; in Unity Engine, if the object is a GameObject, its object structure contains a Transform component, and the position vector can be obtained through the transform.position property.
[0028] During the virtual scene runtime phase, the system retrieves the coordinate data directly from the generic engine object according to the determined access path. For example, if the path is [RootComponent, Location], the RootComponent property is accessed sequentially and the Location field is read to obtain the coordinate data (x,y,z); if the path is [Transform, position], the position property of the Transform component is accessed to obtain the corresponding coordinate data.
[0029] The acquired coordinate data is timestamped and written to the trajectory cache for subsequent 2D trajectory drawing and path generation. Through the above steps, the system can flexibly parse the coordinate access path based on the object structure in different virtual scenes or engine environments, and stably read the world coordinates of general engine objects during runtime, thereby ensuring the feasibility and universality of the position display method.
[0030] The process of drawing a path map based on coordinate data includes: determining a target canvas based on multiple coordinate data points, and drawing each coordinate data point as a trajectory point into the target canvas to obtain a two-dimensional trajectory map; receiving drawing instructions for the two-dimensional trajectory map, and drawing the two-dimensional trajectory map according to the drawing instructions to obtain a path map.
[0031] Specifically, the system first calculates the minimum bounding rectangle of the coordinate points in the virtual scene based on the distribution range of multiple coordinate data, which serves as the world coordinate range corresponding to the path map. Then, based on this range, the size of the target canvas is set, for example, 1000×1000 pixels or a proportionally scaled vector canvas. Subsequently, the system maps each coordinate data (x, y) to the corresponding position (u, v) on the target canvas and draws a point or short line segment at that position, thus forming a two-dimensional trajectory map of point clouds or polylines.
[0032] After obtaining the 2D trajectory map, the system further receives drawing instructions for the trajectory map. These instructions can include operations such as smoothing the trajectory, deleting noise points, thickening the main path, splitting the path into different sections, and adding annotation symbols. The system processes the 2D trajectory map according to the instructions, for example, using a smoothing algorithm to transform the point cloud skeleton into a continuous curve, or allowing designers to manually edit and optimize the trajectory. Ultimately, the system obtains a clear and well-visualized path map.
[0033] In this way, the path map is not a rough trajectory directly pieced together from coordinate points, but rather goes through two stages: trajectory generation and drawing processing. This ensures both the authenticity of the data source and meets the requirements of readability and aesthetics, making it convenient for location matching and intuitive display during the runtime phase.
[0034] In some examples, this application also sets exception handling boundaries for each location acquisition and path graph drawing process during runtime, encapsulating the coordinate reading and path graph drawing processes within these boundaries. This way, if a runtime exception (such as illegal memory access, null reference, or arithmetic error) occurs during coordinate reading and path graph drawing, the system can immediately catch the exception. In a specific implementation, if the runtime environment is a Windows platform, a Structured Exception Handling (SEH) mechanism can be used to implement the above exception handling boundaries, ensuring that hardware and software exceptions are caught and handled in the same way. Furthermore, coordinate reading can be performed during the D3D Present Hook phase to avoid the risk of conflicts caused by multi-threaded concurrency.
[0035] When a runtime exception occurs during a coordinate reading and / or path graph drawing process, the system discards the exception data obtained in that execution and does not write the exception data to the trajectory cache, while maintaining the system's rendering loop uninterrupted. In this way, exception data will not affect subsequent path graph updates or display effects. Specifically, to ensure display continuity, after discarding exception data, the system retrieves historical position information cached from the previous processing cycle and uses this historical position information as the position information for the current cycle, thereby preventing screen flickering or pointer disappearance caused by single-frame data anomalies. Through this approach, this application ensures that even if a runtime exception occurs during individual executions, it will not cause the entire system to crash, improving the stability and robustness of the virtual object position display method.
[0036] In some examples, after the path diagram is drawn, this application will obtain the position information of the virtual object, match the position information with the path diagram to determine the relative position of the virtual object in the path diagram, and display the relative position of the virtual object in the path diagram. The matching of the position information with the path diagram to determine the relative position of the virtual object in the path diagram includes: converting the position information into relative position coordinates in the path diagram according to the scale to determine the relative position of the virtual object in the path diagram.
[0037] Specifically, the system first obtains the world coordinates (x, y) of the virtual object, and then combines this with the world coordinate range saved during the path graph drawing phase. ]、 [ The virtual object's position information is mapped to its relative position coordinates in the path graph using the following proportional conversion formula, along with the canvas display size (W, H):
[0038] ;
[0039] ;
[0040] in,( , () represents the relative position coordinates of the virtual object in the path graph.
[0041] In some examples, the relative position of a virtual object in a path graph is shown, including: displaying a pointer to indicate the virtual object at the relative position and determining the positional relationship between the relative position and a pre-set display window; and based on the positional relationship, reversing the path graph so that the pointer remains centered in the display window.
[0042] Specifically, the system presets pointer elements in the interface to indicate virtual objects. After obtaining the relative position coordinates (u, v) of the virtual object in the path map through scaling, the system draws the pointer at that position in the path map, thus visually marking the current position of the virtual object in the path map.
[0043] The system pre-sets a display window and calculates the difference vector between the relative position of the virtual object and the center of the display window.
[0044] ;
[0045] in, It is a difference vector. and These represent the width and height of the display window, respectively. This difference vector characterizes the degree and direction in which the virtual object deviates from the center of the display window.
[0046] The system performs a reverse displacement on the entire path graph based on the difference vector: when the virtual object is located at a certain position on the path graph, the path graph is translated in the opposite direction in the interface, so that the pointer of the virtual object remains centered in the display window.
[0047] In addition, in some examples, to avoid blank areas at the edges of the path graph, the system will also impose boundary constraints on the reverse displacement of the path graph. For example, when the path graph moves to the edge, it will stop translating and align the edge of the path graph with the boundary of the display window.
[0048] In this way, users will feel that the virtual object pointer is always in the center of the viewport, and the path map moves around the pointer. This not only ensures the intuitiveness of the location display, but also avoids the problem of positioning difficulties caused by an excessively large map.
[0049] For example, consider a virtual game scene. When a user plays a game within this virtual scene, the system acquires the 3D position information (X, Y, Z) of virtual objects (game characters) at a fixed frequency (e.g., 30 times / second) during the game's execution. If the game is divided into chapters, the system also acquires the chapter identifier to which the virtual object currently belongs. This position and chapter information are sent to the front-end display module (e.g., a web page) in real time.
[0050] The front-end display module selects the corresponding pre-generated path map based on the chapter identifier and determines the relative position of the virtual object on the path map by combining the location information. Since the in-game XY coordinate range corresponding to the path map is fixed, the system converts the XY coordinate values of the virtual object proportionally into relative position coordinates on the path map. Subsequently, a pointer element is drawn or moved at the relative position to indicate the current position of the virtual object.
[0051] In practice, if the front-end display module is a web page, the pointer element can be moved to the corresponding relative position using the CSS transform property.
[0052] To optimize user experience, after obtaining the relative position of the virtual object on the path graph, the system calculates the vector from the center point of the path graph to that position, and then performs a reverse displacement on the entire path graph based on this vector, thereby keeping the pointer centered in the display window. When the path graph is near the edge, the system applies boundary constraints to the reverse displacement, ensuring that the boundary of the display window always lies within the coordinate range of the path graph, avoiding blank displays.
[0053] During operation, whenever new location information is received, the system repeats the above-mentioned mapping, pointer update and path graph displacement calculation process to ensure that the position of virtual objects in the user interface can be updated smoothly and continuously, thereby achieving a real-time and intuitive position display effect in the virtual scene.
[0054] In some examples, to further improve rendering efficiency and user experience during runtime, this application introduces the following optimization measures in the front-end implementation:
[0055] First, Vue's computed properties mechanism is used to cache various displacement variables related to map display, including overall map offset, user zoom level, and user drag displacement. Since computed properties automatically track dependencies and recalculate when dependencies change, unnecessary calculations are avoided on every refresh, effectively reducing the amount of location calculation while ensuring the correctness of the results.
[0056] Secondly, for historical trajectory points with large datasets, this application employs a Canvas drawing method instead of DOM-based point-by-point rendering. Specifically, the system draws the complete set of trajectory points at once on a Canvas that is the same size as and aligned with the path graph, and only appends the incremental parts in subsequent updates. Compared to the traditional DOM-based point-by-point rendering method, this approach significantly reduces drawing overhead and improves rendering performance and smoothness.
[0057] Through the above optimization measures, this application can effectively reduce the computation and rendering overhead while ensuring the real-time display of virtual object positions, and ensure that the system still has a high response speed and smoothness when the data volume is large.
[0058] According to the technical solution provided in the embodiments of this application, in the map drawing stage, the object structure of the virtual scene is obtained and an anomaly handling boundary is established; within the anomaly handling boundary, the virtual objects in the virtual scene are used as general engine objects, the coordinate data corresponding to the general engine objects are obtained based on the object structure, and a path map is drawn based on the coordinate data; the running status of the data processing process within the anomaly handling boundary is monitored, and if a running anomaly is detected in any processing cycle, the abnormal data corresponding to the running anomaly is discarded; in the virtual scene running stage, the position information of the virtual objects is obtained within the anomaly handling boundary, the position information is matched with the path map to determine the relative position of the virtual objects in the path map, and the relative position of the virtual objects in the path map is displayed. By establishing exception handling boundaries during map drawing and runtime, and mapping virtual objects to general engine objects for encapsulation, runtime exceptions during memory reading or drawing can be effectively intercepted and isolated. While discarding abnormal data, the main program's rendering loop is ensured to remain uninterrupted, thus completely solving the stability problem of virtual scene crashes or location display failures caused by external tool intervention in existing technologies. On this basis, this method, combined with path graph matching and real-time display mechanisms, not only achieves highly robust location monitoring but also intuitively solves the problem of users getting lost in large-scale virtual scenes due to the lack of built-in maps, significantly improving the interactive experience and navigation efficiency, and avoiding the problem of the inability to display the user's location in virtual scenes in existing technologies.
[0059] All of the above-mentioned optional technical solutions can be combined in any way to form the optional embodiments of this application, and will not be described in detail here.
[0060] The following are embodiments of the apparatus described in this application, which can be used to execute the embodiments of the method described in this application. For details not disclosed in the apparatus embodiments of this application, please refer to the embodiments of the method described in this application.
[0061] This embodiment also provides a highly stable virtual object position display device, such as... Figure 2 As shown, the virtual object's location display device includes:
[0062] The drawing module 201 is used to obtain the object structure of the virtual scene and establish the anomaly handling boundary during the map drawing stage; within the anomaly handling boundary, the virtual objects in the virtual scene are used as general engine objects, the coordinate data corresponding to the general engine objects are obtained based on the object structure, and the path map is drawn according to the coordinate data; the running status of the data processing process within the anomaly handling boundary is monitored, and if a running anomaly is detected in any processing cycle, the abnormal data corresponding to the running anomaly is discarded.
[0063] The display module 202 is used to obtain the position information of virtual objects within the exception handling boundary during the virtual scene operation phase, match the position information with the path map to determine the relative position of the virtual objects in the path map, and display the relative position of the virtual objects in the path map.
[0064] In some examples, the coordinate data corresponding to the general engine object is obtained based on the object structure, including: determining the access path corresponding to the coordinate data of the general engine object based on the attribute information of the object structure; and obtaining the coordinate data from the general engine object according to the access path.
[0065] In some examples, drawing a path map based on coordinate data includes: determining a target canvas based on multiple coordinate data, and drawing each coordinate data as a trajectory point into the target canvas to obtain a two-dimensional trajectory map; receiving drawing instructions for the two-dimensional trajectory map, and drawing the two-dimensional trajectory map according to the drawing instructions to obtain a path map.
[0066] In some examples, location information is matched against a path map to determine the relative position of a virtual object within the path map, including: scaling the location information to relative position coordinates within the path map to determine the relative position of the virtual object within the path map.
[0067] In some examples, the relative position of a virtual object in a path graph is shown, including: displaying a pointer to indicate the virtual object at the relative position and determining the positional relationship between the relative position and a pre-set display window; and based on the positional relationship, reversing the path graph so that the pointer remains centered in the display window.
[0068] In some examples, after discarding the exception data corresponding to the runtime exception, the process also includes: obtaining the historical position information cached in the previous processing cycle; using the historical position information as the position information for the current cycle, and executing the display of the relative position of the virtual object in the path graph.
[0069] According to the technical solution provided in the embodiments of this application, in the map drawing stage, the object structure of the virtual scene is obtained and an anomaly handling boundary is established; within the anomaly handling boundary, the virtual objects in the virtual scene are used as general engine objects, the coordinate data corresponding to the general engine objects are obtained based on the object structure, and a path map is drawn based on the coordinate data; the running status of the data processing process within the anomaly handling boundary is monitored, and if a running anomaly is detected in any processing cycle, the abnormal data corresponding to the running anomaly is discarded; in the virtual scene running stage, the position information of the virtual objects is obtained within the anomaly handling boundary, the position information is matched with the path map to determine the relative position of the virtual objects in the path map, and the relative position of the virtual objects in the path map is displayed. By establishing exception handling boundaries during map drawing and runtime, and mapping virtual objects to general engine objects for encapsulation, runtime exceptions during memory reading or drawing can be effectively intercepted and isolated. While discarding abnormal data, the main program's rendering loop is ensured to remain uninterrupted, thus solving the stability problem of virtual scene crashes or location display failures caused by external tool intervention in existing technologies. Based on this, the method combines path graph matching and real-time display mechanisms, which not only achieves highly robust location monitoring, but also intuitively solves the problem of users getting lost in large-scale virtual scenes due to the lack of built-in maps. This significantly improves the interactive experience and navigation efficiency, and avoids the problem of the inability to display the user's location in virtual scenes in existing technologies.
[0070] Figure 3 This is a schematic diagram of the electronic device 3 provided in an embodiment of this application. Figure 3 As shown, the electronic device 3 of this embodiment includes: a processor 301, a memory 302, and a computer program 303 stored in the memory 302 and executable on the processor 301. When the processor 301 executes the computer program 303, it implements the steps in the various method embodiments described above. Alternatively, when the processor 301 executes the computer program 303, it implements the functions of each module / unit in the various device embodiments described above.
[0071] Electronic device 3 can be a desktop computer, laptop, handheld computer, cloud server, or other electronic device. Electronic device 3 may include, but is not limited to, processor 301 and memory 302. Those skilled in the art will understand that... Figure 3 This is merely an example of electronic device 3 and does not constitute a limitation on electronic device 3. It may include more or fewer components than shown, or different components.
[0072] The processor 301 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
[0073] The memory 302 can be an internal storage unit of the electronic device 3, such as a hard disk or memory of the electronic device 3. The memory 302 can also be an external storage device of the electronic device 3, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., equipped on the electronic device 3. The memory 302 can also include both internal and external storage units of the electronic device 3. The memory 302 is used to store computer programs and other programs and data required by the electronic device.
[0074] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0075] If an integrated module / unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program may include computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. A computer-readable medium may include: any entity or device capable of carrying computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content included in a computer-readable medium can be appropriately added to or subtracted according to the requirements of legislation and patent practice in a jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electrical carrier signals and telecommunication signals.
[0076] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.
Claims
1. A position display method of a virtual object with high stability, characterized by, The method comprises: In the mapping stage, the object structure of the virtual scene is acquired, and an exception handling boundary is established; In the exception handling boundary, a virtual object in the virtual scene is taken as a general engine object, the coordinate data corresponding to the general engine object is acquired based on the object structure, and a path graph is drawn according to the coordinate data; the virtual object is an object with a base class or an interface capable of being placed in a scene and containing a transformation component for describing a pose; the coordinate data corresponding to the general engine object is acquired based on the object structure, which comprises: determining an access path for accessing the coordinate data of the general engine object, and acquiring the coordinate data from the general engine object according to the access path; The running state of the data processing process in the exception handling boundary is monitored, and if a running exception is detected in any processing period, the exception data corresponding to the running exception is discarded; In the virtual scene running stage, the position information of the virtual object in the exception handling boundary is acquired, the position information is matched with the path graph to determine the relative position of the virtual object in the path graph, and the relative position of the virtual object in the path graph is displayed; The position information is matched with the path graph to determine the relative position of the virtual object in the path graph, which comprises: the position information is converted into relative position coordinates in the path graph in proportion to determine the relative position of the virtual object in the path graph.
2. The method of claim 1, wherein, The coordinate data corresponding to the general engine object is acquired based on the object structure, which comprises: Based on the attribute information of the object structure, the access path for accessing the coordinate data of the general engine object is determined.
3. The method of claim 1, wherein, The path graph is drawn according to the coordinate data, which comprises: A target canvas is determined according to a plurality of coordinate data, and each coordinate data is drawn into the target canvas as a track point to obtain a two-dimensional track graph; A drawing instruction for the two-dimensional track graph is received, and the two-dimensional track graph is drawn according to the drawing instruction to obtain the path graph.
4. The method of claim 1, wherein, The relative position of the virtual object in the path graph is displayed, which comprises: A pointer for indicating a virtual object is displayed at the relative position, and the position relationship between the relative position and a pre-set display window is determined; Based on the position relationship, the path graph is reversely displaced to keep the pointer centered in the display window.
5. The method of claim 1, wherein, After the exception data corresponding to the running exception is discarded, the method further comprises: Acquiring historical position information cached in the last processing period; The historical position information is used as the position information of the current period, and the relative position of the virtual object in the path graph is displayed.
6. A highly stable virtual object position display device, characterized in that, The device comprises: The drawing module is configured to, in a mapping stage, acquire an object structure of a virtual scene and establish an exception handling boundary; regard a virtual object in the virtual scene as a general engine object within the exception handling boundary, acquire coordinate data corresponding to the general engine object based on the object structure, and draw a path graph according to the coordinate data; the virtual object is an object having a base class or an interface that can be placed in a scene and containing a transformation component for describing a pose; acquiring the coordinate data corresponding to the general engine object based on the object structure includes determining an access path for accessing the coordinate data corresponding to the general engine object, and acquiring the coordinate data from the general engine object according to the access path; and monitoring a running state of a data processing process within the exception handling boundary, and discarding exception data corresponding to a running exception if the running exception is detected in any processing cycle. The display module is configured to, in a virtual scene running stage, acquire position information of a virtual object within the exception handling boundary, match the position information with the path graph to determine a relative position of the virtual object in the path graph, and display the relative position of the virtual object in the path graph; and matching the position information with the path graph to determine the relative position of the virtual object in the path graph includes proportionally converting the position information into relative position coordinates in the path graph to determine the relative position of the virtual object in the path graph.
7. The apparatus of claim 6, wherein, Acquiring the coordinate data corresponding to the general engine object based on the object structure includes determining an access path for accessing the coordinate data corresponding to the general engine object based on attribute information of the object structure, and acquiring the coordinate data from the general engine object according to the access path.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, The processor executes the computer program to implement the steps of the method according to any one of claims 1 to 5.
9. A computer-readable storage medium storing a computer program, the computer program comprising instructions that, when executed by a computer, cause the computer to perform the method of any one of claims 1 to 8. The computer program is executed by the processor to implement the steps of the method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Virtual path navigation method and system applied to virtual reality
CN114152260A
KR20220150020A