XR offline large-space virtual scene dynamic adaptation and rapid deployment method, equipment and medium

By extracting dynamic virtual fence feature points, generating grid three-dimensional models, establishing virtual anchor points and building user relative coordinate systems, the difficulties in deployment and user security of large space XR products are solved, and rapid deployment and efficient adaptation of virtual scenes are achieved.

CN120045065APending Publication Date: 2025-05-27SUZHOU HUACHUANG ZHICHENG TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510108720.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-23
Publication Date
2025-05-27

AI Technical Summary

Technical Problem

The lack of virtual scene deployment tools and methods in the prior art that efficiently adapts to different physical sites has led to difficulties and inefficiency in deployment and user security of large space XR products.

Method used

By extracting the feature points of the dynamic virtual fence, a grid three-dimensional model is generated for collision detection, a virtual anchor point is established to mark key positions, and a user's relative coordinate system is constructed to guide the user to move, realizing dynamic adaptation and rapid deployment of virtual scenes.

Benefits of technology

It realizes the rapid deployment of large-space XR virtual scenarios and user security guarantees, simplifies the operation process, and improves the deployment efficiency and immersiveness of user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120045065A_ABST
    Figure CN120045065A_ABST
Patent Text Reader

Abstract

The invention discloses an XR offline large-space virtual scene dynamic adaptation and rapid deployment method, device and medium for solving the problems of difficult deployment, difficult adaptation and user safety in the prior art, and belongs to the technical field of augmented reality, and the method comprises the steps: extracting feature points of a dynamic virtual fence; a grid three-dimensional model of a dynamic virtual fence is generated based on the feature points and used for collision detection and avoiding collision between a user and a real obstacle, and virtual anchor points are established and used for marking key positions, including a story point and a scene original point, in a virtual scene; constructing a relative coordinate system of the user, adjusting the relative coordinate system of the user to be aligned with the virtual anchor point, and guiding the user to move in the real space; by adjusting the position of the virtual anchor point, switching of the virtual scene where the user is located is achieved. According to the method, the deployment efficiency of the large-space XR virtual scene is greatly improved, dynamic expansion of multiple scenes and multiple stories is supported, and the immersion and flexibility of XR experience are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of extended reality technology, and in particular to a method, device and medium for dynamic adaptation and rapid deployment of an XR offline large-space virtual scene. Background Art

