CN114570023A - Method and device for realizing virtual intelligent boundary wall in UE4 engine - Google Patents
Method and device for realizing virtual intelligent boundary wall in UE4 engine Download PDFInfo
- Publication number
- CN114570023A CN114570023A CN202210129276.4A CN202210129276A CN114570023A CN 114570023 A CN114570023 A CN 114570023A CN 202210129276 A CN202210129276 A CN 202210129276A CN 114570023 A CN114570023 A CN 114570023A
- Authority
- CN
- China
- Prior art keywords
- boundary wall
- value
- distance
- pixel point
- preset
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 40
- 239000000463 material Substances 0.000 claims abstract description 50
- 230000006870 function Effects 0.000 claims description 40
- 230000015654 memory Effects 0.000 claims description 28
- 230000000737 periodic effect Effects 0.000 claims description 12
- 238000004364 calculation method Methods 0.000 claims description 2
- 230000000694 effects Effects 0.000 abstract description 10
- 238000010586 diagram Methods 0.000 description 4
- 230000003287 optical effect Effects 0.000 description 3
- 238000009877 rendering Methods 0.000 description 2
- 230000003068 static effect Effects 0.000 description 2
- 230000001413 cellular effect Effects 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000005286 illumination Methods 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Images
Classifications
-
- A—HUMAN NECESSITIES
- A63—SPORTS; GAMES; AMUSEMENTS
- A63F—CARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
- A63F13/00—Video games, i.e. games using an electronically generated display having two or more dimensions
- A63F13/50—Controlling the output signals based on the game progress
- A63F13/53—Controlling the output signals based on the game progress involving additional visual information provided to the game scene, e.g. by overlay to simulate a head-up display [HUD] or displaying a laser sight in a shooting game
- A63F13/537—Controlling the output signals based on the game progress involving additional visual information provided to the game scene, e.g. by overlay to simulate a head-up display [HUD] or displaying a laser sight in a shooting game using indicators, e.g. showing the condition of a game character on screen
-
- A—HUMAN NECESSITIES
- A63—SPORTS; GAMES; AMUSEMENTS
- A63F—CARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
- A63F13/00—Video games, i.e. games using an electronically generated display having two or more dimensions
- A63F13/55—Controlling game characters or game objects based on the game progress
- A63F13/57—Simulating properties, behaviour or motion of objects in the game world, e.g. computing tyre load in a car race game
- A63F13/577—Simulating properties, behaviour or motion of objects in the game world, e.g. computing tyre load in a car race game using determination of contact between game characters or objects, e.g. to avoid collision between virtual racing cars
-
- A—HUMAN NECESSITIES
- A63—SPORTS; GAMES; AMUSEMENTS
- A63F—CARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
- A63F13/00—Video games, i.e. games using an electronically generated display having two or more dimensions
- A63F13/60—Generating or modifying game content before or while executing the game program, e.g. authoring tools specially adapted for game development or game-integrated level editor
-
- A—HUMAN NECESSITIES
- A63—SPORTS; GAMES; AMUSEMENTS
- A63F—CARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
- A63F2300/00—Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game
- A63F2300/60—Methods for processing data by generating or executing the game program
- A63F2300/66—Methods for processing data by generating or executing the game program for rendering three dimensional images
- A63F2300/6692—Methods for processing data by generating or executing the game program for rendering three dimensional images using special effects, generally involving post-processing, e.g. blooming
-
- A—HUMAN NECESSITIES
- A63—SPORTS; GAMES; AMUSEMENTS
- A63F—CARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
- A63F2300/00—Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game
- A63F2300/80—Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game specially adapted for executing a specific type of game
- A63F2300/8082—Virtual reality
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Theoretical Computer Science (AREA)
- Human Computer Interaction (AREA)
- Physics & Mathematics (AREA)
- Optics & Photonics (AREA)
- Processing Or Creating Images (AREA)
Abstract
The invention relates to a method, a device, computer equipment and a storage medium for realizing a virtual intelligent boundary wall in a UE4 engine, wherein the method comprises the following steps: the method comprises the steps that world coordinates of all pixel points of a boundary wall are obtained from a material ball of the boundary wall, and the world coordinates of preset points are transmitted to the material ball in a blueprint; calculating the distance values between the world coordinates of the preset points and the world coordinates of all the pixel points on the boundary wall in the material ball; and when the distance value between the world coordinate of any pixel point in the boundary wall and the world coordinate of the preset point is smaller than the maximum distance value, displaying the any pixel point in the boundary wall so as to display a circular area in the boundary wall. The method can have a cool effect so as to display the boundary wall with a warning feeling for the user.
Description
Technical Field
The present invention relates to the field of virtual engine technology, and in particular, to a method, an apparatus, a computer device, and a storage medium for implementing a virtual intelligent boundary wall in a UE4 engine.
Background
The UE4 is a 3A-level time game engine developed by Epic game company in America, has a strong rendering effect, adopts a physical material system, and is one of favorite engines of developers. The UE4 picture effect completely reaches the 3A game level, and the illumination and physical rendering effect is strong. The UE4 blueprint system allows game plans to edit code as well, and the various official plugins are complete, so that developers do not need to build third-party plugins and worry about compatible interface problems. More importantly, the UE4 provides good support for the handle, VR controller for virtual reality gaming.
In some VR applications, there are often boundaries such as walls, cliffs, etc. and when a user walks near the boundary, some visual or audible prompt is needed to alert the user that the boundary region is approached and cannot continue to move forward. Existing VR applications may display a wall to alert the user when the user walks to a boundary area, but this is relatively single.
Disclosure of Invention
The invention aims to overcome the defects of the prior art and provides a method, a device, computer equipment and a storage medium for realizing a virtual intelligent boundary wall in a UE4 engine, which can display the boundary wall with a more cool effect and a more warning feeling for a user.
In order to solve at least one of the above technical problems, an embodiment of the present invention provides a method for implementing a virtual intelligent boundary wall in a UE4 engine, where the method includes:
the method comprises the steps that world coordinates of all pixel points of a boundary wall are obtained from a material ball of the boundary wall, and the world coordinates of preset points are transmitted to the material ball in a blueprint;
calculating the distance values between the world coordinates of the preset points and the world coordinates of all the pixel points on the boundary wall in the material ball;
and when the distance value between the world coordinate of any pixel point in the boundary wall and the world coordinate of the preset point is smaller than the maximum distance value, displaying the any pixel point in the boundary wall so as to display a circular area in the boundary wall.
In one embodiment, the displaying any pixel point in the boundary wall when the distance value between the world coordinate of any pixel point in the boundary wall and the world coordinate of the preset point is smaller than a given distance maximum value includes:
subtracting the distance value between the world coordinate of any pixel point in the boundary wall and the world coordinate of the preset point from the maximum value of the given distance to obtain a first difference value;
when the first difference is smaller than zero, any pixel point in the boundary wall is not displayed;
and when the first difference is larger than or equal to zero, displaying any pixel point in the boundary wall so as to display a circular area in the boundary wall.
In an embodiment, the circular region includes a plurality of pixel points, and the smaller the difference between the pixel points and the preset point among the plurality of pixel points is, the larger the brightness of the pixel points is.
In one embodiment, the circular region includes a plurality of pixel points, and the method further includes:
acquiring a second difference value between any pixel point in the circular area and the preset point;
dividing the second difference value by the given maximum distance value to obtain a quotient value;
and assigning the quotient value to the opacity of the material ball to obtain the brightness of any pixel point in the circular area.
In one embodiment, the method further comprises:
obtaining the shortest distance from the preset point to the boundary wall;
and when the shortest distance is smaller than the preset maximum flicker distance, starting the flicker of the boundary wall.
In one embodiment, after the starting of the flickering of the boundary wall, the method further includes:
starting a time node and a trigonometric function node of the material ball;
obtaining a time value through a time function of the time node;
obtaining a period coefficient of a trigonometric function of the trigonometric function node according to the time value, the maximum flicker distance and the shortest distance;
obtaining a flicker control value according to the trigonometric function and the periodic coefficient;
and controlling the flicker of the boundary wall according to the flicker control value.
In one embodiment, the obtaining the periodic coefficient of the trigonometric function node according to the time value, the maximum flicker distance and the shortest distance includes:
obtaining a third difference value between the maximum flicker distance and the shortest distance;
calculating a ratio of the third difference to the shortest distance;
obtaining the product of the time value and the ratio, wherein the product of the time value and the ratio is the period coefficient;
the obtaining of the flicker control value according to the trigonometric function and the periodic coefficient includes:
and taking the product of a trigonometric function sine and the periodic coefficient as the flicker control value, wherein the trigonometric function is the trigonometric function sine.
An apparatus for implementing a virtual intelligent boundary wall in a UE4 engine, the apparatus comprising:
the acquisition module is used for acquiring the world coordinates of each pixel point of the boundary wall from the material ball of the boundary wall and transmitting the world coordinates of the preset points to the material ball in a blueprint;
the calculation module is used for calculating the distance values between the world coordinates of the preset points and the world coordinates of all the pixel points on the boundary wall in the material ball;
and the display module is used for displaying any pixel point in the boundary wall when the distance value between the world coordinate of any pixel point in the boundary wall and the world coordinate of the preset point is smaller than the maximum given distance value, so that a circular area is displayed in the boundary wall.
In addition, an embodiment of the present invention further provides a computer device, including: the system comprises a memory, a processor and an application program stored on the memory and capable of running on the processor, wherein the processor realizes the steps of the method of any embodiment when executing the application program.
In addition, an embodiment of the present invention further provides a computer-readable storage medium, on which an application program is stored, and when the application program is executed by a processor, the steps of any one of the above-mentioned embodiments of the method are implemented.
In the embodiment of the invention, the world coordinates of each pixel point of the boundary wall are obtained from the material ball of the boundary wall, and the world coordinates of the preset points are transmitted to the material ball in the blueprint; calculating the distance values between the world coordinates of the preset points and the world coordinates of all the pixel points on the boundary wall in the material ball; and when the distance value between the world coordinate of any pixel point in the boundary wall and the world coordinate of the preset point is smaller than the maximum distance value, displaying the any pixel point in the boundary wall so as to display a circular area in the boundary wall. Therefore, the circular area can be displayed on the boundary wall, and not all of the boundary walls can be displayed, so that the boundary wall display with a more cool effect and a more warning feeling for the user can be provided.
Drawings
Fig. 1 is a schematic flowchart of a method for implementing a virtual intelligent boundary wall in a UE4 engine according to an embodiment of the present invention;
fig. 2 is a schematic diagram illustrating a boundary wall display effect of a method for implementing a virtual intelligent boundary wall in a UE4 engine according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of an apparatus for implementing a virtual intelligent boundary wall in a UE4 engine according to an embodiment of the present invention;
fig. 4 is a schematic structural component diagram of a computer device in the embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The embodiment of the invention provides a method for realizing a virtual intelligent boundary wall in a UE4 engine, which comprises the following steps of:
s102, obtaining world coordinates of all pixel points of the boundary wall from a material ball of the boundary wall, and transmitting the world coordinates of preset points to the material ball in a blueprint.
Specifically, the world coordinates of each pixel point are acquired by a material ball of the boundary wall, and the world coordinates of the preset points are transmitted to the material ball in a blueprint.
And S104, calculating the distance values between the world coordinates of the preset points and the world coordinates of all the pixel points on the boundary wall in the material ball.
Specifically, a float4 type variable named TriggerPoint is declared as the location of the trigger boundary wall preset point. And obtaining the world coordinates of each pixel point in the material ball, further subtracting the world coordinates of TriggerPoint, and calculating the size of each obtained vector, namely the distance value from each pixel point to a preset point.
And S106, when the distance value between the world coordinate of any pixel point in the boundary wall and the world coordinate of the preset point is smaller than the maximum distance value, displaying any pixel point in the boundary wall so as to display a circular area in the boundary wall.
Specifically, the distance is used to trigger the display of the boundary wall. And when the preset point is close to the boundary wall to the maximum display distance, displaying a pixel point of a circular area of the boundary wall, wherein the circle center position of the circular area is the position of the coordinate projection of the preset point on the boundary wall. The implementation mode is as follows: referring to fig. 2, distance values between each pixel point and the preset point are calculated, and when any distance value is smaller than a given distance maximum value, a pixel point corresponding to the distance value is displayed, so that a circular area is displayed on the boundary wall.
In one embodiment, the displaying any pixel point in the boundary wall when the distance value between the world coordinate of any pixel point in the boundary wall and the world coordinate of the preset point is smaller than a given distance maximum value includes: subtracting the distance value between the world coordinate of any pixel point in the boundary wall and the world coordinate of the preset point from the maximum value of the given distance to obtain a first difference value; when the first difference is smaller than zero, any pixel point in the boundary wall is not displayed; and when the first difference is larger than or equal to zero, displaying any pixel point in the boundary wall so as to display a circular area in the boundary wall.
Specifically, the distance value between each pixel point and the preset point is calculated, any distance value is subtracted from the maximum value of the given distance, the result is less than 0 and returns to 0, and the pixel point corresponding to any distance value is not displayed. And otherwise, when the result is larger than 0, displaying the pixel point corresponding to any distance value.
In an embodiment, the circular region includes a plurality of pixel points, and the smaller the difference between the pixel points and the preset point is, the larger the brightness of the pixel point is.
Specifically, the position of the circular area where the preset point is projected to is the center of the circle of the circular area. The circular area comprises a plurality of pixel points, and the smaller the difference value between the pixel point in the circular area and the preset point is, the larger the brightness of the pixel point is. That is, the difference between the pixel point of the center of the circle of the circular area and the preset point is minimum, and the pixel point of the center of the circle is brightest. The pixel points far away from the center of the circle are far away, the difference value between the pixel points and the preset point is larger, the brightness of the corresponding pixel points is smaller, namely, the brightness of the pixel points close to the edge of the circular area is smaller, and the corresponding pixel points are darker. As shown in fig. 2 and the above example, the closer the pixel point to the center of the circle in the boundary wall is, the brighter the pixel point away from the center of the circle is, and the closer the preset point is to the boundary wall, the brighter the pixel point in the circular area is.
In an embodiment, the circular region includes a plurality of pixel points, and after S106, the method further includes: acquiring a second difference value between any pixel point in the circular area and the preset point; dividing the second difference value by the given maximum distance value to obtain a quotient value; and assigning the quotient value to the opacity of the material ball to obtain the brightness of any pixel point in the circular area.
Specifically, the distance value between each pixel point and the preset point is calculated, the given distance maximum value is subtracted by any distance value, and then the given distance maximum value is divided by the given distance maximum value to obtain a result value, and the result value is between (0 and 1). Assigning the result value to the opacity of the material ball, so that the Alpha value of the pixel point closer to the center of the circle is higher, the Alpha value of the pixel point closer to the given distance maximum value is closer to 0, and the calculated value is closer to 0, and the color of the pixel point is more virtual.
If so, declaring a float type variable named TriggerToWallDistance as the shortest distance from the preset point of the triggering boundary wall to the plane where the boundary wall is located; a float type variable named MaxPrestance is declared as the farthest distance to display the boundary wall.
And obtaining the world coordinates of each pixel point in the material ball, further subtracting the world coordinates of TriggerPoint, and calculating the size of each obtained vector, namely the distance value from each pixel point to a preset point. And then, subtracting the distance value from each pixel point to the preset point by the MaxPrestance, converting the result by using a clamp material node, so that the result is 0 when the result is less than 0 and is MaxPrestance when the result is greater than the MaxPrestance, multiplying the result by the n-th power of (MaxPrestance/the distance value from each pixel point to the preset point), and finally obtaining recorded Alpha1, wherein the value of n can be adjusted according to the actual effect, so that the brightness degree of the displayed area is more obvious.
In one embodiment, S106 is followed by: obtaining the shortest distance from the preset point to the boundary wall; and when the shortest distance is smaller than the preset maximum flicker distance, starting the flicker of the boundary wall.
Preferably, after the starting of the flickering of the boundary wall, the method further includes: starting a time node and a trigonometric function node of the material ball; obtaining a time value through a time function of the time node; obtaining a period coefficient of a trigonometric function of the trigonometric function node according to the time value, the maximum flicker distance and the shortest distance; obtaining a flicker control value according to the trigonometric function and the periodic coefficient; and controlling the flicker of the boundary wall according to the flicker control value.
Preferably, the obtaining the periodic coefficient of the trigonometric function node according to the time value, the maximum flicker distance and the shortest distance includes: obtaining a third difference value between the maximum flicker distance and the shortest distance; calculating a ratio of the third difference to the shortest distance; obtaining the product of the time value and the ratio, wherein the product of the time value and the ratio is the period coefficient; the obtaining of the flicker control value according to the trigonometric function and the periodic coefficient includes: and taking the product of a trigonometric function sine and the periodic coefficient as the flicker control value, wherein the trigonometric function is the trigonometric function sine.
Specifically, the shortest distance from the preset point to the boundary wall is obtained, when the shortest distance is smaller than the preset maximum flicker distance, the Time node and the trigonometric function node of the material ball are used, the flicker of the boundary wall is started, and the shortest distance from the preset point to the boundary wall is used as the period coefficient of the trigonometric function, so that the shorter the distance is, the faster the flicker is.
For example, a float type variable, named Shining distance, is declared as the maximum flicker distance to start flicker. And declaring a float type variable named TriggerToWallDistance as the shortest distance between the trigger preset point and the plane where the boundary wall is located.
In the material ball, comparing ShiningDistance and TriggerToWallDistance by using if node, if TriggerToWallDistance > is ShiningDistance, returning to 1; if TriggerToWallDistance < shinning distance, then a time function in the ball of material is used, the time function will pass out a time value that goes on over time, say 2 seconds, and will pass out a 2. And the time value is multiplied by (ShiningDistance-TriggerToWallDistance) and then divided by TriggerToWallDistance to obtain the period coefficient. The periodic coefficient is multiplied by the sine function to obtain Alpha2, and the result Alpha2 changes periodically between (-1, 1) over time and changes faster and faster as TriggerToWallDistance becomes smaller. Therefore, according to the result of Alpha2, when the preset point is close to the boundary wall to the maximum flickering distance, the boundary wall starts to flicker, and the flickering speed is faster as the distance is closer, so that the warning effect is enhanced.
In one embodiment, the opacity of the material ball is assigned Alpha1 Alpha2, which allows the material of the boundary wall to be sufficient.
It should be noted that, when the UE4 engine implements the method for implementing the virtual intelligent boundary wall in the UE4 engine according to the foregoing embodiments, the declaration of each parameter refers to the following processing manner:
blue chart aspect: and (5) creating an Actor to add a static model component, wherein the static model component is a boundary wall model. A more cool bounding wall model may be provided, the material of which is modified according to the scofflaw above.
The fictitious self-contained function createDynamicMaterialInstance is used for converting the model material of the boundary wall into a dynamic material example, and the parameters of the material can be modified in a blueprint. Then, using the function SetVectorParamerValue to set TriggerPoin, using the function SetScalarPaeameterValue to set TriggerToWallDistance, MaxListance and ShiningDistance to define the parameters declared in the material in the blueprint.
In the embodiment of the invention, the world coordinates of each pixel point of the boundary wall are obtained from the material ball of the boundary wall, and the world coordinates of the preset points are transmitted to the material ball in the blueprint; calculating the distance values between the world coordinates of the preset points and the world coordinates of all the pixel points on the boundary wall in the material ball; and when the distance value between the world coordinate of any pixel point in the boundary wall and the world coordinate of the preset point is smaller than the maximum distance value, displaying the any pixel point in the boundary wall so as to display a circular area in the boundary wall. Therefore, the circular region can be displayed on the boundary wall, instead of displaying all the one boundary wall, and the boundary wall display having a more striking effect and a more warning feeling for the user can be provided.
In an embodiment, the present invention further provides an apparatus for implementing a virtual intelligent boundary wall in a UE4 engine, as shown in fig. 3, the apparatus includes:
the obtaining module 302 is configured to obtain a world coordinate of each pixel point of the boundary wall from a material ball of the boundary wall, and transmit the world coordinate of a preset point to the material ball in a blueprint.
And the calculating module 304 is configured to calculate, in the material ball, distance values between the world coordinates of the preset points and the world coordinates of each pixel point on the boundary wall.
The display module 306 is configured to display any pixel point in the boundary wall when a distance value between the world coordinate of any pixel point in the boundary wall and the world coordinate of the preset point is smaller than a given distance maximum value, so as to display a circular region in the boundary wall.
For specific limitations of the apparatus for implementing a virtual intelligent boundary wall in a UE4 engine, reference may be made to the above limitations of the method for implementing a virtual intelligent boundary wall in a UE4 engine, which are not described herein again. The various modules in the virtual intelligent boundary wall implementation apparatus in the UE4 engine described above may be implemented in whole or in part by software, hardware, and combinations thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
The computer-readable storage medium provided in an embodiment of the present invention stores an application program, and when the application program is executed by a processor, the application program implements a method for implementing a virtual intelligent boundary wall in a UE4 engine according to any one of the above embodiments. The computer-readable storage medium includes, but is not limited to, any type of disk including floppy disks, hard disks, optical disks, CD-ROMs, and magneto-optical disks, ROMs (Read-Only memories), RAMs (Random AcceSS memories), EPROMs (EraSable Programmable Read-Only memories), EEPROMs (Electrically EraSable Programmable Read-Only memories), flash memories, magnetic cards, or optical cards. That is, a storage device includes any medium that stores or transmits information in a form readable by a device (e.g., a computer, a cellular phone), and may be a read-only memory, a magnetic or optical disk, or the like.
The embodiment of the invention also provides a computer application program, which runs on a computer and is used for executing the method for realizing the virtual intelligent boundary wall in the UE4 engine in any one of the embodiments.
Fig. 4 is a schematic structural diagram of a computer device in the embodiment of the present invention.
An embodiment of the present invention further provides a computer device, as shown in fig. 4. The computer device comprises a processor 402, a memory 403, an input unit 404, and a display unit 405. Those skilled in the art will appreciate that the device configuration means shown in fig. 4 do not constitute a limitation of all devices and may include more or less components than those shown, or some components in combination. The memory 403 may be used to store the application 401 and various functional modules, and the processor 402 executes the application 401 stored in the memory 403, thereby performing various functional applications of the device and data processing. The memory may be internal or external memory, or include both internal and external memory. The memory may comprise read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), flash memory, or random access memory. The external memory may include a hard disk, a floppy disk, a ZIP disk, a usb disk, a magnetic tape, etc. The disclosed memory includes, but is not limited to, these types of memory. The disclosed memory is by way of example only and not by way of limitation.
The input unit 404 is used for receiving input of signals and receiving keywords input by a user. The input unit 404 may include a touch panel and other input devices. The touch panel can collect touch operations of a user on or near the touch panel (for example, operations of the user on or near the touch panel by using any suitable object or accessory such as a finger, a stylus and the like) and drive the corresponding connecting device according to a preset program; other input devices may include, but are not limited to, one or more of a physical keyboard, function keys (such as play control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like. The display unit 405 may be used to display information input by a user or information provided to the user and various menus of the terminal device. The display unit 405 may take the form of a liquid crystal display, an organic light emitting diode, or the like. The processor 402 is a control center of the terminal device, connects various parts of the entire device using various interfaces and lines, and performs various functions and processes data by running or executing software programs and/or modules stored in the memory 403 and calling data stored in the memory.
As one embodiment, the computer device includes: one or more processors 402, a memory 403, one or more applications 401, wherein the one or more applications 401 are stored in the memory 403 and configured to be executed by the one or more processors 402, and wherein the one or more applications 401 are configured to perform a method for implementing a virtual intelligent boundary wall in a UE4 engine in any of the above embodiments.
In addition, the above detailed description is provided for a method, an apparatus, a computer device, and a storage medium for implementing a virtual intelligent boundary wall in a UE4 engine according to an embodiment of the present invention, and a specific example should be used herein to explain the principle and the implementation of the present invention, and the description of the above embodiment is only used to help understand the method and the core idea of the present invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.
Claims (10)
1. A method for realizing a virtual intelligent boundary wall in a UE4 engine is characterized by comprising the following steps:
the method comprises the steps that world coordinates of all pixel points of a boundary wall are obtained from a material ball of the boundary wall, and the world coordinates of preset points are transmitted to the material ball in a blueprint;
calculating the distance values between the world coordinates of the preset points and the world coordinates of all the pixel points on the boundary wall in the material ball;
and when the distance value between the world coordinate of any pixel point in the boundary wall and the world coordinate of the preset point is smaller than the maximum distance value, displaying the any pixel point in the boundary wall so as to display a circular area in the boundary wall.
2. The method for implementing the virtual intelligent boundary wall according to claim 1, wherein when a distance value between the world coordinate of any pixel point in the boundary wall and the world coordinate of the preset point is smaller than a given distance maximum value, displaying the any pixel point in the boundary wall comprises:
subtracting the distance value between the world coordinate of any pixel point in the boundary wall and the world coordinate of the preset point from the maximum value of the given distance to obtain a first difference value;
when the first difference is smaller than zero, any pixel point in the boundary wall is not displayed;
and when the first difference is larger than or equal to zero, displaying any pixel point in the boundary wall so as to display a circular area in the boundary wall.
3. The method as claimed in claim 2, wherein the circular region includes a plurality of pixels, and the smaller the difference between the preset points and the pixels among the plurality of pixels, the larger the brightness of the pixels.
4. A virtual intelligent boundary wall implementation method according to claim 2, wherein the circular area contains a plurality of pixel points, the method further comprising:
acquiring a second difference value between any pixel point in the circular area and the preset point;
dividing the second difference value by the given maximum distance value to obtain a quotient value;
and assigning the quotient value to the opacity of the material ball to obtain the brightness of any pixel point in the circular area.
5. The virtual intelligent boundary wall implementation method of claim 1, further comprising:
obtaining the shortest distance from the preset point to the boundary wall;
and when the shortest distance is smaller than the preset maximum flicker distance, starting the flicker of the boundary wall.
6. The method as claimed in claim 5, further comprising, after the flashing of the boundary wall is turned on:
starting a time node and a trigonometric function node of the material ball;
obtaining a time value through a time function of the time node;
obtaining a period coefficient of a trigonometric function of the trigonometric function node according to the time value, the maximum flicker distance and the shortest distance;
obtaining a flicker control value according to the trigonometric function and the periodic coefficient;
and controlling the flicker of the boundary wall according to the flicker control value.
7. The method as claimed in claim 6, wherein the obtaining the period coefficient of the trigonometric function node according to the time value, the maximum flicker distance and the shortest distance comprises:
obtaining a third difference value between the maximum flicker distance and the shortest distance;
calculating a ratio of the third difference to the shortest distance;
obtaining the product of the time value and the ratio, wherein the product of the time value and the ratio is the period coefficient;
the obtaining of the flicker control value according to the trigonometric function and the periodic coefficient includes:
and taking the product of a trigonometric function sine and the periodic coefficient as the flicker control value, wherein the trigonometric function is the trigonometric function sine.
8. An apparatus for implementing a virtual intelligent boundary wall in a UE4 engine, the apparatus comprising:
the acquisition module is used for acquiring the world coordinates of each pixel point of the boundary wall from the material ball of the boundary wall and transmitting the world coordinates of the preset points to the material ball in a blueprint;
the calculation module is used for calculating the distance values between the world coordinates of the preset points and the world coordinates of all the pixel points on the boundary wall in the material ball;
and the display module is used for displaying any pixel point in the boundary wall when the distance value between the world coordinate of any pixel point in the boundary wall and the world coordinate of the preset point is smaller than the maximum given distance value, so that a circular area is displayed in the boundary wall.
9. A computer device comprising a memory, a processor and an application program stored on the memory and executable on the processor, wherein the steps of the method of any one of claims 1 to 7 are implemented when the application program is executed by the processor.
10. A computer-readable storage medium, on which an application program is stored, which when executed by a processor implements the steps of the method of any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210129276.4A CN114570023A (en) | 2022-02-11 | 2022-02-11 | Method and device for realizing virtual intelligent boundary wall in UE4 engine |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210129276.4A CN114570023A (en) | 2022-02-11 | 2022-02-11 | Method and device for realizing virtual intelligent boundary wall in UE4 engine |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114570023A true CN114570023A (en) | 2022-06-03 |
Family
ID=81770501
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210129276.4A Pending CN114570023A (en) | 2022-02-11 | 2022-02-11 | Method and device for realizing virtual intelligent boundary wall in UE4 engine |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114570023A (en) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112121438A (en) * | 2020-09-29 | 2020-12-25 | 腾讯科技(深圳)有限公司 | Operation prompting method, device, terminal and storage medium |
US20210173471A1 (en) * | 2019-12-06 | 2021-06-10 | Facebook Technologies, Llc | Posture-based virtual space configurations |
CN113678191A (en) * | 2019-03-29 | 2021-11-19 | 索尼互动娱乐股份有限公司 | Boundary display control device, boundary display control method, and program |
CN113724364A (en) * | 2021-08-03 | 2021-11-30 | 深圳市瑞立视多媒体科技有限公司 | Setting method and device for realizing shielding by utilizing polygon and no rendering of body |
-
2022
- 2022-02-11 CN CN202210129276.4A patent/CN114570023A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113678191A (en) * | 2019-03-29 | 2021-11-19 | 索尼互动娱乐股份有限公司 | Boundary display control device, boundary display control method, and program |
US20210173471A1 (en) * | 2019-12-06 | 2021-06-10 | Facebook Technologies, Llc | Posture-based virtual space configurations |
CN112121438A (en) * | 2020-09-29 | 2020-12-25 | 腾讯科技(深圳)有限公司 | Operation prompting method, device, terminal and storage medium |
CN113724364A (en) * | 2021-08-03 | 2021-11-30 | 深圳市瑞立视多媒体科技有限公司 | Setting method and device for realizing shielding by utilizing polygon and no rendering of body |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US20190126151A1 (en) | Visual display method for compensating sound information, computer readable storage medium and electronic device | |
JP2021517002A (en) | Virtual resource processing methods and devices in the game scene | |
CN109529327B (en) | Target positioning method and device in virtual interaction scene and electronic equipment | |
US11880999B2 (en) | Personalized scene image processing method, apparatus and storage medium | |
CN111330272B (en) | Virtual object control method, device, terminal and storage medium | |
US12128309B2 (en) | Virtual object control method and apparatus, terminal, and storage medium | |
CN114570023A (en) | Method and device for realizing virtual intelligent boundary wall in UE4 engine | |
CN112206525B (en) | Information processing method and device for hand-twisting virtual article in UE4 engine | |
CN114445555A (en) | Shoe tree modeling adjustment method, device, equipment and storage medium | |
CN106951108B (en) | Virtual screen implementation method and device | |
US20240278122A1 (en) | Method and apparatus for constructing virtual scenario, and electronic device, medium and product | |
CN118172229A (en) | Image rendering method, device, electronic equipment and readable storage medium | |
CN112451967A (en) | Game interaction method and device based on 3D screen interaction and computer equipment | |
CN112473138B (en) | Game display control method and device, readable storage medium and electronic equipment | |
CN115888094A (en) | Game control method, device, terminal equipment and storage medium | |
CN115337642A (en) | Method, device, medium and electronic equipment for controlling virtual prop | |
CN113724364A (en) | Setting method and device for realizing shielding by utilizing polygon and no rendering of body | |
CN113701563B (en) | Method and device for real-time automatic target aiming of tank in UE4 | |
CN111930240A (en) | Motion video acquisition method and device based on AR interaction, electronic equipment and medium | |
CN106932797B (en) | A kind of target determines method, user equipment and device | |
CN112348965A (en) | Imaging method, imaging device, electronic equipment and readable storage medium | |
CN112206524B (en) | Information processing method and device for picking up virtual article in UE4 engine | |
CN113694520B (en) | Prop effect processing method and device, electronic equipment and storage medium | |
CN112973126B (en) | Control method and device for connecting interactive objects at two ends of rope and computer equipment | |
US11782705B2 (en) | Scene switching method, device and medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |