VR Large Space Fence Control Methods, Systems, Computer Equipment, and Storage Media
The brightness control strategy constructed by vector cross multiplication and arctangent function solves the problems of brightness abrupt changes and poor adaptability in VR large space fence control, realizes accurate position judgment and smooth brightness adjustment of convex polygon fences, and improves the immersion and safety of VR experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- 山东齐鲁壹点传媒有限公司
- Filing Date
- 2026-03-19
- Publication Date
- 2026-06-30
AI Technical Summary
Existing VR large-space fence control methods have abrupt changes in brightness adjustment, making them unsuitable for convex polygon fences. Furthermore, the rate of brightness change lacks differentiated control, affecting the immersive experience and safety.
The system uses vector cross product to determine the user's position and combines it with the arctangent function to construct a brightness control strategy. By calculating the minimum distance between the user and the fence, it achieves smooth and non-linear changes in scene brightness and fence brightness, adapting to the position determination and brightness adjustment of convex polygon fences.
It enhances the immersion and smoothness of VR scenes, accurately identifies the user's position and status, achieves natural and continuous brightness transitions, and provides differentiated warnings for internal and external states, ensuring user safety and experience comfort.
Smart Images

Figure CN122308602A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of virtual reality, and more specifically to VR large-space fence control methods, systems, computer equipment, and storage media. Background Technology
[0002] Existing VR (Virtual Reality) large-space fence control methods mostly rely on preset fixed physical or virtual fence boundaries, combined with the user's spatial positioning information, to control the movement range and issue warnings to the user near the fence boundary through visual cues. However, these methods have significant technical shortcomings in practical applications: Firstly, traditional fence control brightness warnings often use linear adjustment logic, directly adjusting the virtual scene brightness linearly based on the distance between the user and the fence boundary. This easily leads to sudden changes in scene brightness, severely disrupting the immersive experience of the VR scene, and it cannot differentiate the rate of brightness change based on whether the user is inside or outside the fence. Secondly, existing methods have relatively simple logic for calculating the distance between the user and the fence boundary and determining the position inside or outside the fence. They are mostly adapted to regular rectangular fences and have poor adaptability to personalized fences such as convex polygons. At the same time, the correlation control between distance and brightness lacks standardized mathematical model support, resulting in insufficient smoothness and accuracy of the warning effect, making it difficult to balance the safety of movement range control and the smoothness of the VR experience. Summary of the Invention
[0003] In view of this, the present invention provides a VR large space fence control method, system, computer equipment and storage medium to solve the technical problems of abrupt visual feedback, lack of differentiation in brightness adjustment inside and outside the fence and single guidance method in existing VR large space fence reminders.
[0004] In a first aspect, the present invention provides a VR large-space fence control method, comprising: Obtain the user's current position in the current unified coordinate system and the vertex data of the predefined barrier fence; the barrier fence is a convex polygon, and the vertical coordinate values of all vertices of the barrier fence and the current position point are all 0, so that all vertices and the current position point are on the same horizontal plane, to ensure the accuracy of position judgment and distance calculation and the efficiency of algorithm operation.
[0005] Based on the current location point and vertex data, the vector cross product method is used to determine whether the user is inside or outside the barrier fence. Calculate the minimum distance from the current location point to each boundary vector of the checkpoint fence; When the user is determined to be inside the barrier fence, the minimum distance value is set to a positive value; when the user is determined to be outside the barrier fence, the minimum distance value is set to a negative value. Based on the minimum distance value after taking positive or negative values, the scene brightness value and fence brightness value are calculated through a preset brightness control strategy. The rendering brightness of the VR scene and the rendering brightness of the level fence boundaries are controlled based on the scene brightness value and the fence brightness value.
[0006] To determine whether a user is inside or outside a checkpoint fence, the cross product method is used: Arrange the vertices of the checkpoint fence in a counter-clockwise or clockwise order, constructing n contiguous boundary vectors; iterate through each boundary vector, calculating the cross product of the corresponding boundary vector with the vector pointing from the origin of each boundary vector to the current position; determine the user's position based on the consistency of the directions of the cross product results: if all cross product results have the same direction, the user is determined to be inside the checkpoint fence; otherwise, the user is determined to be outside. The consistency of direction can be determined by normalizing each cross product result to a unit vector and comparing their equality, or by using other vector direction comparison methods. Before calculating the cross product, all vectors need to be converted to two-dimensional planar vectors to eliminate the interference of vertical coordinates on the determination result.
[0007] Calculate the minimum distance from the current location point to each boundary vector of the checkpoint fence, specifically including: For the n vertices of the fence, , , …, Arranged in a clockwise or counterclockwise direction to obtain , , …, Given a total of n vectors, we iterate through these n vectors to find the minimum distance between point p and each vector. The algorithm is as follows: t=( ) / ( ·
[0008] Calculate vectors by dot product. In vector Projection length and vector The ratio of its own length is used to obtain a proportion t. For the result t, there are three possible outcomes: t<=0 indicates that the distance vector of p is... The nearest point is the starting point of the vector. At this point, the minimum distance For | .
[0009] t>=1 indicates that the distance vector of p is... The nearest point is the endpoint of the vector. , At this time, the minimum distance is .
[0010] 0 < t < 1 indicates that the point closest to the p-distance vector is inside the vector. At this time, the coordinates of the point with the minimum distance are , At this time, the minimum distance is .
[0011] For all fence vectors, the minimum distance is obtained.
[0012] The brightness control strategy is constructed based on the arctangent function and is specifically expressed as: S = ( *q) + ) /
[0013] where S is the scene brightness value, with a value range of 0 to 1; the fence brightness value is the difference between 1 and the scene brightness value S (i.e., fence brightness value = 1 - S); L min is the minimum distance value after taking positive or negative values; q is a preset change speed parameter used to adjust the rate of brightness change with distance. Using the arctangent function can achieve smooth brightness change with distance, slow change near the boundary, and moderate change far from the boundary, which conforms to the human eye perception characteristics and effectively avoids the abruptness caused by linear change.
[0014] Among them, S is a value between 0 and 1, which can represent the transparency and brightness of objects in the virtual environment. When it is 0, the brightness of the model in the VR scene is the lowest and the transparency is the highest. When it is 1, it is in the normal state and is explicit. The fence brightness is controlled by 1 - S. When its value is 1, it is the brightest and the transparency is the lowest. When it is 0, it is completely not bright and completely transparent.
[0015] According to the different states of whether the user is inside or outside the level fence, different change speed parameters q are set. Through internal and external differential control, more user-friendly visual guidance is achieved.
[0016] According to the scene brightness value and the fence brightness value, control the rendering brightness of the VR scene and the rendering brightness of the level fence boundary. Specifically, when the user is inside the level fence, as the minimum distance value decreases from large to small (i.e., the user gradually approaches the boundary from the central area), the scene brightness value gradually decreases from 1, and the fence brightness value gradually increases from 0; when the user is outside the level fence, as the minimum distance value increases in the negative direction (i.e., the user gradually moves away from the boundary), the scene brightness value gradually decreases to 0, and the fence brightness value gradually increases to 1. The rendering brightness control is achieved by outputting the brightness value to the VR scene rendering engine, which is mapped by the rendering engine into a brightness signal recognizable by the hardware.
[0017] Secondly, the present invention provides a VR large-space fence control system, comprising: The data acquisition module is used to acquire the user's current position in the current unified coordinate system, as well as the vertex data of the predefined level fence; The location determination module is used to determine whether the user is inside or outside the barrier fence; The distance calculation module is used to calculate the minimum distance from the current location point to each boundary vector of the checkpoint fence; The brightness calculation module is used to calculate the scene brightness value and the fence brightness value based on the minimum distance value and through a preset brightness control strategy. The visual control module is used to control the rendering brightness of the VR scene and the rendering brightness of the level fence boundary based on the scene brightness value and the fence brightness value, so as to provide visual feedback to the user.
[0018] Thirdly, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the computer instructions to perform the method described in the first aspect or any corresponding embodiment thereof.
[0019] Fourthly, the present invention provides a computer-readable storage medium storing computer instructions for causing a computer to perform the method described in the first aspect or any corresponding embodiment thereof.
[0020] Fifthly, the present invention provides a computer program product, including computer instructions for causing a computer to perform the method described in the first aspect or any corresponding embodiment thereof.
[0021] This invention employs a brightness control strategy based on the arctangent function to achieve smooth, non-linear changes in scene brightness and fence brightness as the user moves away from the boundary. This avoids the abrupt brightness changes and visual jarring issues associated with traditional linear adjustments, significantly enhancing the immersion and smoothness of VR scenes and reducing user visual discomfort and immersion disruption. By using the vector cross product judgment and dot product projection distance calculation of the convex polygon fence, the invention can accurately identify the user's position inside or outside the fence and perform positive and negative signification on the minimum distance value, ensuring a natural and continuous transition in brightness feedback at the boundary. The internal and external warning logic is unified and seamless, improving the accuracy and comfort of boundary prompts. The brightness change rate parameter can be differentiated according to the user's state inside or outside the fence, achieving a layered guidance effect of gentle internal reminders and enhanced external warnings. This ensures immersive experience while improving the effectiveness and humanization of safety warnings. Attached Figure Description
[0022] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0023] Figure 1 This is a flowchart illustrating the VR large-space fence control method according to an embodiment of the present invention; Figure 2 This is a schematic diagram of the fence-in / outside position determination process of the VR large space fence control method according to an embodiment of the present invention; Figure 3 This is a structural block diagram of a VR large space fence control system according to an embodiment of the present invention; Figure 4 This is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention.
[0024] Figure 5 This is a schematic diagram of the arctangent function in an embodiment of the present invention (q takes the value of 1). Detailed Implementation
[0025] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0026] With the rapid iteration of VR technology and the widespread adoption of hardware devices, offline immersive VR large-space experiences have been widely applied in various fields such as interactive entertainment, education and training, and cultural tourism displays. In these experiences, users need to wear VR headsets to enter a dedicated experience area and receive virtual scene information through the headsets to achieve immersive interaction. However, because VR headsets completely obscure the user's real visual environment, users cannot intuitively perceive the physical boundaries of the real space. Without an effective range control mechanism, users are prone to moving beyond the preset experience area, causing safety hazards such as collisions and falls. Therefore, VR large-space fence control technology has become one of the core technologies to ensure user experience safety and improve the smoothness of interaction.
[0027] Current VR large-space fence control methods mostly rely on preset fixed physical or virtual fence boundaries, combined with the user's spatial positioning information to control the movement range. Visual cues are used near the fence boundaries to warn the user and prevent them from exceeding the safe area. However, this method has significant technical shortcomings in practical applications, making it difficult to simultaneously meet the dual requirements of safety control and immersive experience. Specifically, these shortcomings manifest in the following ways: On the one hand, traditional fence-controlled brightness warnings often employ linear adjustment logic, directly adjusting the virtual scene brightness linearly based on the user's distance from the fence boundary. This adjustment method is prone to sudden changes in scene brightness. When a user approaches the fence boundary, the brightness may suddenly decrease or increase, disrupting the immersion of the virtual scene. This not only affects the user experience but may also cause dizziness due to visual abrupt changes, reducing the comfort of interaction. More importantly, existing linear adjustment schemes cannot differentiate the rate of brightness change based on the user's position inside or outside the fence. The warning intensity when the user is inside and near the boundary is no different from the warning intensity when the user is far away from the boundary. This results in either excessively strong internal warnings that disrupt immersion or insufficient external warnings that fail to effectively alert the user, making it difficult to achieve user-friendly visual guidance.
[0028] On the other hand, the logic for calculating the distance between the user and the fence boundary, and determining the user's position inside and outside the fence, is relatively simple and has poor adaptability. Most solutions can only adapt to regular rectangular fences, while in actual VR large-space experiences, to adapt to different scene layouts and improve space utilization, it is often necessary to use personalized fences such as convex polygons. Existing methods have low accuracy in determining the position of such non-rectangular fences and large distance calculation errors, which cannot meet the diverse needs of different scenarios. At the same time, the correlation control between distance and brightness lacks standardized mathematical model support, and brightness change rules are mostly set by empirical values, resulting in insufficient smoothness and accuracy of warning effects. There is no uniform standard for brightness adjustment, and the warning effects are inconsistent under different devices and different scenarios. This makes it impossible for users to intuitively perceive their relative position to the boundary, and it is also difficult to maintain the smoothness of the VR experience while ensuring the safety of movement range control.
[0029] Furthermore, some solutions only provide a single visual cue for the fence boundary, without establishing a mechanism for adjusting distance, scene brightness, and fence brightness in a coordinated manner. When a user approaches or exceeds the fence boundary, the gradient of the warning information is insufficient, either failing to alert the user in a timely manner or causing the experience to be interrupted due to excessive warnings. At the same time, the distance calculation and position determination logic of existing solutions is too complex, and some algorithms have poor real-time performance, making them unable to adapt to the scenarios in which users move quickly in large VR spaces. This can easily lead to brightness adjustment delays, further reducing the warning effect and the smoothness of the experience.
[0030] To address the shortcomings of existing technologies, a new VR large-space fence control method is urgently needed. This method should be able to accurately determine the user's position and calculate the distance to the convex polygon fence. By constructing a correlation between brightness and distance through a standardized mathematical model, it can achieve smooth gradient adjustment of scene brightness and fence brightness. At the same time, it should support differentiated control of the rate of brightness change inside and outside the fence. This will enhance the immersion and smoothness of the VR large-space experience while ensuring user movement safety.
[0031] According to an embodiment of the present invention, a VR large space fence control method embodiment is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0032] Example 1 This embodiment provides a VR large-space fence control method, which includes the following steps: Step S101: Obtain the user's current location and fence vertex data Establish a unified coordinate system: Using the horizontal plane of the VR large-space experience area as a reference, establish a two-dimensional Cartesian coordinate system. All points retain only the X and Y coordinates, and the vertical coordinates are forced to 0 to eliminate the interference of height on the calculation. Preset fence vertex data: Configure a rectangular level fence, with the four vertices arranged in a counter-clockwise order, and the coordinates are... , , , (The actual size of the fence is 10 meters × 8 meters, and the vertex data are known parameters preset before the VR application is launched and stored in the system.) User location data collection: The VR headset's high-precision positioning module collects the user's current location data in real time. And map it to the aforementioned unified coordinate system.
[0033] Step S102: Determine whether the user is inside or outside the fence. Step S1021: Construct the boundary vectors of the fence that are connected end to end. (from the vertex) point to ), (from the vertex) point to ), (from the vertex) point to ), (from the vertex) point to ); Step S1022: Construct the starting point of each boundary vector pointing to the user point vector (from point to ), (from point to ), (from point to ), (from point to ); Step S1023: Calculate the cross product of the two-dimensional plane. The cross product is calculated in a fixed order: boundary vector × the vector pointing from the corresponding starting point to the user point. The result is a scalar (a single number), and the sign directly represents the vector direction. (Result is positive) (Result is positive) (Result is positive) (Result is positive) Step S1024: Determine the consistency of the cross product results in terms of direction. The four cross product results are 50, 24, 30, and 56, all of which are positive. Normalizing each cross product result to a unit vector yields +1, indicating that the directions are completely consistent. Therefore, the user's location point P(7,5) is determined to be inside the fence. If all cross product results are negative, they also indicate that the directions are consistent, and the user is determined to be inside the fence.
[0034] Step S103: Calculate the minimum distance from the user to the fence boundary. Calculate points one by one Shortest distance to each boundary vector Step S1031: To the boundary vector distance (satisfy (The projection point is inside the vector) foothold distance rice Step S1032: To the boundary vector distance (satisfy (The projection point is inside the vector) foothold distance rice Step S1033: To the boundary vector distance (satisfy (The projection point is inside the vector) foothold distance rice Step S1034: To the boundary vector distance (satisfy (The projection point is inside the vector) foothold distance rice Take the minimum distance value
[0035] The distance values of each boundary vector are 5.0 meters, 3.0 meters, 3.0 meters, and 7.0 meters, respectively, with the minimum value of 3.0 meters being taken.
[0036] Step S104: Assign a sign to the distance value based on the state inside and outside the fence. In this embodiment, the user has been determined to be inside the fence, therefore, after assigning the value... rice.
[0037] Step S105: Calculate the brightness value using the arctangent brightness control strategy. This step uses the preset q=1 in this embodiment for calculation. With this value, when the user is 3 meters inside the fence and 3 meters from the boundary, the scene brightness reaches 90% of normal brightness, while the fence is only faintly displayed at 10% brightness, barely disrupting the user's immersive experience. Simultaneously, as the user moves beyond the boundary, the brightness gradually decreases with distance, avoiding abrupt brightness drops, thus balancing warning effectiveness and visual comfort. The brightness variation curve under this value is shown in the attached instruction manual. Figure 5 A perfect match is calculated as follows: Calculate the product of distance and parameter: L min ×q=3.0×1=3.0; Calculate the arctangent value in radians: arctan(3.0)≈1.2490 radians (π is taken as 3.1416); Calculate the numerator: 1.2490+π / 2=1.2490+1.5708=2.8198; Calculate the scene brightness value S: S = 2.8198 / 3.1416 ≈ 0.90; Calculate the fence brightness value: 1−S=1−0.90=0.10.
[0038] Step S106: Output brightness value to control real-time rendering of VR scene The scene brightness value S≈0.90 and the fence brightness value≈0.10 are passed to the VR scene rendering engine. The engine converts the values into hardware-recognizable brightness control signals to achieve visual feedback. Specific effects: Scene rendering: The scene brightness is 90% of the normal brightness, with only a very slight decrease in brightness, which does not disrupt the immersive experience of the VR scene at all, and only provides a very soft reminder of the boundary inside the fence; Fence rendering: The fence boundary is displayed with a very faint highlight at 10% brightness, providing users with only an implicit indication of the boundary position without any visual abruptness; Gradient change effect: If the user continues to move towards the fence boundary, L min The brightness of the fence will gradually decrease (the scene gradually darkens) and the fence brightness value will gradually increase (the fence gradually brightens), achieving a completely smooth visual gradient change and completely avoiding the abrupt brightness changes of traditional linear adjustment; if the user moves towards the center of the fence, L... min As S continues to increase, it will gradually approach 1, and the fence brightness value will gradually approach 0, eventually restoring a completely normal immersive experience. When S=1, the VR scene is rendered in a normal immersive experience state, and the level fence boundary is a completely transparent and hidden state with no brightness; when S=0, the VR scene is a completely black low-brightness state, and the level fence boundary is a display reminder state with the highest brightness.
[0039] Ultimately, the visual effect seen by the user in the VR headset is as follows: the scene brightness changes almost imperceptibly, and the fence boundary is only faintly visible, which achieves the safety prompt of "approaching the boundary" without disrupting the immersive experience of the VR scene; as the user continues to approach the boundary, the minimum distance value continues to decrease, the scene brightness will decrease gradually, and the fence brightness will increase gradually, achieving imperceptible smooth gradient guidance, which fully meets the design goals of this invention.
[0040] This embodiment fully implements a typical execution flow of the VR large space fence control method. Based on accurate geometric calculations and standardized mathematical models, it smoothly associates the user's position with visual feedback, maximizing the immersion and smoothness of the VR large space experience while ensuring the user's movement safety. Example
[0041] The difference between this embodiment and embodiment 1 is that the vertices of the checkpoint fence are arranged in a clockwise order, and the construction order of the corresponding boundary vectors is reversed compared to embodiment 1, but the cross product direction consistency judgment rule remains unchanged. Example
[0042] The difference between this embodiment and embodiment 1 is that different preset change rate parameters q are used inside and outside the fence, and the parameter values are different from those in embodiment 1, so as to form different combinations of brightness change rate.
[0043] This embodiment also provides a VR large-space fence control device, which is used to implement the above embodiments and preferred embodiments, and will not be repeated as already described. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0044] This embodiment provides a VR large space fence control system, such as Figure 3 As shown, it includes: The data acquisition module is used to acquire the user's current position in the current unified coordinate system, as well as the vertex data of the predefined level fence; The location determination module is used to determine whether the user is inside or outside the barrier fence; The distance calculation module is used to calculate the minimum distance from the current location point to each boundary vector of the checkpoint fence; The brightness calculation module is used to calculate the scene brightness value and the fence brightness value based on the minimum distance value and through a preset brightness control strategy. The visual control module is used to control the rendering brightness of the VR scene and the rendering brightness of the level fence boundary based on the scene brightness value and the fence brightness value, so as to provide visual feedback to the user.
[0045] Further functional descriptions of the above modules and units are the same as those in the corresponding embodiments described above, and will not be repeated here.
[0046] In this embodiment, the VR large space fence control device is presented in the form of a functional unit. Here, a unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that execute one or more software or fixed programs, and / or other devices that can provide the above functions.
[0047] This invention also provides a computer device having the above-described features. Figure 4 The VR large space fence control device shown is shown.
[0048] Please see Figure 4 , Figure 4 This is a schematic diagram of the structure of a computer device provided in an optional embodiment of the present invention, such as... Figure 4 As shown, the computer device includes one or more processors 10, memory 20, and interfaces for connecting the components, including high-speed interfaces and low-speed interfaces. The components communicate with each other via different buses and can be mounted on a common motherboard or otherwise installed as needed. The processors can process instructions executed within the computer device, including instructions stored in or on memory to display graphical information of a GUI on external input / output devices (such as display devices coupled to the interfaces). In some alternative implementations, multiple processors and / or multiple buses can be used with multiple memories and multiple memory modules, if desired. Similarly, multiple computer devices can be connected, each providing some of the necessary operations (e.g., as a server array, a group of blade servers, or a multiprocessor system). Figure 4 Take a processor 10 as an example.
[0049] Processor 10 may be a central processing unit, a network processor, or a combination thereof. Processor 10 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The programmable logic device may be a complex programmable logic device (CAMP), a field-programmable gate array (FPGA), a general-purpose array logic (GDA), or any combination thereof.
[0050] The memory 20 stores instructions executable by at least one processor 10 to cause the at least one processor 10 to perform the method shown in the above embodiments.
[0051] The memory 20 may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created based on the use of the computer device. Furthermore, the memory 20 may include high-speed random access memory and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some alternative embodiments, the memory 20 may optionally include memory remotely located relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0052] The memory 20 may include volatile memory, such as random access memory; the memory may also include non-volatile memory, such as flash memory, hard disk or solid-state drive; the memory 20 may also include a combination of the above types of memory.
[0053] The computer device also includes a communication interface 30 for communicating with other devices or communication networks.
[0054] This invention also provides a computer-readable storage medium. The methods described above according to embodiments of the invention can be implemented in hardware or firmware, or implemented as computer code that can be recorded on a storage medium, or implemented as computer code downloaded via a network and originally stored on a remote storage medium or a non-transitory machine-readable storage medium and then stored on a local storage medium. Thus, the methods described herein can be processed by software stored on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. The storage medium can be a magnetic disk, optical disk, read-only memory, random access memory, flash memory, hard disk, or solid-state drive, etc.; further, the storage medium can also include combinations of the above types of memory. It is understood that computers, processors, microprocessor controllers, or programmable hardware include storage components capable of storing or receiving software or computer code, which, when accessed and executed by the computer, processor, or hardware, implements the methods shown in the above embodiments.
[0055] A portion of this application can be applied as a computer program product, such as computer program instructions, which, when executed by a computer, can invoke or provide the methods and / or technical solutions according to this application through the operation of the computer. Those skilled in the art will understand that the forms in which computer program instructions exist in a computer-readable medium include, but are not limited to, source files, executable files, installation package files, etc. Correspondingly, the ways in which computer program instructions are executed by a computer include, but are not limited to: the computer directly executing the instructions, or the computer compiling the instructions and then executing the corresponding compiled program, or the computer reading and executing the instructions, or the computer reading and installing the instructions and then executing the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to a computer.
[0056] Although embodiments of the invention have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the invention, and such modifications and variations all fall within the scope defined by the appended claims.
Claims
1. A VR large-space fence control method, characterized in that, The method includes: Obtain the user's current position in the current unified coordinate system and the vertex data of the predefined level fence; Based on the current location point and the vertex data, the user is determined to be inside or outside the checkpoint fence using the vector cross product method; Calculate the minimum distance from the current location point to each boundary vector of the checkpoint fence; If the user is inside the barrier fence, the minimum distance value is taken as a positive value; if the user is outside the barrier fence, the minimum distance value is taken as a negative value. Based on the minimum distance value, the scene brightness value and the fence brightness value are calculated through a preset brightness control strategy; The brightness control strategy is based on the arctangent function, and the scene brightness value is calculated using the following formula: S =( *q)+ ) / ; Where S is the scene brightness value; L min The minimum distance value after taking a positive or negative value; q is a preset rate of change parameter used to adjust the rate at which the brightness changes with distance; the fence brightness value is 1-S; Based on the scene brightness value and the fence brightness value, control the rendering brightness of the VR scene and the rendering brightness of the level fence boundary.
2. The VR large-space fence control method according to claim 1, characterized in that, The calculation of the minimum distance from the current location point to each boundary vector of the checkpoint fence includes: For each boundary vector, determine the nearest point on that boundary vector to the current position. Calculate the distance from the current position point to the nearest point, and use it as the distance from the current position point to the boundary vector; The minimum distance among all the distances corresponding to the boundary vectors is taken as the minimum distance value.
3. The VR large-space fence control method according to claim 2, characterized in that, Determining the nearest point on the boundary vector to the current position includes: For each boundary vector, calculate the dot product of the vector pointing from the starting point of the boundary vector to the current position point and the boundary vector, and divide the dot product result by the dot product result of the boundary vector and itself to obtain the scaling factor t; If t is less than or equal to 0, the starting point of the boundary vector is determined as the nearest point; If t is greater than or equal to 1, the endpoint of the boundary vector is determined as the nearest point; If t is greater than 0 and less than 1, then the nearest point is the perpendicular point on the boundary vector.
4. The VR large-space fence control method according to claim 1, characterized in that, The step of controlling the rendering brightness of the VR scene and the rendering brightness of the level fence boundary based on the scene brightness value and the fence brightness value includes: If the user is inside the barrier fence, as the minimum distance value decreases, the scene brightness value gradually decreases and the fence brightness value gradually increases. If the user is outside the barrier fence, as the minimum distance value increases in the negative direction, the scene brightness value gradually decreases, while the fence brightness value gradually increases.
5. The VR large-space fence control method according to claim 1, characterized in that, The step of determining whether the user is inside or outside the checkpoint fence using the vector cross product method includes: Arrange the vertices of the checkpoint fence in order to construct n boundary vectors that are connected end to end; Traverse each boundary vector and calculate the cross product of the boundary vector with the vector pointing from the starting point of the vector to the current position point; The user's location is determined based on the consistency of the directions of all cross product results: if the directions of all cross product results are consistent, the user is determined to be inside the checkpoint fence; otherwise, the user is determined to be outside.
6. The VR large-space fence control method according to claim 1, characterized in that, The preset rate of change parameter can be set to values inside and outside the fence respectively, so as to achieve differentiated control of the rate of brightness change inside and outside the fence.
7. A VR large-space fence control system, characterized in that, The system includes: The data acquisition module is used to acquire the user's current position in the current unified coordinate system, as well as the vertex data of the predefined level fence; The location determination module is used to determine whether the user is inside or outside the checkpoint fence; The distance calculation module is used to calculate the minimum distance value from the current location point to each boundary vector of the checkpoint fence; The brightness calculation module is used to calculate the scene brightness value and the fence brightness value based on the minimum distance value and through a preset brightness control strategy. The visual control module is used to control the rendering brightness of the VR scene and the rendering brightness of the level fence boundary based on the scene brightness value and the fence brightness value, so as to provide visual feedback to the user.
8. A computer device, characterized in that, include: A memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, the processor executing the computer instructions to perform the method of any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing a computer to perform the method of any one of claims 1 to 6.
10. A computer program product, characterized in that, Includes computer instructions for causing a computer to perform the method of any one of claims 1 to 6.