[0002] With the rapid development of extended reality (XR) technology (including virtual reality (VR), augmented reality (AR), and mixed reality (MR), large-space XR applications have gradually become an important technical direction. These applications require multiple virtual scenes to be dynamically superimposed on the real environment to provide an immersive user experience. However, in actual site deployment, there are the following problems:

[0003] Difficult deployment: Since the physical environment of the real site (such as walls, obstacles, etc.) cannot be automatically matched with the virtual scene, a lot of manual adjustments are often required.

[0004] User safety issues: When users act in a virtual scene, they are prone to collisions or dangers due to ignoring the real environment.

[0005] Difficulty in adaptation: Different virtual scenes need to be superimposed in different blocks of the real space, which cannot be matched automatically. It often requires a lot of manual adjustments and repeated packaging of virtual scene programs, which is inefficient.

[0006] In the existing technology, there is a lack of virtual scene deployment tools and methods that can efficiently adapt to different physical venues. Especially in large-space XR products, how to combine virtual scenes with real-world environments to ensure user safety is still a technical difficulty. Summary of the invention

[0007] In view of the deficiencies in the prior art, the present invention provides a method, device and medium for dynamic adaptation and rapid deployment of XR offline large-space virtual scenes, which can quickly deploy virtual scenes in different real venues without the need for specific adaptation of different real venues. Different real environments can be adapted through visual configuration, thereby ensuring the user's immersive experience and safety.

[0008] To achieve the above object, the present invention adopts the following technical solutions:

[0009] A method for dynamic adaptation and rapid deployment of an XR offline large-space virtual scene, comprising the following steps:

[0010] Extract feature points of dynamic virtual fence;

[0011] Generate a dynamic virtual fence mesh 3D model based on feature points for collision detection to prevent users from colliding with real obstacles.

[0012] Establishing virtual anchor points for marking key positions in the virtual scene, wherein the key positions include story points and scene origins;

[0013] Construct the user's relative coordinate system, adjust the user's relative coordinate system to align it with the virtual anchor point, and guide the user to move in the real space;

[0014] By adjusting the position of the virtual anchor point, the user's virtual scene can be switched.

[0015] To optimize the above technical solutions, the specific measures taken also include:

[0016] Furthermore, the feature points of the dynamic virtual fence are specifically extracted as follows:

[0017] Enter the virtual scene through the XR headset and handle, enter the editing mode, use the handle to emit rays, and mark the feature points of walls or obstacles in the real environment, including edges and corners. The feature point data is stored in the form of three-dimensional coordinates.

[0018] Furthermore, the three-dimensional grid model of the dynamic virtual fence generated based on the feature points is specifically:

[0019] Arrange the marked feature points in order. If there are errors in the feature points marked by the user, reduce the noise of the feature point data through K-means clustering or spatial smoothing;

[0020] Check whether the feature points form a closed area. If not, generate additional points through interpolation algorithm to complete the closure.

[0021] Build a triangle index buffer based on the feature points to define the vertices of each triangle;

[0022] Construct a vertex buffer to store the three-dimensional coordinates of each vertex;

[0023] Project feature points onto a 2D plane to generate UV coordinates;

[0024] Calculate the normal and tangent of each triangle;

[0025] Assembles triangle indices, vertices, UV coordinates, normals and tangents into a dynamic virtual fence.

[0026] Furthermore, the establishment of the virtual anchor point is specifically as follows:

[0027] The data structure of the virtual anchor point contains the following information: the unique identifier ID of the virtual anchor point, the position Position of the virtual anchor point in the world coordinate system, the orientation Rotation of the virtual anchor point, the scale ratio Scale of the virtual anchor point, and the scene SceneID associated with the current virtual anchor point; the orientation of the virtual anchor point is used to determine the user's perspective and direction, and the scale ratio of the virtual anchor point is used to adapt to venues of different sizes;

[0028] In edit mode, you can manually place virtual anchor points through tools, or use algorithms to automatically generate virtual anchor points. The virtual anchor points are saved in the background in the form of JSON configuration files.

[0029] Dynamically adjust the position of the virtual anchor point based on the user's current position.

[0030] Further, the adjusting the relative coordinate system of the user to align it with the virtual anchor point specifically includes: translating the relative coordinate system and adjusting the rotation angle of the relative coordinate system; specifically:

[0031] The local position of the user's XR headset relative to the relative coordinate system XROrigin is defined as CurrentCameraPosition.

[0032] The local rotation of the user's XR headset relative to the relative coordinate system XROrigin is defined as CurrentCameraRotation. The world coordinates of the user's XR headset are calculated as follows:

[0033] WorldCameraPosition=TargetAnchorPosition+(TargetAnchorRotation·CurrentCameraPosition);

[0034] Where WorldCameraPosition represents the world coordinates of the user's XR headset, TargetAnchorPosition represents the position of the target virtual anchor point, and TargetAnchorRotation represents the rotation of the target virtual anchor point, which is applied to CurrentCameraPosition as a rotation matrix;

[0035] Calculate the world rotation of the user's XR headset using the following formula:

[0036] WorldCameraRotation=TargetAnchorRotation·CurrentCameraRotation;

[0037] Where WorldCameraRotation represents the world rotation of the user's XR headset, and TargetAnchorRotation represents the rotation of the target virtual anchor point;

[0038] Updates the world coordinates and world rotation of the user's XR headset.

[0039] Furthermore, the specific process of switching the virtual scene where the user is located by adjusting the position of the virtual anchor point is as follows:

[0040] The user triggers the conditions for switching the virtual scene; the conditions for switching the virtual scene include: the user reaches the end point of the current virtual scene and the user triggers an interaction event;

[0041] Record the position and orientation of the current virtual anchor point;

[0042] Load the virtual anchor point of the next scene and adjust the position of the virtual anchor point;

[0043] Use animation or gradient effects to achieve visual transitions of virtual scenes; reposition the user to the virtual anchor point of the new virtual scene and refresh the resources of the scene.

[0044] Furthermore, the construction of a triangle index buffer based on feature points is specifically as follows:

[0045] Use feature points to construct a two-dimensional polygon, and use a triangulation algorithm to decompose the polygon into multiple triangles;

[0046] Each triangle consists of the indices of 3 points. The index data is stored in an array and is used to define the vertices of each triangle.

[0047] The projecting of feature points onto a 2D plane to generate UV coordinates is specifically as follows:

[0048] The height range of the wall is [Ymin, Ymax], where Ymin is the lower limit of the height and Ymax is the upper limit of the height. The width range is [Xmin, Xmax], where Xmin is the lower limit of the width and Xmax is the upper limit of the width. The UV coordinates of the feature points are generated by the following formula:

[0049] U=(X-Xmin) / (Xmax-Xmin)

[0050] V=(Y-Ymin) / (Ymax-Ymin)

[0051] Where U is the U-axis coordinate of the feature point in the UV coordinate system, V is the V-axis coordinate of the feature point in the UV coordinate system, X is the X-axis coordinate of the feature point in the three-dimensional coordinate system, and Y is the Y-axis coordinate of the feature point in the three-dimensional coordinate system.

[0052] Furthermore, the calculation of the normal and tangent of each triangle is specifically as follows:

[0053] The normal is calculated by the cross product, as follows:

[0054] Normal=normalize(cross(P2-P1,P0-P1))

[0055] In the formula, Normal represents the normal line, normalize(·) represents vector normalization, and cross(·) represents the cross product of the vector; P0 is the first vertex of the triangle, P1 is the second vertex of the triangle, and P2 is the third vertex of the triangle;

[0056] The tangent line is perpendicular to the normal line and is along the U axis of the UV coordinate system.

[0057] The present invention also proposes an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the method for dynamic adaptation and rapid deployment of XR offline large-space virtual scenes as described above is implemented.

[0058] The present invention also proposes a computer-readable storage medium storing a computer program, wherein the computer program enables a computer to execute the above-mentioned XR offline large-space virtual scene dynamic adaptation and rapid deployment method.

[0059] The beneficial effects of the present invention are:

[0060] (1) Rapid deployment: Greatly improves the deployment efficiency of large-space XR virtual scenes.

[0061] (2) Enhanced security: The automatic generation of safety boundaries effectively prevents user collisions and ensures user safety.

[0062] (3) Separation of real space: Flexible adaptation and dynamic separation of virtual scenes and real venues are achieved.

[0063] (4) Simplified operation: User-friendly deployment tools simplify the operation process and reduce the difficulty of deployment.

[0064] (5) Strong scalability: Supports dynamic expansion of multiple scenes and multiple stories, improving the immersion and flexibility of the XR experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0065] Figure 1 This is a flow chart of the XR offline large-space virtual scene dynamic adaptation and rapid deployment method proposed by the present invention;

[0066] Figure 2 A flow chart for generating a mesh three-dimensional model of a dynamic virtual fence;

[0067] Figure 3 Schematic diagram of virtual anchor point and scene switching. DETAILED DESCRIPTION

[0068] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0069] Embodiment 1

[0070] The present invention proposes a method for dynamic adaptation and rapid deployment of XR offline large-space virtual scenes. The overall process of the method is as follows: Figure 1 As shown, the following steps are included:

[0071] Extract the feature points of the dynamic virtual fence; specifically:

[0072] Enter the virtual scene through the XR headset and handle, enter the editing mode, use the handle to emit rays, mark the feature points of walls or obstacles in the real environment, including edges and corners, and the feature point data is stored in the form of three-dimensional coordinates (such as Vector3).

[0073] Based on the feature points, a mesh 3D model of a dynamic virtual fence is generated. In this embodiment, a ProceduralMesh tool (such as ProceduralMeshComponent in Unreal Engine or similar tools in other engines) is used to generate a mesh 3D model of a dynamic virtual fence from feature point data. The mesh 3D model of the dynamic virtual fence is used for collision detection to prevent the user from colliding with real obstacles, such as Figure 2 As shown, specifically:

[0074] Arrange the marked feature points in order. If there are errors in the feature points marked by the user, reduce the noise of the feature point data through K-means clustering or spatial smoothing;

[0075] Check whether the feature points form a closed area. If not, generate additional points through interpolation algorithm to complete the closure.

[0076] A triangle index buffer is constructed based on the feature points to define the vertices of each triangle; the construction of the triangle index buffer based on the feature points is specifically as follows:

[0077] Use feature points to construct a two-dimensional polygon, and use a triangulation algorithm (such as Delaunay triangulation) to decompose the polygon into multiple triangles;

[0078] Each triangle consists of the indices of 3 points. The index data is stored in an array and is used to define the vertices of each triangle.

[0079] The projecting of feature points onto a 2D plane to generate UV coordinates is specifically as follows:

