Image processing method, device, apparatus and storage medium
By generating line colliders, the problem of the inability to generate line-shaped colliders in game engines is solved, which improves the diversity of game development and user experience.
Patent Information
- Application Number
- CN202210325298.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-29
- Publication Date
- 2026-01-06
- Estimated Expiration
- 2042-03-29
AI Technical Summary
Existing game engines cannot generate line-shaped colliders, which limits the diversity of game development.
By generating line colliders based on the drawing trajectory triggered by the user in the scene screen, the line colliders are composed of multiple box colliders of a set shape, and their movement with the virtual colliders is controlled to detect collisions and generate corresponding results.
It enables the handling of linear colliders, increasing the diversity and fun of game development.
Smart Images

Figure CN114797106B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of image processing technology, and in particular to an image processing method, apparatus, device, and storage medium. Background Technology
[0002] Currently, in video games developed based on custom game engines, for virtual objects that may collide, the common method is to set a collider on each virtual object to detect whether a collision has occurred.
[0003] In existing games, most of the generated colliders are colliders with a certain shape, but it is impossible to generate colliders with line shapes, which limits the diversity of game development. Summary of the Invention
[0004] This disclosure provides an image processing method, apparatus, device, and storage medium to process linear colliders and improve the diversity of game development.
[0005] In a first aspect, embodiments of this disclosure provide an image processing method, including:
[0006] A line collider is generated based on the drawing trajectory triggered by the user on the screen corresponding to the current scene; wherein, the current scene includes multiple virtual colliders; the line collider is composed of multiple box colliders of a set shape;
[0007] Control the line collider and the first virtual collider in the current scene to move in a set manner;
[0008] Detect whether the line collider and / or the first virtual collider collides with the second virtual collider;
[0009] If a collision occurs, the first result is generated; if no collision occurs, the second result is generated.
[0010] Secondly, embodiments of this disclosure also provide an image processing apparatus, comprising:
[0011] The line collider generation module is used to generate line colliders based on the drawing trajectory triggered by the user on the screen corresponding to the current scene; wherein, the current scene includes multiple virtual colliders; the line collider is composed of multiple box colliders of a set shape;
[0012] The motion control module is used to control the line collider and the first virtual collider in the current scene to move in a set manner;
[0013] The collision detection module is used to detect whether the line collider and / or the first virtual collider object collides with the second virtual collider.
[0014] The result generation module generates a first result if a collision occurs, and a second result if no collision occurs.
[0015] Thirdly, embodiments of this disclosure also provide an electronic device, the electronic device comprising:
[0016] One or more processing devices;
[0017] Storage device for storing one or more programs;
[0018] When the one or more programs are executed by the one or more processing devices, the one or more processing devices implement the method for generating special effects videos as described in the embodiments of this disclosure.
[0019] Fourthly, embodiments of this disclosure also provide a computer-readable medium having a computer program stored thereon, which, when executed by a processing device, implements the method for generating special effects videos as described in embodiments of this disclosure.
[0020] This disclosure provides an image processing method, apparatus, device, and storage medium. It generates a line collider based on a drawing trajectory triggered by a user on the screen corresponding to the current scene; wherein the current scene includes multiple virtual colliders; the line collider is composed of multiple box colliders of predetermined shapes; the line collider and a first virtual collider in the current scene are controlled to move according to a predetermined method; whether the line collider and / or the first virtual collider collides with a second virtual collider is detected; if a collision occurs, a first result is generated; if no collision occurs, a second result is generated. The image processing method provided by this disclosure, which generates a line collider composed of multiple box colliders of predetermined shapes based on a user-triggered drawing trajectory, can realize the processing of line colliders and improve the diversity of game development. Attached Figure Description
[0021] Figure 1 This is a flowchart of an image processing method according to an embodiment of the present disclosure;
[0022] Figure 2 This is an example diagram of the generated line collider in an embodiment of this disclosure;
[0023] Figure 3 This is an example diagram of a scenario in an embodiment of this disclosure;
[0024] Figure 4 This is a schematic diagram of the structure of an image processing apparatus according to an embodiment of the present disclosure;
[0025] Figure 5 This is a schematic diagram of the structure of an electronic device according to an embodiment of this disclosure. Detailed Implementation
[0026] Embodiments of this disclosure will now be described in more detail with reference to the accompanying drawings. While some embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this disclosure. It should be understood that the accompanying drawings and embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of protection of this disclosure.
[0027] It should be understood that the steps described in the method embodiments of this disclosure may be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of this disclosure is not limited in this respect.
[0028] The term "comprising" and its variations as used herein are open-ended inclusions, meaning "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Definitions of other terms will be given in the description below.
[0029] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are used only to distinguish different devices, modules or units, and are not used to limit the order of functions performed by these devices, modules or units or their interdependencies.
[0030] It should be noted that the terms "a" and "a plurality of" used in this disclosure are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".
[0031] The names of messages or information exchanged between multiple devices in the embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
[0032] The solution in this embodiment can be applied to a game scenario. The game contains multiple levels, each level corresponding to a scene. In each scene, multiple virtual colliders are set. The virtual colliders can be static or dynamic. Virtual colliders can be fixed in a set position, while dynamic colliders can move in the scene of the current level according to a set method. During the movement, they can collide with other virtual colliders.
[0033] Figure 1This is a flowchart of an image processing method provided in Embodiment 1 of this disclosure. This embodiment is applicable to the processing of collisions between line collision objects. The method can be executed by an image processing device, which can consist of hardware and / or software, and is generally integrated into a device with image processing functionality. This device can be an electronic device such as a server, mobile terminal, or server cluster. Figure 1 As shown, the method specifically includes the following steps:
[0034] S110 generates a line collision body based on the drawing trajectory triggered by the user on the screen corresponding to the current scene.
[0035] The current scene includes multiple virtual colliders. The current scene can be the scene corresponding to one of the levels in the game. Line colliders are composed of multiple box colliders of defined shapes.
[0036] In this embodiment, when a user enters the current scene corresponding to a certain level of the game through an entertainment application (APP), the APP displays the task to be completed for the level through text information in the current scene. The user starts to draw lines by touching the screen according to the task prompts. After the user finishes drawing, a line collision body is generated based on the obtained drawing trajectory.
[0037] Optionally, the process of generating a line collider based on the drawing trajectory triggered by the user on the screen corresponding to the current scene can be as follows: when the drawing time reaches the end of the timer, a line collider is generated based on the drawing trajectory already completed by the user on the screen corresponding to the current scene; or, when it is detected that the user has stopped drawing, a line collider is generated based on the drawing trajectory already completed by the user on the screen corresponding to the current scene.
[0038] Stopping drawing can be detected by either removing the user's finger from the screen or stopping the finger at a certain position. Specifically, upon entering the current scene, a drawing countdown begins (e.g., 10 seconds). The user starts drawing lines by touching the screen. When the countdown ends or the user stops drawing, the completed drawing trajectory is acquired, and a line collider is generated based on the completed trajectory. In this embodiment, using a countdown for drawing and generating a line collider based on the user's completed drawing trajectory on the screen corresponding to the current scene improves the accuracy of the generated line collider.
[0039] Optionally, the method for generating a line collider based on the drawing trajectory triggered by the user on the screen corresponding to the current scene can be as follows: obtain the touch points of the user in every two adjacent frames during the drawing process, and use them as the first touch point and the second touch point; use the first touch point and the second touch point as two vertices of a set shape to generate a box collider of the set shape, and obtain multiple box colliders; and connect the multiple box colliders in series to obtain a line collider.
[0040] The shape can be set to a rectangle, with the first and second touch points serving as the two vertices on the rectangle's diagonal. Specifically, a rectangular collider is generated using the first and second touch points as the two vertices on the diagonal, and multiple rectangular colliders are chained together to form a line collider. For example, Figure 2 This is an example diagram of the generated line collision body in this embodiment. For example... Figure 2 As shown, touch points on the drawing trajectory are obtained, and adjacent touch points are used as the diagonal vertices of rectangles to generate rectangular colliders. Multiple rectangular colliders are connected in series to generate a line collider. In this embodiment, multiple rectangular colliders are connected in series to generate a line collider, so that the line collider can perform collision detection.
[0041] Optionally, the method of using the first touch point and the second touch point as two vertices of a set shape to generate a box collider of the set shape can be as follows: if the lateral distance between the first touch point and the second touch point is greater than a set proportion of the horizontal length of the screen, and / or the vertical distance between the first touch point and the second touch point is greater than a set proportion of the vertical length of the screen, then a touch point is inserted between the first touch point and the second touch point; a box collider of the set shape is generated based on the two adjacent touch points after the insertion point processing.
[0042] The set ratio can be set to any value between 0.03 and 0.05, for example, 0.04. In this embodiment, if the user draws on the screen quickly, the horizontal distance between the first touch point and the second touch point will be greater than the set ratio of the screen's horizontal length (width), and / or the vertical distance between the first touch point and the second touch point will be greater than the set ratio of the screen's vertical length (height).
[0043] The method for inserting a touch point between the first and second touch points can be as follows: the horizontal distance is calculated as a predetermined proportion of the screen's horizontal length, and the vertical distance is calculated as a predetermined proportion of the screen's vertical length. This ensures that the horizontal distance between two adjacent touch points after the insertion process is less than or equal to the predetermined proportion of the screen's horizontal length, and the vertical distance is less than or equal to the predetermined proportion of the screen's vertical length. In this embodiment, inserting a touch point between the first and second touch points ensures that the size of the produced rectangular collision body matches the lines.
[0044] Optionally, the method for inserting a touch point between the first touch point and the second touch point can be: obtaining the connection between the first touch point and the second touch point; or inserting at least one touch point on the connection using a set standard.
[0045] The set criteria are that the lateral distance between adjacent touch points is less than or equal to a set proportion of the screen's lateral length, and the vertical distance between adjacent touch points is less than or equal to a set proportion of the screen's vertical length. Specifically, the process of inserting at least one touch point along the connecting line can be as follows: First, calculate the diagonal length of a rectangle formed by a set proportion of the screen's lateral length as its width and a set proportion of the screen's vertical length as its height. Then, divide the connecting line between the first and second touch points using the diagonal length as the unit, thereby achieving the insertion of the touch point. In this embodiment, inserting a touch point along the connecting line between the first and second touch points ensures the smoothness of the generated line collision body.
[0046] Optionally, if the number of generated box colliders exceeds a set value (e.g., 200), then the generation of box colliders can be stopped. This can improve the performance of line colliders.
[0047] Optionally, the method for generating a line collider based on the drawing trajectory triggered by the user on the screen corresponding to the current scene can be as follows: if the drawing trajectory passes through a virtual collider in the current scene, then obtain the overlapping area between the drawing trajectory and the virtual collider; when generating a box collider of a set shape, skip the overlapping area.
[0048] In this embodiment, if the drawn trajectory passes through a virtual collider in the current scene, no box collider will be generated within that virtual collider. This prevents the generated collider from shaking violently during collisions, thus affecting the game's performance.
[0049] S120, the control line collider and the first virtual collider in the current scene move according to the set method.
[0050] The first virtual collider can be a dynamic collider in the current scene, generated by setting colliders on virtual objects. Virtual objects can be set based on the needs of the current scene, such as virtual rocks, virtual bombs, or virtual bullets. The setting method can be to establish a force field in the current scene, causing the line collider and the first virtual collider to move under the influence of this force field. For example, the established force field can be a gravity field, causing the line collider and the first virtual collider to undergo free fall motion.
[0051] S130, detect whether the line collider and / or the first virtual collider collide with the second virtual collider. If a collision occurs, execute S140; if no collision occurs, execute S150.
[0052] The second virtual collider can be a static or dynamic collider in the current scene, or it can be generated by setting a collider on a virtual avatar. Virtual avatars can be, for example, an anime character or an animal character.
[0053] Optionally, the second virtual collider can be generated by fusing the image with the second virtual collider to obtain a new second virtual collider.
[0054] The images can be static or dynamic. Static images can be obtained from a local database or a server database. Dynamic images can be recorded videos or images captured in real time. In this embodiment, when the user launches the entertainment app, the terminal device's camera is activated. The camera captures the current scene (e.g., the user's face) in real time, and the captured image is fused with a second virtual collider to obtain a new second virtual collider. In this embodiment, fusing the image with the second virtual collider can enhance the entertainment value.
[0055] In this embodiment, during the movement of the line collider and the first virtual collider, the line collider and / or the first virtual collider may collide with the second virtual collider before the line collider and the first virtual collider collide; or, the line collider and / or the first virtual collider may collide with the second virtual collider after the line collider and the first virtual collider collide.
[0056] Optionally, the method for detecting whether the line collider and / or the first virtual collider collides with the second virtual collider can be: detecting whether the line collider and / or the first virtual collider collides with the second virtual collider within a set time period.
[0057] In this embodiment, when the line collider and the first virtual collider begin to move, a countdown (e.g., 5 seconds) is started. The system then checks whether the line collider and / or the first virtual collider collide with the second virtual collider within the set time before the countdown ends. Using a countdown method enhances the fun.
[0058] Optionally, the process of detecting whether the line collider and / or the first virtual collider collide with the second virtual collider can be as follows: if the line collider and the first virtual collider collide, determine the first motion trajectory of the line collider after the collision and the second motion trajectory of the first virtual collider after the collision; control the line collider to continue moving according to the first motion trajectory, and control the first virtual collider to continue moving according to the second motion trajectory; detect whether the line collider and / or the first virtual collider collide with the second virtual collider after the continued movement.
[0059] In this embodiment, the method for determining the first motion trajectory of the line collider and the second motion trajectory of the first virtual collider after the collision can be as follows: after the line collider and the first virtual collider collide, force analysis is performed on the line collider and the first virtual collider using physical principles to obtain the motion states (including velocity, acceleration, position, etc.) of the line collider and the first virtual collider at each moment after the collision, thereby obtaining the first motion trajectory of the line collider and the second motion trajectory of the first virtual collider based on the motion states at each moment. In this embodiment, the method for detecting whether the line collider and / or the first virtual collider collide with the second virtual collider can use any existing collision detection method, and is not limited here. For example, Figure 3 This is an example diagram of a scenario in this embodiment. For example... Figure 3 As shown, the first virtual collider is a virtual stone, the line collider is generated based on the trajectory drawn by the user, and the second virtual collider is a virtual human body. The line collider and the first virtual collider both undergo free fall motion, colliding during their movement. In this embodiment, determining the first motion trajectory of the line collider after the collision and the second motion trajectory of the first virtual collider after the collision can improve the accuracy of collision detection.
[0060] S140, generate the first result.
[0061] The first result could be "Challenge Failed". In this embodiment, if the line collider and / or the first virtual collider collides with the second virtual collider, it indicates that the line collider drawn by the user has not completed the challenge task, and the result "Challenge Failed" is generated.
[0062] Optionally, after generating the first result, the following steps are also included: popping up a selection window to return to the current scene, allowing the user to choose to return to the current scene.
[0063] In this embodiment, when the challenge fails, the user can choose to return to the current scene and continue the challenge.
[0064] S150, generate the second result.
[0065] The second result can be "Challenge Successful". In this embodiment, if the line collider and / or the first virtual collider does not collide with the second virtual collider, it indicates that the line collider drawn by the user has completed the challenge task, and the result "Challenge Successful" is generated.
[0066] Optionally, after generating the second result, the following steps are also included: popping up a selection window to jump to the next scene, allowing the user to choose to jump to the next scene.
[0067] In this embodiment, after "challenge successful", the user can choose to challenge the next scenario.
[0068] The technical solution of this embodiment generates a line collider based on the drawing trajectory triggered by the user on the screen corresponding to the current scene. The current scene includes multiple virtual colliders; the line collider is composed of multiple box colliders of predetermined shapes; the line collider and a first virtual collider in the current scene are controlled to move according to a predetermined method; whether the line collider and / or the first virtual collider collides with a second virtual collider is detected; if a collision occurs, a first result is generated; if no collision occurs, a second result is generated. The image processing method provided in this embodiment generates a line collider composed of multiple box colliders of predetermined shapes based on the user-triggered drawing trajectory, enabling the processing of line colliders and improving the diversity of game development.
[0069] Figure 4 This is a schematic diagram of the structure of an image processing apparatus disclosed in an embodiment of this disclosure, as shown below. Figure 4 As shown, the device includes:
[0070] The line collider generation module 410 is used to generate line colliders based on the drawing trajectory triggered by the user on the screen corresponding to the current scene; wherein, the current scene includes multiple virtual colliders; the line collider is composed of multiple box colliders of a set shape;
[0071] The motion control module 420 is used to control the line collider and the first virtual collider in the current scene to move in a set manner.
[0072] The collision detection module 430 is used to detect whether the line collider and / or the first virtual collider object collides with the second virtual collider.
[0073] The result generation module 440 is used to generate a first result if a collision occurs, and a second result if no collision occurs.
[0074] Optionally, it also includes: a second virtual collider generation module, used for:
[0075] The image is fused with the second virtual collider to obtain a new second virtual collider; wherein the image is a static image or a dynamic image.
[0076] Optionally, the line collider generation module 410 is also used for:
[0077] When the drawing timer expires, a line collision body is generated based on the drawing trajectory completed by the user on the screen corresponding to the current scene; or...
[0078] When the user stops drawing, a line collision body is generated based on the drawing trajectory that the user has completed on the screen corresponding to the current scene.
[0079] Optionally, the line collider generation module 410 is also used for:
[0080] Obtain the touch points of the user in every two adjacent frames during the drawing process, and use them as the first touch point and the second touch point;
[0081] The first and second touch points are used as two vertices of a set shape to generate a box collider of the set shape, thus obtaining multiple box colliders.
[0082] Multiple box colliders are connected in series to obtain a line collider.
[0083] Optionally, the line collider generation module 410 is also used for:
[0084] If the horizontal distance between the first touch point and the second touch point is greater than a set ratio of the horizontal length of the screen, and / or the vertical distance between the first touch point and the second touch point is greater than a set ratio of the vertical length of the screen, then a touch point is inserted between the first touch point and the second touch point.
[0085] A box collision body of a set shape is generated based on two adjacent touch points after interpolation processing.
[0086] Optionally, the line collider generation module 410 is also used for:
[0087] Obtain the connection between the first touch point and the second touch point;
[0088] At least one touch point is inserted on the connection line according to the set standard; wherein, the set standard is that the horizontal distance between adjacent touch points is less than or equal to a set ratio of the horizontal length of the screen and the vertical distance between adjacent touch points is less than or equal to a set ratio of the vertical length of the screen.
[0089] Optionally, the line collider generation module 410 is also used for:
[0090] If the drawn trajectory passes through a virtual collider in the current scene, then obtain the overlapping area between the drawn trajectory and the virtual collider;
[0091] When generating a box collider of a given shape, skip overlapping areas.
[0092] Optionally, the collision detection module 430 is also used for:
[0093] If the line collider collides with the first virtual collider, determine the first motion trajectory of the line collider after the collision and the second motion trajectory of the first virtual collider after the collision.
[0094] The control line collider continues to move according to the first motion trajectory, and the control first virtual collider continues to move according to the second motion trajectory;
[0095] Detect whether the line collider and / or the first virtual collider collide with the second virtual collider after the motion continues.
[0096] Optionally, the collision detection module 430 is also used for:
[0097] Detect whether the detection line collider and / or the first virtual collider object collide with the second virtual collider within a set time period.
[0098] Optionally, it also includes: a selection window pop-up module, used for:
[0099] After generating the first result, a pop-up window appears to allow the user to choose to return to the current scene.
[0100] After the second result is generated, a pop-up window appears to allow the user to select the next scene.
[0101] The above-described apparatus can execute the methods provided in all the foregoing embodiments of this disclosure, and has the corresponding functional modules and beneficial effects for executing the above methods. Technical details not described in detail in this embodiment can be found in the methods provided in all the foregoing embodiments of this disclosure.
[0102] The following is for reference. Figure 5 The diagram illustrates a structural schematic of an electronic device 300 suitable for implementing embodiments of the present disclosure. The electronic devices in the embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs, desktop computers, or various forms of servers, such as standalone servers or server clusters. Figure 5 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.
[0103] like Figure 5As shown, the electronic device 300 may include a processing unit (e.g., a central processing unit, a graphics processor, etc.) 301, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 302 or a program loaded from a memory device 305 into a random access memory (RAM) 303. The RAM 303 also stores various programs and data required for the operation of the electronic device 300. The processing unit 301, ROM 302, and RAM 303 are interconnected via a bus 304. An input / output (I / O) interface 305 is also connected to the bus 304.
[0104] Typically, the following devices can be connected to I / O interface 305: input devices 306 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 307 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 308 including, for example, magnetic tapes, hard disks, etc.; and communication devices 309. Communication device 309 allows electronic device 300 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 5 An electronic device 300 with various devices is shown; however, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively.
[0105] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing a method of word recommendation. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 309, or installed from a storage device 305, or installed from a ROM 302. When the computer program is executed by a processing device 301, it performs the functions defined above in the methods of embodiments of this disclosure.
[0106] It should be noted that the computer-readable medium described in this disclosure can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in connection with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.
[0107] In some implementations, clients and servers can communicate using any currently known or future-developed network protocol such as HTTP (Hypertext Transfer Protocol) and can interconnect with digital data communication (e.g., communication networks) of any form or medium. Examples of communication networks include local area networks (“LANs”), wide area networks (“WANs”), the Internet (e.g., the Internet of Things), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future-developed networks.
[0108] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device.
[0109] The aforementioned computer-readable medium carries one or more programs that, when executed by the electronic device, cause the electronic device to: generate a line collider based on a drawing trajectory triggered by the user on the screen corresponding to the current scene; wherein the current scene includes multiple virtual colliders; the line collider is composed of multiple box colliders of a predetermined shape; control the line collider and a first virtual collider in the current scene to move in a predetermined manner; detect whether the line collider and / or the first virtual collider collides with a second virtual collider; if a collision occurs, generate a first result; if no collision occurs, generate a second result.
[0110] Computer program code for performing the operations of this disclosure can be written in one or more programming languages or a combination thereof, including but not limited to object-oriented programming languages such as Java, Smalltalk, and C++, as well as conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0111] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0112] The units described in the embodiments of this disclosure can be implemented in software or hardware. The names of the units are not, in some cases, intended to limit the specific unit.
[0113] The functions described above in this document can be performed, at least in part, by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: Field Programmable Gate Arrays (FPGAs), Application-Specific Integrated Circuits (ASICs), Application Standard Products (ASSPs), System-on-Chip (SoCs), Complex Programmable Logic Devices (CPLDs), and so on.
[0114] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0115] According to one or more embodiments of the present disclosure, an image processing method is disclosed, including:
[0116] A line collider is generated based on the drawing trajectory triggered by the user on the screen corresponding to the current scene; wherein, the current scene includes multiple virtual colliders; the line collider is composed of multiple box colliders of a set shape;
[0117] Control the line collider and the first virtual collider in the current scene to move in a set manner;
[0118] Detect whether the line collider and / or the first virtual collider collides with the second virtual collider;
[0119] If a collision occurs, the first result is generated; if no collision occurs, the second result is generated.
[0120] Furthermore, before generating the line collider based on the sliding trajectory triggered by the user on the screen corresponding to the current scene, it also includes:
[0121] The image is fused with the second virtual collider to obtain a new second virtual collider; wherein the image is a static image or a dynamic image.
[0122] Furthermore, a line collision body is generated based on the drawing trajectory triggered by the user on the screen corresponding to the current scene, including:
[0123] When the drawing time reaches the end of the timer, generate a line collision body based on the drawing trajectory already completed by the user on the screen corresponding to the current scene; or...
[0124] When the user stops drawing, a line collision body is generated based on the drawing trajectory that the user has completed on the screen corresponding to the current scene.
[0125] Furthermore, a line collision body is generated based on the drawing trajectory triggered by the user on the screen corresponding to the current scene, including:
[0126] Obtain the touch points of the user in every two adjacent frames during the drawing process, and use them as the first touch point and the second touch point;
[0127] Using the first touch point and the second touch point as two vertices of the set shape, a box collider of the set shape is generated to obtain multiple box colliders;
[0128] By connecting the multiple box colliders in series, a line collider is obtained.
[0129] Further, using the first touch point and the second touch point as two vertices of the defined shape to generate a box collider of the defined shape includes:
[0130] If the horizontal distance between the first touch point and the second touch point is greater than a set ratio of the horizontal length of the screen, and / or the vertical distance between the first touch point and the second touch point is greater than a set ratio of the vertical length of the screen, then a touch point is inserted between the first touch point and the second touch point.
[0131] A box collision body of the set shape is generated based on two adjacent touch points after interpolation processing.
[0132] Furthermore, inserting a touch point between the first touch point and the second touch point includes:
[0133] Obtain the connection between the first touch point and the second touch point;
[0134] At least one touch point is inserted on the connection line according to a set standard; wherein, the set standard is that the horizontal distance between adjacent touch points is less than or equal to a set ratio of the horizontal length of the screen and the vertical distance between adjacent touch points is less than or equal to a set ratio of the vertical length of the screen.
[0135] Furthermore, a line collision body is generated based on the drawing trajectory triggered by the user on the screen corresponding to the current scene, including:
[0136] If the drawing trajectory passes through a virtual collider in the current scene, then the overlapping area between the drawing trajectory and the virtual collider is obtained;
[0137] When generating a box collider of the specified shape, skip the overlapping region.
[0138] Further, detecting whether the line collider and / or the first virtual collider object collides with the second virtual collider includes:
[0139] If the line collider collides with the first virtual collider, determine the first motion trajectory of the line collider after the collision and the second motion trajectory of the first virtual collider after the collision.
[0140] The line collider is controlled to continue moving according to the first motion trajectory, and the first virtual collider is controlled to continue moving according to the second motion trajectory.
[0141] The detection process checks whether the line collider and / or the first virtual collider collide with the second virtual collider after the motion continues.
[0142] Further, detecting whether the line collider and / or the first virtual collider object collides with the second virtual collider includes:
[0143] Detect whether the line collider and / or the first virtual collider object collide with the second virtual collider within a set time period.
[0144] Furthermore, after generating the first result, it also includes:
[0145] A pop-up window appears, allowing the user to choose to return to the current scene.
[0146] After generating the second result, the following is also included:
[0147] A pop-up window appears to allow the user to select which scene to jump to.
[0148] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this disclosure can be achieved, and this is not limited herein.
[0149] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.
Claims
1. An image processing method, characterized by, The method comprises the following steps: According to the drawing trajectory triggered by the user in the screen corresponding to the current scene, the touch screen points of the user in each adjacent two frames during the drawing process are obtained as the first touch screen point and the second touch screen point; The first touch screen point and the second touch screen point are taken as two vertices on the diagonal of the rectangle to generate a rectangular box collision body, and a plurality of box collision bodies are obtained; The plurality of box collision bodies are connected in series to obtain a line collision body; wherein the current scene includes a plurality of virtual collision bodies; the line collision body is composed of a plurality of box collision bodies with a set shape; Control the line collision body and the first virtual collision body in the current scene to move in a set manner; wherein the first virtual collision body is a dynamic collision body of the current scene; Detect whether the line collision body and / or the first virtual collision body collide with the second virtual collision body; If a collision occurs, a first result is generated, and if no collision occurs, a second result is generated.
2. The method of claim 1, wherein, Before generating a line collision body according to the sliding trajectory triggered by the user in the screen corresponding to the current scene, the method further comprises the following steps: Fuse the image with the second virtual collision body to obtain a new second virtual collision body; wherein the image is a static image or a dynamic image.
3. The method of claim 1, wherein, Generating a line collision body according to the drawing trajectory triggered by the user in the screen corresponding to the current scene comprises: When the drawing time reaches the end time, generate a line collision body according to the completed drawing trajectory of the user in the screen corresponding to the current scene; or When it is detected that the user stops drawing, a line collision body is generated according to the completed drawing trajectory of the user in the screen corresponding to the current scene.
4. The method of claim 1, wherein, Taking the first touch screen point and the second touch screen point as two vertices of the set shape to generate a box collision body of the set shape comprises: If the horizontal distance between the first touch screen point and the second touch screen point is greater than a set proportion of the horizontal length of the screen, and / or the vertical distance between the first touch screen point and the second touch screen point is greater than a set proportion of the vertical length of the screen, then insert a touch screen point between the first touch screen point and the second touch screen point; Generate a box collision body of the set shape based on the adjacent two touch screen points after the insertion point processing.
5. The method of claim 4, wherein, Inserting a touch screen point between the first touch screen point and the second touch screen point comprises: Obtain the connecting line between the first touch screen point and the second touch screen point; Insert at least one touch screen point on the connecting line using a set standard; wherein the set standard is that the horizontal distance between adjacent touch screen points is less than or equal to a set proportion of the horizontal length of the screen and the vertical distance between adjacent touch screen points is less than or equal to a set proportion of the vertical length of the screen.
6. The method of claim 1, wherein, Generating a line collision body according to the drawing trajectory triggered by the user in the screen corresponding to the current scene comprises: If the drawing trajectory passes through a virtual collision body in the current scene, obtain the overlapping area of the drawing trajectory and the virtual collision body; When generating the box collision body of the set shape, skip the overlapping area.
7. The method of claim 1, wherein, Detecting whether the line collision body and / or the first virtual collision body collide with the second virtual collision body comprises: If the line collision body and the first virtual collision body collide, a first motion trajectory of the line collision body after collision and a second motion trajectory of the first virtual collision body after collision are determined; The line collision body is controlled to continue moving according to the first motion trajectory, and the first virtual collision body is controlled to continue moving according to the second motion trajectory; Whether the line collision body and / or the first virtual collision body collides with a second virtual collision body after continuing to move is detected.
8. The method of claim 1, wherein, The detection of whether the line collision body and / or the first virtual collision body collides with a second virtual collision body includes: Whether the line collision body and / or the first virtual collision body collides with a second virtual collision body within a set time length is detected.
9. The method of claim 8, wherein, After the first result is generated, the method further includes: A selection window for returning to the current scene is popped up for a user to select to return to the current scene; After the second result is generated, the method further includes: A selection window for jumping to a next scene is popped up for a user to select to jump to the next scene.
10. An image processing apparatus characterized by comprising: The method includes: A line collision body generation module is configured to obtain, as a first touch point and a second touch point, touch points of each two adjacent frames in a drawing process of a user according to a drawing trajectory triggered by the user in a screen corresponding to a current scene, and generate a box collision body of a rectangle by taking the first touch point and the second touch point as two vertices on diagonal lines of the rectangle, to obtain a plurality of box collision bodies; The plurality of box collision bodies are connected in series to obtain a line collision body; the current scene includes a plurality of virtual collision bodies; and the line collision body is composed of a plurality of box collision bodies with set shapes; A motion control module is configured to control the line collision body and a first virtual collision body in the current scene to move according to a set manner; the first virtual collision body is a dynamic collision body of the current scene; A collision detection module is configured to detect whether the line collision body and / or the first virtual collision body collides with a second virtual collision body; A result generation module is configured to generate a first result if a collision occurs, and generate a second result if no collision occurs.
11. An electronic device, comprising: The electronic device includes: One or more processing devices; A storage device configured to store one or more programs; When the one or more programs are executed by the one or more processing devices, the one or more processing devices implement the image processing method according to any one of claims 1-9.
12. A computer readable medium having stored thereon a computer program, characterized in that The program is executed by the processing device to implement the image processing method according to any one of claims 1-9.
Citation Information
Patent Citations
Collision body interaction control method and device, electronic equipment and storage medium
CN109857259A
Prop control method and device, electronic equipment and storage medium
CN112587927A
Streaming media generation method and device based on virtual character
CN113240782A