[0080] The height range of the wall is [Ymin, Ymax], where Ymin is the lower limit of the height and Ymax is the upper limit of the height. The width range is [Xmin, Xmax], where Xmin is the lower limit of the width and Xmax is the upper limit of the width. The UV coordinates of the feature points are generated by the following formula:

[0081] U=(X-Xmin) / (Xmax-Xmin)

[0082] V=(Y-Ymin) / (Ymax-Ymin)

[0083] Where U is the U-axis coordinate of the feature point in the UV coordinate system, V is the V-axis coordinate of the feature point in the UV coordinate system, X is the X-axis coordinate of the feature point in the three-dimensional coordinate system, and Y is the Y-axis coordinate of the feature point in the three-dimensional coordinate system.

[0084] Construct a vertex buffer to store the three-dimensional coordinates of each vertex;

[0085] Project feature points onto a 2D plane to generate UV coordinates;

[0086] Calculate the normal and tangent of each triangle; the calculation of the normal and tangent of each triangle is specifically as follows:

[0087] The normal is calculated by the cross product, as follows:

[0088] Normal=normalize(cross(P2-P1,P0-P1))

[0089] In the formula, Normal represents the normal line, normalize(·) represents vector normalization, and cross(·) represents the cross product of the vector; P0 is the first vertex of the triangle, P1 is the second vertex of the triangle, and P2 is the third vertex of the triangle;

[0090] The tangent line is perpendicular to the normal line and is along the U axis of the UV coordinate system.

[0091] Assemble triangle indices, vertices, UV coordinates, normals, and tangents into a dynamic virtual fence. Taking UnrealEngine as an example, the dynamic virtual fence is as follows:

[0092]

[0093]

[0094] Generate collision volumes for dynamic virtual fence mesh 3D models to simulate physical interactions.

[0095] Example:

[0096] ProceduralMesh->SetCollisionEnabled(ECollisionEnabled::QueryAndPhysics);

[0097] ProceduralMesh->SetCollisionResponseToAllChannels(ECR_Block);

[0098] The function of generating a mesh 3D model of a dynamic virtual fence can be optimized in the following aspects:

[0099] Performance optimization:

[0100] 1. Use LOD (Level of Detail) to reduce the rendering complexity of the distant wall.

[0101] 2. Merge small walls into larger Mesh blocks to reduce Drawcall.

[0102] 3. Avoid generating too many unnecessary triangles or UVs with too high precision.

[0103] Extended functionality:

[0104] 1. Support Mesh generation for non-planar walls (such as curved walls) and adjust the triangle generation logic through fitting algorithms.

[0105] 2. Dynamic material support: Bind custom materials or dynamic material instances to the generated walls.

[0106] Establishing virtual anchor points for marking key positions in the virtual scene, wherein the key positions include story points and scene origins;

[0107] Definition of virtual anchor point:

[0108] 1. A virtual anchor point is a reference point or coordinate system in a three-dimensional space that is used to mark key locations in a virtual scene (such as story points, scene origins, etc.).

[0109] 2. The main function of the anchor is to connect the real site with the virtual space, ensuring that the user's movement and experience in the virtual environment matches the layout of the real space.

[0110] Functions of virtual anchor points:

[0111] 1. Scene switching: Each virtual scene (or story stage) has a virtual anchor point to mark the "starting point" or interaction reference point of the current scene. By adjusting the position of the anchor point, users can smoothly transition from one scene to the next.

[0112] 2. Path planning: Use anchor points to guide users to move in real space, preventing them from deviating from the intended route or hitting real obstacles.

[0113] 3. Virtual-Real Separation: Anchors allow virtual scenes to be dynamically adapted in multiple venues without rebuilding the entire scene.

[0114] The specific process of establishing a virtual anchor point is:

[0115] The data structure of the virtual anchor point contains the following information: the unique identifier ID of the virtual anchor point, the position Position of the virtual anchor point in the world coordinate system, the orientation Rotation of the virtual anchor point, the scale ratio Scale of the virtual anchor point, and the scene SceneID associated with the current virtual anchor point; the orientation of the virtual anchor point is used to determine the user's perspective and direction, and the scale ratio of the virtual anchor point is used to adapt to venues of different sizes; the data structure of the virtual anchor point is as follows:

[0116] {

[0117] "ID":"Anchor_01",

[0118] "Position":[x,y,z],

[0119] "Rotation":[pitch,yaw,roll],

[0120] "Scale":[1.0,1.0,1.0],

[0121] "SceneID":"Scene_01"

[0122] }

[0123] In edit mode, you can manually place virtual anchors using tools, or use algorithms to automatically generate virtual anchors. The virtual anchors are saved in the background as json configuration files. Sample code (using UnrealEngine as an example):

[0124] FAnchor Anchor;

[0125] Anchor.ID = "Anchor_01";

[0126] Anchor.Position=FVector(100.0f,200.0f,0.0f);

[0127] Anchor.Rotation=FRotator(0.0f,90.0f,0.0f);

[0128] Anchor.SceneID="Scene_01";

[0129] The position of the virtual anchor point is dynamically adjusted according to the user's current position. The anchor point is moved to the corresponding virtual position by calculating the user's position offset in real space. When the scene is switched, all the contents of the virtual scene are repositioned relative to the anchor point.

[0130] Example:

[0131] Assuming that the anchor point is adjusted from (100,200,0) to (300,400,0), the user-based coordinate system will be translated by the same offset (300,400,0).

[0132] Construct the user's relative coordinate system XROrigin, adjust the user's relative coordinate system XROrigin to align it with the virtual anchor point, and guide the user to move in the real space; Figure 3 As shown, the adjustment of the user's relative coordinate system to align it with the virtual anchor point specifically includes: translating the relative coordinate system XROrigin and adjusting the rotation angle of the relative coordinate system XROrigin; specifically:

[0133] The local position of the user's XR headset relative to the relative coordinate system XROrigin is defined as CurrentCameraPosition.

[0134] The local rotation of the user's XR headset relative to the relative coordinate system XROrigin is defined as CurrentCameraRotation. The world coordinates of the user's XR headset are calculated as follows:

[0135] WorldCameraPosition=TargetAnchorPosition+(TargetAnchorRotation·CurrentCameraPosition);

[0136] Where WorldCameraPosition represents the world coordinates of the user's XR headset, TargetAnchorPosition represents the position of the target virtual anchor point, and TargetAnchorRotation represents the rotation of the target virtual anchor point, which is applied to CurrentCameraPosition as a rotation matrix;

[0137] Calculate the world rotation of the user's XR headset using the following formula:

[0138] WorldCameraRotation=TargetAnchorRotation·CurrentCameraRotation;

[0139] Where WorldCameraRotation represents the world rotation of the user's XR headset, and TargetAnchorRotation represents the rotation of the target virtual anchor point;

[0140] Updates the world coordinates and world rotation of the user's XR headset.

[0141] By adjusting the position of the virtual anchor point, the user's virtual scene can be switched. The specific process is as follows:

[0142] The user triggers the conditions for switching the virtual scene; the conditions for switching the virtual scene include: the user reaches the end point of the current virtual scene and the user triggers an interaction event;

[0143] Record the position and orientation of the current virtual anchor point;

[0144] Load the virtual anchor point of the next scene and adjust the position of the virtual anchor point;

[0145] Use animation or gradient effects to achieve visual transition of virtual scenes; reposition the user to the virtual anchor point of the new virtual scene and refresh the scene's resources. Sample code for transition animation:

[0146] XROrigin->SetWorldLocation(FMath::VInterpTo(XROrigin->GetWorldLocation(),

[0147] NewPosition,DeltaTime,InterpSpeed));

[0148] The virtual anchor point and scene switching function can be optimized in the following aspects:

[0149] 1. Performance optimization of scene switching

[0150] Resource preloading:

[0151] Use asynchronous loading technology to preload the resources (such as models, textures, and light maps) of the next scene when the user approaches the switching area.

[0152] Example (Unreal Engine):

[0153] UGameplayStatics::LoadStreamLevel(this,"NextScene",true,false,FLatentActionInfo());

[0154] Anchor Cache:

[0155] For frequently used anchor points (such as key anchor points in the main scene), their data can be cached in memory to reduce loading time.

[0156] 2. Anchor point multi-site adaptation

[0157] Dynamic adjustment of venue size:

[0158] Dynamically adjust the Position and Scale of the anchor point according to the actual size of the real site (such as room size, obstacle location).

[0159] Example:

[0160] If the venue is small, you can reduce the anchor range and virtual scene scale.

[0161] If the site is larger, expand the anchor area.

[0162] Automatic generation of anchor points:

[0163] Use an algorithm to automatically generate anchor positions, for example:

[0164] Automatically analyze suitable locations for anchor placement based on site scanning data (such as LiDAR or SLAM).

[0165] Dynamically generate anchor points based on the user's activity range.

[0166] 3. User guidance and feedback

[0167] Virtual Path Guide:

[0168] Provide users with visual guidance (such as virtual arrows, light tracks) or voice prompts in the scene to help users move to the next scene anchor point.

[0169] Interactive Feedback:

[0170] When the user reaches the anchor point area, real-time feedback (such as vibration, prompt sound) is provided to confirm that the switch is successful.

[0171] 4. Extended function of scene switching

[0172] Multi-user support:

[0173] In a multiplayer XR experience, each user can have their own anchor, or share a common anchor to ensure consistency in multiplayer collaboration.

[0174] Dynamic scene generation:

[0175] Use anchor points as reference points to dynamically generate scene content (such as randomly generating rooms and paths).

[0176] Embodiment 2

[0177] The present invention proposes an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the method for dynamic adaptation and rapid deployment of XR offline large-space virtual scenes as described in Example 1 is implemented.

[0178] Embodiment 3

[0179] The present invention proposes a computer-readable storage medium storing a computer program, wherein the computer program enables a computer to execute the method for dynamic adaptation and rapid deployment of an XR offline large-space virtual scene as described in Example 1.

[0180] In the embodiments disclosed in the present application, the computer storage medium can be a tangible medium that can contain or store a program for use by or in conjunction with an instruction execution system, device or equipment. The computer storage medium can include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the above. More specific examples of computer storage media can include electrical connections based on one or more lines, portable computer disks, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROM or flash memory), optical fibers, portable compact disk read-only memories (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the above.

[0181] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed in this application can be implemented in electronic hardware or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0182] The above are only preferred embodiments of the present invention, and the protection scope of the present invention is not limited to the above embodiments. All technical solutions under the concept of the present invention belong to the protection scope of the present invention. It should be pointed out that for ordinary technicians in this technical field, some improvements and modifications without departing from the principle of the present invention should be regarded as the protection scope of the present invention.

Claims

1. A method for dynamic adaptation and rapid deployment of an XR offline large-space virtual scene, characterized in that: The following steps are involved: Extract feature points of dynamic virtual fence; Generate a dynamic virtual fence mesh 3D model based on feature points for collision detection to prevent users from colliding with real obstacles. Establishing virtual anchor points for marking key positions in the virtual scene, wherein the key positions include story points and scene origins; Construct the user's relative coordinate system, adjust the user's relative coordinate system to align it with the virtual anchor point, and guide the user to move in the real space; By adjusting the position of the virtual anchor point, the user's virtual scene can be switched.

2. The XR offline large space virtual scene dynamic adaptation and rapid deployment method as claimed in claim 1, characterized in that: The feature points of the dynamic virtual fence are specifically extracted as follows: Enter the virtual scene through the XR headset and handle, enter the editing mode, use the handle to emit rays, and mark the feature points of walls or obstacles in the real environment, including edges and corners. The feature point data is stored in the form of three-dimensional coordinates.

3. The XR offline large space virtual scene dynamic adaptation and rapid deployment method as claimed in claim 1, characterized in that: The three-dimensional grid model for generating a dynamic virtual fence based on feature points is specifically: Arrange the marked feature points in order. If there are errors in the feature points marked by the user, reduce the noise of the feature point data through K-means clustering or spatial smoothing; Check whether the feature points form a closed area. If not, generate additional points through the interpolation algorithm to complete the closure. Build a triangle index buffer based on the feature points to define the vertices of each triangle. Construct a vertex buffer to store the three-dimensional coordinates of each vertex; Project feature points onto a 2D plane to generate UV coordinates; Calculate the normal and tangent of each triangle; Assembles triangle indices, vertices, UV coordinates, normals and tangents into a dynamic virtual fence.

4. The XR offline large space virtual scene dynamic adaptation and rapid deployment method as claimed in claim 1, characterized in that: The specific steps of establishing a virtual anchor point are as follows: The data structure of the virtual anchor point contains the following information: the unique identifier ID of the virtual anchor point, the position Position of the virtual anchor point in the world coordinate system, the orientation Rotation of the virtual anchor point, the scale ratio Scale of the virtual anchor point, and the scene SceneID associated with the current virtual anchor point; the orientation of the virtual anchor point is used to determine the user's perspective and direction, and the scale ratio of the virtual anchor point is used to adapt to venues of different sizes; In edit mode, you can manually place virtual anchor points through tools, or use algorithms to automatically generate virtual anchor points. The virtual anchor points are saved in the background in the form of JSON configuration files. Dynamically adjust the position of the virtual anchor point based on the user's current position.

5. The XR offline large space virtual scene dynamic adaptation and rapid deployment method as claimed in claim 1, characterized in that: The adjusting the user's relative coordinate system to align it with the virtual anchor point specifically includes: translating the relative coordinate system and adjusting the rotation angle of the relative coordinate system; specifically: The local position of the user's XR headset relative to the relative coordinate system XROrigin is defined as CurrentCameraPosition. The local rotation of the user's XR headset relative to the relative coordinate system XROrigin is defined as CurrentCameraRotation. Calculate the world coordinates of the user's XR headset using the following formula: WorldCameraPosition=TargetAnchorPosition+(TargetAnchorRotation·CurrentCameraPosition); Where WorldCameraPosition represents the world coordinates of the user's XR headset, TargetAnchorPosition represents the position of the target virtual anchor point, and TargetAnchorRotation represents the rotation of the target virtual anchor point, which is applied to CurrentCameraPosition as a rotation matrix; Calculate the world rotation of the user's XR headset using the following formula: WorldCameraRotation=TargetAnchorRotation·CurrentCameraRotation; Where WorldCameraRotation represents the world rotation of the user's XR headset, and TargetAnchorRotation represents the rotation of the target virtual anchor point; Updates the world coordinates and world rotation of the user's XR headset.

6. The XR offline large space virtual scene dynamic adaptation and rapid deployment method as claimed in claim 1, characterized in that: The specific process of switching the virtual scene where the user is located by adjusting the position of the virtual anchor point is as follows: The user triggers the conditions for switching the virtual scene; the conditions for switching the virtual scene include: the user reaches the end point of the current virtual scene and the user triggers an interaction event; Record the position and orientation of the current virtual anchor point; Load the virtual anchor point of the next scene and adjust the position of the virtual anchor point; Use animation or gradient effects to achieve visual transitions of virtual scenes; reposition the user to the virtual anchor point of the new virtual scene and refresh the resources of the scene.

7. The XR offline large space virtual scene dynamic adaptation and rapid deployment method as claimed in claim 3, characterized in that: The construction of a triangle index buffer based on feature points is specifically as follows: Use feature points to construct a two-dimensional polygon, and use a triangulation algorithm to decompose the polygon into multiple triangles; Each triangle consists of the indices of 3 points. The index data is stored in an array and is used to define the vertices of each triangle. The projecting of feature points onto a 2D plane to generate UV coordinates is specifically as follows: The height range of the wall is [Ymin, Ymax], where Ymin is the lower limit of the height and Ymax is the upper limit of the height. The width range is [Xmin, Xmax], where Xmin is the lower limit of the width and Xmax is the upper limit of the width. The UV coordinates of the feature points are generated by the following formula: U=(X-Xmin) / (Xmax-Xmin) V=(Y-Ymin) / (Ymax-Ymin) Where U is the U-axis coordinate of the feature point in the UV coordinate system, V is the V-axis coordinate of the feature point in the UV coordinate system, X is the X-axis coordinate of the feature point in the three-dimensional coordinate system, and Y is the Y-axis coordinate of the feature point in the three-dimensional coordinate system.

8. The XR offline large space virtual scene dynamic adaptation and rapid deployment method as claimed in claim 3, characterized in that: The calculation of the normal and tangent of each triangle is specifically as follows: The normal is calculated by the cross product, as follows: Normal=normalize(cross(P2-P1,P0-P1)) In the formula, Normal represents the normal line, normalize(·) represents vector normalization, and cross(·) represents the cross product of the vector; P0 is the first vertex of the triangle, P1 is the second vertex of the triangle, and P2 is the third vertex of the triangle; The tangent line is perpendicular to the normal line and is along the U axis of the UV coordinate system.

9. An electronic device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the method for dynamic adaptation and rapid deployment of XR offline large-space virtual scenes as described in any one of claims 1 to 8 is implemented.

10. A computer-readable storage medium storing a computer program, characterized in that: The computer program enables the computer to execute the XR offline large-space virtual scene dynamic adaptation and rapid deployment method as described in any one of claims 1-8.