Data processing method and device, electronic equipment and storage medium
By constructing the falling trajectory of objects in segments and using second-order Bezier curves and geometric arrangements of collision objects, the problem of high computational complexity in interactive games is solved, computing resource consumption is optimized, and device performance and simulation rendering effects are improved.
Patent Information
- Application Number
- CN202310029447.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-01-09
- Publication Date
- 2025-10-10
- Estimated Expiration
- 2043-01-09
AI Technical Summary
In the existing technology, the falling process of objects in interactive games requires the use of Bezier curves of fourth order or higher, which leads to high computational complexity, consumes a large amount of computing resources, and affects device performance.
By responding to the execution instructions of the preset interactive business, the starting and target falling positions of the object in the preset area are determined, the falling trajectory of the object is constructed in segments, and the second-order Bezier curve is used for splicing. Combined with the geometric arrangement of the collision objects, the falling process is optimized.
This reduces the computational complexity of trajectory construction, reduces computing resource consumption, improves device performance, and enables smooth object falling and pushing simulation rendering.
Smart Images

Figure CN116126532B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the technical field of computer, and particularly relates to a data processing method and device, electronic equipment and storage medium. BACKGROUND
[0002] With the development of computer technology, various offline interactive games have gradually realized online simulation.
[0003] In the related art, the simulation process of interactive games such as push ball machines needs to simulate object falling and object pushing. The object falling process often combines a Bezier curve to construct a falling trajectory. However, a smooth continuous curve often needs to use a Bezier curve of more than four orders. The calculation complexity in the construction process of a Bezier curve of more than two orders is high, which leads to consumption of a large amount of computing resources, and further causes problems such as device performance degradation. SUMMARY
[0004] The present disclosure provides a data processing method and device, electronic equipment and storage medium to at least solve the technical problems of high calculation complexity, large consumption of computing resources and device performance degradation in the related art. The technical solutions of the present disclosure are as follows.
[0005] According to a first aspect of an embodiment of the present disclosure, a data processing method is provided, comprising:
[0006] In response to an execution instruction of a preset interactive service, a starting falling position of a first object in a first preset area and a target falling position type corresponding to the first object are determined. The first preset area is an object falling rendering area in an interactive page corresponding to the preset interactive service.
[0007] According to the starting falling position and the target falling position type, a target falling position and at least one intermediate falling position of the first object in the first preset area are determined.
[0008] Based on the at least one intermediate falling position, an object falling trajectory between the starting falling position and the target falling position is constructed in segments.
[0009] Based on the object falling trajectory, a falling process of the first object from the starting falling position to the target falling position in the first preset area is rendered.
[0010] In the case where the first object falls to the target falling position, a pushing process of a second object corresponding to the target falling position type in a second preset area in the interactive page is rendered.
[0011] In an optional embodiment, constructing the object falling trajectory from the starting falling position to the target falling position in segments based on the at least one intermediate falling position includes:
[0012] Determining a plurality of path node pairs from the starting drop position, the target drop position, and the at least one intermediate drop position, wherein any path node pair is a node pair having any two adjacent positions among the starting drop position, the target drop position, and the at least one intermediate drop position as path nodes;
[0013] Determining a control node corresponding to any path node pair based on a relative positional relationship between two path nodes in any path node pair;
[0014] generating a second-order Bezier curve corresponding to any path node pair according to the any path node pair and the control node corresponding to the any path node pair;
[0015] The second-order Bezier curves corresponding to the multiple path node pairs are spliced to obtain the falling trajectory of the object.
[0016] In an optional embodiment, the first preset area includes multiple rows of preset collision objects and multiple rows of drop-off openings corresponding to the multiple rows of preset collision objects, there is a drop-off opening between two adjacent preset collision objects in each row of preset collision objects, and the multiple rows of drop-off openings are geometrically arranged with any drop-off opening in the top row of drop-off openings as the position of the first row element of the Pascal's triangle; the first object moves horizontally above a target row in the first preset area, and the target row is the row where the top row of drop-off openings is located; and determining the starting drop position of the first object in the first preset area includes:
[0017] determining a current location of the first object when the execution instruction is triggered;
[0018] The position in the target row directly below the current position is used as the starting falling position.
[0019] In an optional embodiment, the first preset area includes multiple rows of preset collision objects and multiple rows of drop openings corresponding to the multiple rows of preset collision objects, there is a drop opening between two adjacent preset collision objects in each row of preset collision objects, the multiple rows of drop openings are a geometric arrangement with any drop opening in the top row of drop openings as the position of the first row element of the Pascal's triangle; the position of the drop opening in the bottom row of the multiple rows of drop openings is a plurality of preset drop positions, the multiple preset drop positions correspond to at least one preset drop position type, each preset drop position corresponds to one of the at least one preset drop position type, and the at least one preset drop position type includes the target drop position type;
[0020] The determining, based on the starting falling position and the target falling position type, the target falling position and at least one intermediate falling position corresponding to the first object from the first preset area includes:
[0021] Determine a starting drop opening from the top row of drop openings according to the starting drop position;
[0022] Under the collision constraints of the multiple rows of preset collision objects, based on the starting drop port, determining a target drop port corresponding to the target drop location type from the bottom row of drop ports, and determining at least one intermediate drop port from the intermediate rows of drop ports, the intermediate row of drop ports being at least one row of drop ports located between the top row of drop ports and the bottom row of drop ports among the multiple rows of drop ports;
[0023] Taking the initial drop position as a starting point, based on the shortest path constraint, determining a target collision point corresponding to each path drop-out from preset collision objects corresponding to each path drop-out, wherein each path drop-out is each drop-out between the target drop-out and the at least one intermediate drop-out; and the preset collision object corresponding to each path drop-out is a preset collision object adjacent to each path drop-out;
[0024] The target collision point corresponding to the target drop opening is used as the target drop position;
[0025] The position of the target collision point corresponding to the at least one intermediate drop opening is used as the at least one intermediate drop position.
[0026] In an optional embodiment, the rendering, in the first preset area, of the falling process of the first object from the starting falling position to the target falling position based on the falling trajectory of the object includes:
[0027] Obtaining a preset falling speed corresponding to the first object and a first preset friction force during the falling process of the first object;
[0028] Correcting the preset falling speed based on the first preset friction force to obtain a target falling speed of the first object during its falling process;
[0029] The falling process is rendered in the first preset area based on the falling trajectory of the object and the target falling speed.
[0030] In an optional embodiment, the second preset area is a isosceles trapezoidal object pushing area, the second object includes at least one object, and the pushing process of the second object corresponding to the target falling position type rendered in the second preset area in the interactive page in the case that the first object falls to the target falling position includes:
[0031] In the case that the first object falls to the target falling position, the starting area in the second preset area renders the at least one object, the second preset area in which the at least one object is displayed is controlled to move to a target pushing position, and in the process that the second preset area moves to the target pushing position, a preset extrusion force is exerted on the starting object displayed in the second preset area based on a preset air wall rigid body, so that the object in the second preset area moves.
[0032] In the case that the first object falls to the target falling position, the starting area in the second preset area renders the at least one object, the second preset area in which the at least one object is displayed is controlled to move to a target pushing position, and in the process that the second preset area moves to the target pushing position, a preset extrusion force is exerted on the starting object displayed in the second preset area based on a preset air wall rigid body, so that the object in the second preset area moves.
[0033] In an optional embodiment, the at least one object is a circular object, and the number of the at least one object is less than or equal to a preset threshold; and the pushing process of the second object corresponding to the target falling position type rendered in the second preset area in the interactive page in the case that the first object falls to the target falling position further includes:
[0034] In the process that the second preset area moves to the target pushing position, a collision edge corresponding to each object in the first preset area is generated.
[0035] Based on the collision edge corresponding to each object, a target collision object existing in the first preset area is determined.
[0036] A second preset friction force is exerted on the target collision object to correct the speed of the target collision object in the process that the second preset area moves.
[0037] In an optional embodiment, the method further includes:
[0038] In the case that the center of gravity position of any object in the second preset area crosses the target pushing edge of the first preset area, a target falling object is rendered to fall from the first preset area based on preset animation parameters.
[0039] In the case that the center of gravity position of any object in the second preset area crosses the target pushing edge of the first preset area, a target falling object is rendered to fall from the first preset area based on preset animation parameters.
[0040] In an optional embodiment, the method is applied to a terminal, and the terminal is provided with a rendering engine and a physical engine.
[0041] The rendering engine is configured to execute the steps of determining the starting falling position of the first object in the first preset area and the target falling position type corresponding to the first object, and rendering the falling process of the first object from the starting falling position to the target falling position in the first preset area based on the falling trajectory of the object;
[0042] The physics engine is configured to execute the step of rendering a second object corresponding to the target drop location type in a second preset area of the interactive page when the first object falls to the target drop location. In response to an execution instruction of a preset interactive service, the physics engine determines the starting drop location of the first object in the first preset area and the target drop location type corresponding to the first object; the first preset area is the object drop rendering area in the interactive page corresponding to the preset interactive service;
[0043] determining a target falling position and at least one intermediate falling position of the first object in the first preset area according to the starting falling position and the target falling position type;
[0044] Based on the at least one intermediate falling position, constructing a falling trajectory of the object from the starting falling position to the target falling position in segments;
[0045] Based on the falling trajectory of the object, rendering in the first preset area a falling process of the first object from the starting falling position to the target falling position;
[0046] In the case where the first object falls to the target falling position, a second preset area in the interactive page renders a pushing process of a second object corresponding to the target falling position type.
[0047] In an optional embodiment, constructing the object falling trajectory from the starting falling position to the target falling position in segments based on the at least one intermediate falling position includes:
[0048] Determining a plurality of path node pairs from the starting drop position, the target drop position, and the at least one intermediate drop position, wherein any path node pair is a node pair having any two adjacent positions among the starting drop position, the target drop position, and the at least one intermediate drop position as path nodes;
[0049] Determining a control node corresponding to any path node pair based on a relative positional relationship between two path nodes in any path node pair;
[0050] generating a second-order Bezier curve corresponding to any path node pair according to the any path node pair and the control node corresponding to the any path node pair;
[0051] The second-order Bezier curves corresponding to the multiple path node pairs are spliced to obtain the falling trajectory of the object.
[0052] In an optional embodiment, the first preset area includes multiple rows of preset collision objects and multiple rows of drop-off openings corresponding to the multiple rows of preset collision objects, there is a drop-off opening between two adjacent preset collision objects in each row of preset collision objects, and the multiple rows of drop-off openings are geometrically arranged with any drop-off opening in the top row of drop-off openings as the position of the first row element of the Pascal's triangle; the first object moves horizontally above a target row in the first preset area, and the target row is the row where the top row of drop-off openings is located; and determining the starting drop position of the first object in the first preset area includes:
[0053] determining a current location of the first object when the execution instruction is triggered;
[0054] The position in the target row directly below the current position is used as the starting falling position.
[0055] In an optional embodiment, the first preset area includes multiple rows of preset collision objects and multiple rows of drop openings corresponding to the multiple rows of preset collision objects, there is a drop opening between two adjacent preset collision objects in each row of preset collision objects, the multiple rows of drop openings are a geometric arrangement with any drop opening in the top row of drop openings as the position of the first row element of the Pascal's triangle; the position of the drop opening in the bottom row of the multiple rows of drop openings is a plurality of preset drop positions, the multiple preset drop positions correspond to at least one preset drop position type, each preset drop position corresponds to one of the at least one preset drop position type, and the at least one preset drop position type includes the target drop position type;
[0056] The determining, based on the starting falling position and the target falling position type, the target falling position and at least one intermediate falling position corresponding to the first object from the first preset area includes:
[0057] Determine a starting drop opening from the top row of drop openings according to the starting drop position;
[0058] Under the collision constraints of the multiple rows of preset collision objects, based on the starting drop port, determining a target drop port corresponding to the target drop location type from the bottom row of drop ports, and determining at least one intermediate drop port from the intermediate rows of drop ports, the intermediate row of drop ports being at least one row of drop ports located between the top row of drop ports and the bottom row of drop ports among the multiple rows of drop ports;
[0059] Taking the initial drop position as a starting point, based on the shortest path constraint, determining a target collision point corresponding to each path drop-out from preset collision objects corresponding to each path drop-out, wherein each path drop-out is each drop-out between the target drop-out and the at least one intermediate drop-out; and the preset collision object corresponding to each path drop-out is a preset collision object adjacent to each path drop-out;
[0060] The target collision point corresponding to the target drop opening is used as the target drop position;
[0061] The position of the target collision point corresponding to the at least one intermediate drop opening is used as the at least one intermediate drop position.
[0062] In an optional embodiment, the rendering, in the first preset area, of the falling process of the first object from the starting falling position to the target falling position based on the falling trajectory of the object includes:
[0063] Obtaining a preset falling speed corresponding to the first object and a first preset friction force during the falling process of the first object;
[0064] Correcting the preset falling speed based on the first preset friction force to obtain a target falling speed of the first object during its falling process;
[0065] The falling process is rendered in the first preset area based on the falling trajectory of the object and the target falling speed.
[0066] In an optional embodiment, the second preset area is an isosceles trapezoidal object pushing area, the second object includes at least one object, and when the first object falls to the target falling position, the pushing process of rendering the second object corresponding to the target falling position type in the second preset area on the interactive page includes:
[0067] When the first object falls to the target falling position, rendering the at least one object in a starting area of the second preset area, controlling the second preset area displaying the at least one object to move toward the target pushing position, and applying a preset squeezing force to the starting object displayed in the second preset area based on a preset air wall rigid body during the movement of the second preset area toward the target pushing position, so as to move the object in the second preset area;
[0068] The starting object is an object located in the starting area.
[0069] In an optional embodiment, the at least one object is a circular object, and the number of the at least one object is less than or equal to a preset threshold; when the first object falls to the target falling location, the pushing process of rendering a second object corresponding to the target falling location type in a second preset area on the interactive page further includes:
[0070] During the movement of the second preset area toward the target push position, generating a collision edge corresponding to each object in the first preset area;
[0071] Determining a target collision object in the first preset area based on a collision edge corresponding to each object;
[0072] A second preset friction force is applied to the target collision object to correct the speed of the target collision object during movement in the second preset area.
[0073] In an optional embodiment, the method further includes:
[0074] When the center of gravity of any object in the second preset area exceeds the target pushing edge of the first preset area, rendering an animation of the target falling object falling from the first preset area based on preset animation parameters;
[0075] The target falling object is an object in the second preset area whose corresponding center of gravity position exceeds the target pushing edge of the second preset area.
[0076] In an optional embodiment, the method is applied to a terminal, and the terminal is provided with a rendering engine and a physics engine;
[0077] The rendering engine is configured to execute the steps of determining the starting falling position of the first object in the first preset area and the target falling position type corresponding to the first object, and rendering the falling process of the first object from the starting falling position to the target falling position in the first preset area based on the falling trajectory of the object;
[0078] The physics engine is used to execute the step of rendering a push process of a second object corresponding to the target falling position type in a second preset area of the interactive page when the first object falls to the target falling position.
[0079] According to a second aspect of an embodiment of the present disclosure, there is provided a data processing apparatus, including:
[0080] a data determination module configured to execute an execution instruction in response to a preset interactive service, and determine a starting drop position of a first object and a target drop position type corresponding to the first object within a first preset area; the first preset area being an object drop rendering area in an interactive page corresponding to the preset interactive service;
[0081] a drop position determining module, configured to determine a target drop position and at least one intermediate drop position of the first object in the first preset area according to the starting drop position and the target drop position type;
[0082] an object falling trajectory construction module, configured to construct the object falling trajectory from the starting falling position to the target falling position in segments based on the at least one intermediate falling position;
[0083] a falling process rendering module, configured to render, in the first preset area, a falling process of the first object falling from the starting falling position to the target falling position based on the falling trajectory of the object;
[0084] The push process rendering module is configured to execute a push process of rendering a second object corresponding to the target falling location type in a second preset area of the interactive page when the first object falls to the target falling location.
[0085] In an optional embodiment, the object falling trajectory construction module includes:
[0086] a path node pair determining unit configured to determine a plurality of path node pairs from the starting drop position, the target drop position, and the at least one intermediate drop position, wherein any path node pair is a node pair having any two adjacent positions among the starting drop position, the target drop position, and the at least one intermediate drop position as path nodes;
[0087] a control node determining unit configured to determine a control node corresponding to any path node pair based on a relative position relationship between two path nodes in any path node pair;
[0088] A second-order Bezier curve generating unit is configured to generate a second-order Bezier curve corresponding to any path node pair according to the any path node pair and the control node corresponding to the any path node pair;
[0089] The curve splicing unit is configured to perform splicing processing on the second-order Bezier curves corresponding to the multiple path node pairs to obtain the falling trajectory of the object.
[0090] In an optional embodiment, the first preset area includes multiple rows of preset collision objects and multiple rows of drop-off openings corresponding to the multiple rows of preset collision objects, there is a drop-off opening between two adjacent preset collision objects in each row of preset collision objects, and the multiple rows of drop-off openings are geometrically arranged with any drop-off opening in the top row of drop-off openings as the position of the first row element of the Pascal's triangle; the first object moves horizontally above a target row in the first preset area, and the target row is the row where the top row of drop-off openings is located; the data determination module includes:
[0091] A current position determining unit, configured to determine a current position of the first object when the execution instruction is triggered;
[0092] The starting drop position determining unit is configured to use a position in the target row directly below the current position as the starting drop position.
[0093] In an optional embodiment, the first preset area includes multiple rows of preset collision objects and multiple rows of drop openings corresponding to the multiple rows of preset collision objects, there is a drop opening between two adjacent preset collision objects in each row of preset collision objects, the multiple rows of drop openings are a geometric arrangement with any drop opening in the top row of drop openings as the position of the first row element of the Pascal's triangle; the position of the drop opening in the bottom row of the multiple rows of drop openings is a plurality of preset drop positions, the multiple preset drop positions correspond to at least one preset drop position type, each preset drop position corresponds to one of the at least one preset drop position type, and the at least one preset drop position type includes the target drop position type;
[0094] The falling position determination module includes:
[0095] a starting drop-off point determining unit, configured to determine a starting drop-off point from the top row of drop-off points according to the starting drop-off position;
[0096] a drop port determining unit configured to, under the collision constraint of the multiple rows of preset collision objects, determine, based on the starting drop port, a target drop port corresponding to the target drop position type from the bottom row of drop ports, and determine at least one intermediate drop port from the intermediate rows of drop ports, the intermediate row of drop ports being at least one row of drop ports located between the top row of drop ports and the bottom row of drop ports among the multiple rows of drop ports;
[0097] a target collision point determination unit configured to determine, with the initial drop position as a starting point and based on a shortest path constraint, a target collision point corresponding to each path drop outlet from preset collision objects corresponding to each path drop outlet, wherein each path drop outlet is each drop outlet among the target drop outlet and the at least one intermediate drop outlet; and a preset collision object corresponding to each path drop outlet is a preset collision object adjacent to each path drop outlet;
[0098] a target falling position determining unit configured to use the position of the target collision point corresponding to the target falling opening as the target falling position;
[0099] The intermediate drop position determining unit is configured to use the position of the target collision point corresponding to the at least one intermediate drop opening as the at least one intermediate drop position.
[0100] In an optional embodiment, the falling process rendering module includes:
[0101] A data acquisition unit is configured to acquire a preset falling speed corresponding to the first object and a first preset friction force during the falling process of the first object;
[0102] a first speed correction unit configured to correct the preset falling speed based on the first preset friction force to obtain a target falling speed during the falling process of the first object;
[0103] The falling process rendering unit is configured to render the falling process in the first preset area based on the falling trajectory of the object and the target falling speed.
[0104] In an optional embodiment, the second preset area is an isosceles trapezoidal object pushing area, the second object includes at least one object, and the pushing process rendering module includes:
[0105] a first rendering unit configured to, when the first object falls to the target falling position, render the at least one object in a starting area of the second preset area, control the second preset area displaying the at least one object to move toward the target pushing position, and, during the movement of the second preset area toward the target pushing position, apply a preset squeezing force to the starting object displayed in the second preset area based on a preset air wall rigid body, so as to move the object in the second preset area;
[0106] The starting object is an object located in the starting area.
[0107] In an optional embodiment, the at least one object is a circular object, and the number of the at least one object is less than or equal to a preset threshold; the push process rendering module further includes:
[0108] A collision edge generating unit is configured to generate a collision edge corresponding to each object in the first preset area during the movement of the second preset area toward the target pushing position;
[0109] a target collision object determining unit, configured to determine a target collision object that is present in the first preset area based on a collision edge corresponding to each object;
[0110] The second speed correction unit is configured to apply a second preset friction force to the target collision object to correct the speed of the target collision object during its movement in the second preset area.
[0111] In an optional embodiment, the device further comprises:
[0112] a falling animation rendering module configured to execute, when the center of gravity position of any object in the second preset area exceeds the target pushing edge of the first preset area, rendering an animation of a target falling object falling from the first preset area based on preset animation parameters;
[0113] The target falling object is an object in the second preset area whose corresponding center of gravity position exceeds the target pushing edge of the second preset area.
[0114] In an optional embodiment, the method is applied to a terminal, and the terminal is provided with a rendering engine and a physics engine;
[0115] The rendering engine is configured to execute the steps of determining the starting falling position of the first object in the first preset area and the target falling position type corresponding to the first object, and rendering the falling process of the first object from the starting falling position to the target falling position in the first preset area based on the falling trajectory of the object;
[0116] The physics engine is used to execute the step of rendering a push process of a second object corresponding to the target falling position type in a second preset area of the interactive page when the first object falls to the target falling position.
[0117] According to a third aspect of an embodiment of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing instructions executable by the processor; wherein the processor is configured to execute the instructions to implement a method as described in any one of the first aspects above.
[0118] According to a fourth aspect of the embodiments of the present disclosure, a computer-readable storage medium is provided, which, when instructions in the storage medium are executed by a processor of an electronic device, enables the electronic device to perform any of the data processing methods according to the embodiments of the present disclosure.
[0119] According to a fifth aspect of the embodiments of the present disclosure, a computer program product containing instructions, which, when run on a computer, causes the computer to perform the method according to any of the first aspects.
[0120] The technical solutions provided by the embodiments of the present disclosure at least have the following beneficial effects:
[0121] In the case that the execution instruction of the preset interactive service is triggered, the target falling position and the at least one intermediate falling position of the first object in the object falling rendering area can be determined in combination with the starting falling position of the first object in the object falling rendering area of the interactive page and the target falling position type corresponding to the first object; then, the object falling trajectory between the starting falling position and the target falling position is constructed in segments in combination with the at least one intermediate falling position, the calculation complexity in the trajectory construction process can be greatly reduced on the basis of effectively ensuring the smoothness of the trajectory by means of the segmented trajectory construction, and the object falling trajectory obtained based on the segmented trajectory construction can be used to render the falling process of the first object from the starting falling position to the target falling position in the object falling rendering area, so that the calculation resource consumption in the object falling process can be greatly reduced; and in the case that the first object falls to the target falling position, the pushing process of the second object corresponding to the target falling position type in the second preset area in the interactive page can be rendered, so that the simulation rendering of the object falling and the object pushing in the execution process of the preset interactive service can be implemented, and the device performance can be greatly improved by reducing the calculation resource consumption.
[0122] It should be understood that the foregoing general description and the following detailed description are only exemplary and explanatory, and cannot limit the present disclosure. BRIEF DESCRIPTION OF DRAWINGS
[0123] The accompanying drawings, which are incorporated into and form part of the specification, illustrate an embodiment consistent with the present disclosure and, together with the specification, serve to explain the principles of the present disclosure, and do not constitute an improper limitation of the present disclosure.
[0124] Figure 1 is a schematic diagram of an application environment according to an exemplary embodiment;
[0125] Figure 2 is a flowchart of a data processing method according to an exemplary embodiment;
[0126] Figure 3is a schematic diagram of a Pascal's triangle formed by a preset collision object according to an exemplary embodiment;
[0127] Figure 4 is a schematic diagram of multiple rows of preset collision objects and multiple rows of drop openings provided according to an exemplary embodiment;
[0128] Figure 5 The present invention is a flowchart illustrating a method for determining a target drop position and at least one intermediate drop position corresponding to a first object from a first preset area according to a starting drop position and a target drop position type according to an exemplary embodiment;
[0129] Figure 6 A flowchart illustrating a method for constructing a falling trajectory of an object from a starting falling position to a target falling position in segments based on at least one intermediate falling position according to an exemplary embodiment is provided;
[0130] Figure 7 This is a flowchart illustrating a falling process of rendering a first object in a first preset area from a starting falling position to a target falling position based on a falling trajectory of the object according to an exemplary embodiment;
[0131] Figure 8 is a schematic diagram of an interactive page provided according to an exemplary embodiment;
[0132] Figure 9 is a block diagram of a data processing device according to an exemplary embodiment;
[0133] Figure 10 It is a block diagram of an electronic device for data processing according to an exemplary embodiment. DETAILED DESCRIPTION
[0134] In order to enable ordinary people in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
[0135] It should be noted that the terms "first," "second," and the like in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or precedence. It should be understood that the numbers used in this manner are interchangeable where appropriate so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure as detailed in the appended claims.
[0136] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for display, data for analysis, etc.) involved in this disclosure are all information and data authorized by the user or fully authorized by all parties.
[0137] See also Figure 1 , Figure 1 FIG. 1 is a schematic diagram showing an application environment according to an exemplary embodiment. The application environment may include a terminal 100 and a server 200 .
[0138] In an optional embodiment, the terminal 100 can be used to provide a preset interactive service to any user. Specifically, the terminal 100 may include, but is not limited to, electronic devices such as smartphones, desktop computers, tablet computers, laptop computers, smart speakers, digital assistants, augmented reality (AR) / virtual reality (VR) devices, and smart wearable devices. It may also be software running on these electronic devices, such as applications. Optionally, the operating system running on the electronic device may include, but is not limited to, Android, iOS, Linux, Windows, etc.
[0139] In an optional embodiment, server 200 can provide backend services for terminal 100 and pre-configure relevant configuration data for executing a preset interactive service, such as the configuration of a target drop location type. Specifically, server 200 can be a standalone physical server, a server cluster or distributed system consisting of multiple physical servers, or a cloud server providing cloud computing services.
[0140] In addition, it should be noted that Figure 1 What is shown is only one application environment provided by the present disclosure. In actual applications, other application environments may also be included, for example, more terminals may be included.
[0141] In the embodiments of this specification, the terminal 100 and the server 200 may be directly or indirectly connected via wired or wireless communication, which is not limited in this disclosure.
[0142] Figure 2 is a flow chart showing a data processing method according to an exemplary embodiment, which can be applied to a terminal, such as Figure 2 As shown, the method may include the following steps:
[0143] In step S201 , in response to an execution instruction of a preset interactive service, a starting drop position of a first object in a first preset area and a target drop position type corresponding to the first object are determined.
[0144] In a specific embodiment, the first preset area can be an object drop rendering area (i.e., an area for rendering the object drop process) in an interactive page corresponding to a preset interactive service; specifically, the preset interactive service can be an interactive service with an object drop and object push process; specifically, a first object can be displayed above the first preset area, and the first object can move horizontally above the first preset area; optionally, a virtual button can be set on the interactive page, and accordingly, the above execution instruction can be triggered by single-clicking, double-clicking, long pressing the virtual button, etc.; optionally, the above execution instruction can also be triggered by an external physical control device. Specifically, the first object can be a preset virtual falling object, which can be set in combination with actual application requirements, such as a virtual sphere, a virtual ring, a virtual doll, etc.
[0145] In a specific embodiment, the above-mentioned first preset area can be an object drop rendering area in the interactive page corresponding to the preset interactive service (i.e., an area used to render the object dropping process); specifically, the preset interactive service can be an interactive service with an object falling and object pushing process; specifically, a first object can be displayed above the first preset area, and the first object can move horizontally above the first preset area; optionally, a virtual button can be set on the interactive page, and accordingly, the above-mentioned execution instruction can be triggered by single-clicking, double-clicking, long pressing the virtual button, etc.; optionally, the above-mentioned execution instruction can also be triggered by an external physical control device.
[0146] In an optional embodiment, the first preset area includes multiple rows of preset collision objects and multiple rows of drop holes corresponding to the multiple rows of preset collision objects. There is a drop hole between two adjacent preset collision objects in each row of preset collision objects. Optionally, a drop hole can also be set between the head and tail collision points of each row of preset collision objects and the edge of the first preset area. It can be set in combination with actual application requirements. The drop holes in the multiple rows of drop holes are arranged in a geometric manner corresponding to the Pascal's triangle, and any drop hole in the top row of drop holes is the location of the first row of elements of the Pascal's triangle; the first object moves horizontally above the target row in the first preset area, and the target row is the row where the top row of drop holes is located. Optionally, the above-mentioned determination of the starting falling position of the first object in the first preset area includes:
[0147] Determine the current location of the first object when the execution instruction is triggered;
[0148] Use the position in the target row that is directly below the current position as the starting drop position.
[0149] In a specific embodiment, the elements in the Pascal's triangle can be binomial coefficients. Optionally, since the target row includes a preset collision object and a drop port, the above-mentioned starting drop position can be a certain position on the preset collision object, or a certain position in the area where the drop port is located. Optionally, the preset collision object can be set in combination with actual applications, such as a preset virtual cylinder, a preset virtual sphere, etc. In an optional embodiment, taking the Pascal's triangle with four rows as an example, as Figure 3 As shown, Figure 3 is a schematic diagram of a Pascal's triangle based on a preset collision object according to an exemplary embodiment. Specifically, Figure 3 The circles in can be preset collision objects, and correspondingly, the numbers between the two preset collision objects can be elements (binomial coefficients) in the Pascal's triangle.
[0150] In a specific embodiment, Figure 4 As shown, Figure 4 : is a schematic diagram of multiple rows of preset collision objects and multiple rows of drop openings provided according to an exemplary embodiment. Specifically, Figure 4 The circles in the image can be preset collision objects, and the area between two adjacent preset collision objects in each row of preset collision objects can be a drop hole. Assuming that the first object moves horizontally between the first and last collision points in the top row, the drop holes in the top row can include each area between two adjacent preset collision objects in the top row of preset collision objects, that is, Figure 4 Each area indicated by the middle arrow is a drop-off point in the top row. Alternatively, assuming the first object moves horizontally before the boundaries of the first preset area, the top row of drop-off points may include each area between two adjacent preset colliders in the top row, as well as the areas between the first and last preset colliders in the top row and the left and right boundaries of the first preset area. Specifically, the starting drop position may be the location in the target row directly below the current location of the first object when the execution command is triggered.
[0151] In the above embodiment, multiple rows of preset collision objects and multiple rows of drop openings corresponding to the multiple rows of preset collision objects are arranged in the object falling rendering area in combination with the Pascal's triangle, which can facilitate the simulation of the falling process of the first object from the drop openings corresponding to the multiple rows of preset collision objects. In combination with the current position of the first object when the execution instruction is triggered, the position in the top row directly below the current position is used as the starting falling position, which can effectively ensure the accuracy of the starting falling position.
[0152] In an optional embodiment, the location of the bottom row of drop openings among the above-mentioned multiple rows of drop openings is a plurality of preset drop positions, and the plurality of preset drop positions correspond to at least one preset drop position type. Different preset drop position types may correspond to different pushed objects, that is, the first object falls into drop openings of different preset drop position types, and in the subsequent pushing process, the pushed objects are different (the difference in objects may be different types of pushed objects or different numbers of objects); each preset drop position corresponds to one preset drop position type among at least one preset drop position type. Optionally, different preset drop positions may correspond to different preset drop position types or to the same drop position type. Figure 4 As shown in , the bottom row of drop openings among the multiple rows of drop openings corresponds to 4 preset drop position types: drop position type A, drop position type B, drop position type C and drop position type D.
[0153] In a specific embodiment, the target drop location type may be determined randomly or pre-set. Specifically, the method for determining the target drop location type may be pre-configured by the background.
[0154] In a specific embodiment, the number of rows of preset collision objects in the first preset area can be determined in combination with the number of preset drop position types in actual applications. For example, four preset drop position types are set in the first preset area; accordingly, Figure 3 As shown, the bottom row of the 4-row Pascal's triangle can correspond to 4 elements, and the number of rows of preset colliders can be determined to be 4. Furthermore, since the drop holes in different positions can correspond to the same preset drop position type, in order to ensure that the drop holes in the bottom row of the Pascal's triangle correspond to the 4 preset drop position types, at least 4 drop holes can be set in the bottom row of drop holes, and accordingly, at least 5 preset colliders can be set in the bottom row. Furthermore, the number of drop holes in the top row and the distance between the two preset colliders can be set in combination with the size of the first object and the size of the first preset area, and then the preset colliders in other rows can be set in combination with the distance between the two preset colliders.
[0155] In another optional embodiment, combined with Figure 3 Taking the Pascal's triangle in row 4 as an example, in actual applications, due to the collision constraints of the preset collision objects during the falling process, an object falling from a certain drop hole can only fall to the two drop holes adjacent to the drop hole in the row below the drop hole, for example Figure 3For example, the falling position of the object falling from the falling position on the left side of 1 in the second row is restricted by the preset collision object, and can only fall into the falling position of 1 on the left side of the third row and the falling position of 2 on the third row. Correspondingly, there are 8 falling modes for the first object falling from the first row to the four elements in the fourth row, among which there is one falling mode for the first object falling from the first row to the first element in the fourth row, and the corresponding elements of the falling position in this falling mode can be 1, 1, 1 and 1 in turn (the first digit 1 is the 1 in the first row, the second digit 1 is the 1 on the left side of the second row, the third digit 1 is the 1 on the left side of the third row, and the fourth digit 1 is the 1 on the left side of the fourth row), that is, the probability of the first object falling from the first row to the first element in the fourth row is 1 / 8; there are 3 falling modes for the first object falling from the first row to the second element in the fourth row, and the corresponding elements of the falling position in the 3 falling modes can be 1, 1, 1 and 3 in turn (the first digit 1 is the 1 in the first row, the second digit 1 is the 1 on the left side of the second row, the third digit 1 is the 1 on the left side of the third row, and the fourth digit 3 is the 3 on the left side of the fourth row), 1, 1, 2 and 3 (the first digit 1 is the 1 in the first row, the second digit 1 is the 1 on the left side of the second row, the third digit 2 is the 2 in the third row, and the fourth digit 3 is the 3 on the left side of the fourth row), 1, 1, 2 and 3 (the first digit 1 is the 1 in the first row, the second digit 1 is the 1 on the right side of the second row, the third digit 2 is the 2 in the third row, and the fourth digit 3 is the 3 on the left side of the fourth row), and the probability of the first object falling from the first row to the second element in the fourth row is 3 / 8. In turn, the probability of the first object falling from the first row to the third element in the fourth row is 3 / 8, and the probability of the first object falling from the first row to the fourth element in the fourth row is 1 / 8. Optionally, the probability of finally falling into various preset falling position types can be controlled by combining the above-mentioned corresponding probability of the Yang Hui triangle and the number of the falling positions in the lowermost row.
[0156] In step S203, the target falling position and at least one intermediate falling position of the first object in the first preset area are determined according to the starting falling position and the target falling position type;
[0157] In one specific embodiment, the first preset area includes multiple rows of preset collision objects and multiple rows of falling positions corresponding to the multiple rows of preset collision objects, there is a falling position between adjacent two preset collision objects in each row of preset collision objects, the multiple rows of falling positions are geometrically arranged with the first row elements of the Yang Hui triangle at the positions of the falling positions in the uppermost row of falling positions; the positions of the falling positions in the lowermost row of the multiple rows of falling positions are multiple preset falling positions, the multiple preset falling positions correspond to at least one preset falling position type, each preset falling position corresponds to one of the at least one preset falling position type, and the at least one preset falling position type includes the target falling position type; accordingly, as Figure 5As shown, the above-mentioned determining the target falling position and at least one intermediate falling position corresponding to the first object from the first preset area according to the starting falling position and the target falling position type may include the following steps:
[0158] In step S501, according to the starting drop position, the starting drop outlet is determined from the top row of drop outlets;
[0159] In step S503, under the collision constraints of the multiple rows of preset collision objects, based on the starting drop hole, a target drop hole corresponding to the target drop location type is determined from the drop holes in the bottom row, and at least one intermediate drop hole is determined from the drop holes in the intermediate row;
[0160] In step S505, starting from the initial drop position, based on the shortest path constraint, a target collision point corresponding to each path drop outlet is determined from the preset collision objects corresponding to each path drop outlet;
[0161] In step S507, the position of the target collision point corresponding to the target drop opening is used as the target drop position;
[0162] In step S509, the position of the target collision point corresponding to at least one intermediate drop opening is used as at least one intermediate drop position.
[0163] In a specific embodiment, if the starting drop position is located in the area where a drop port in the top row of drop ports is located, the drop port can be used as the starting drop port; if the starting drop position is located on a preset collision object, the starting drop port can be determined based on the relative position relationship between the starting drop position and the center of the preset collision object; optionally, if the starting drop position is located to the left of the center of the preset collision object, the drop port on the left of the preset collision object can be used as the starting drop port; if the starting drop position is located to the right of the center of the preset collision object, the drop port on the right of the preset collision object can be used as the starting drop port.
[0164] In addition, it should be noted that for the preset collision objects at the boundary of the first preset area, since it is at the boundary, the leftmost preset collision object can only select a drop-off point to the right, and the rightmost preset collision object can only select a drop-off point to the left.
[0165] In one specific embodiment, the intermediate row of drop openings is at least one row of drop openings located between the top row of drop openings and the bottom row of drop openings in the multiple rows of drop openings. In one specific embodiment, since the first object is subject to collision constraints from multiple rows of preset collision objects during its fall, the collision constraints (an object falling from a particular drop opening can only fall into two adjacent drop openings in the row below that drop opening) and the target drop opening corresponding to the target drop location type that it ultimately needs to land at can be combined to sequentially determine the drop openings in each row, thereby obtaining the target drop opening and at least one intermediate drop opening.
[0166] In a specific embodiment, combining Figure 4 For the convenience of description, the corresponding drop ports are marked with numbers. Assume that the drop port 0 where the first arrow is located in the first row is the starting drop port. Combined with the collision constraint, it can be determined that the drop ports after the starting drop port 0 can be drop ports 1 and 2. Then, combined with the collision constraint, drop port 1 can fall to drop ports 3 and 4; in addition, combined with the collision constraint, drop port 2 can fall to drop ports 4 and 6; then, combined with the collision constraint, drop port 3 can fall to drop ports 5 and 7. Since the target drop position type is B, it can be determined that drop port 3 can only fall to drop port 5. Accordingly, it can be determined that the target drop corresponding to the first drop method is drop port 5. At least one intermediate drop port is drop port 1 and 3; in addition, combined with the collision constraint, drop port 4 can fall to drop ports 5 and 8. Since the target drop position type is B, it can be determined that drop port 4 can only fall to drop port 5; accordingly, it can be determined that the target drop corresponding to the second falling method is drop port 5, and at least one intermediate drop port is drop ports 2 and 4; in addition, since the target drop position type is B, drop port 6 cannot fall to the drop port with the target drop position type B when falling, and it is not necessary to continue searching for the drop; accordingly, it can be finally determined that the target drop port is drop port 5, and at least one intermediate drop port can be drop ports 1 and 3, or drop ports 2 and 4.
[0167] In a specific embodiment, each path drop opening is each drop opening among the target drop opening and the at least one intermediate drop opening; and the preset collision object corresponding to each path drop opening is the preset collision object adjacent to each path drop opening. Optionally, if a path drop is located between two preset collision objects, the path drop corresponds to two preset collision objects; optionally, if a path drop is located between a preset collision object and the boundary of the first preset area, the path drop is located between one preset collision object; optionally, in the process of determining the target collision point corresponding to each path drop from the preset collision objects corresponding to each path drop with the starting drop position as the starting point and based on the shortest path constraint, the starting drop position can be used as the current drop position, and then, the shortest path constraint (i.e., the path between the current drop position and the next drop position is the shortest) can be combined with the path distance between the current drop position and the preset collision objects corresponding to the path drop in the next row, and the position point with the shortest path distance to the current drop position can be selected from the position points of the preset collision objects corresponding to the path drop in the next row as the target collision point corresponding to the path drop in the next row. Then, the target collision point corresponding to the path drop in the next row is used as the current drop position, and the target collision point corresponding to the path drop in the next row is determined by analogy.
[0168] In the above embodiment, multiple rows of preset colliders and multiple rows of drop holes corresponding to the multiple rows of preset colliders are arranged in the object falling rendering area in combination with the Pascal's triangle, which can facilitate the simulation of the falling process of the first object from the drop holes corresponding to the multiple rows of preset colliders, greatly improving the realism of the object falling process, and after determining the starting drop hole from the top row of drop holes according to the starting drop position, under the collision constraints of the multiple rows of preset colliders, based on the starting drop hole, the target drop hole corresponding to the target drop position type is determined from the bottom row of drop holes, and at least one intermediate drop hole is determined from the middle row of drop holes; then, with the starting drop position as the starting point, based on the shortest path constraint, the target collision point corresponding to each path drop hole is determined from the preset colliders corresponding to each path drop hole, and then the target drop position and at least one intermediate drop position can be quickly and accurately determined in combination with the target collision, which facilitates the subsequent rapid determination of the falling trajectory.
[0169] In step S205 , based on at least one intermediate falling position, a falling trajectory of the object from the starting falling position to the target falling position is constructed in segments.
[0170] In an optional embodiment, if Figure 6 As shown, the above-mentioned step of constructing the object falling trajectory from the starting falling position to the target falling position based on at least one intermediate falling position may include the following steps:
[0171] In step S601, a plurality of path node pairs are determined from the starting falling position, the target falling position, and at least one intermediate falling position;
[0172] In step S603, a control node corresponding to any path node pair is determined based on a relative position relationship between two path nodes in the path node pair.
[0173] In step S605, a second-order Bezier curve corresponding to any path node pair is generated according to the path node pair and the control node corresponding to the path node pair.
[0174] In step S607, the second-order Bezier curves corresponding to the plurality of path node pairs are spliced to obtain the object falling trajectory.
[0175] In one specific embodiment, any path node pair can be a pair of nodes with any two adjacent positions in the starting falling position, the target falling position, and the at least one intermediate falling position as path nodes. Specifically, taking the first object falling process from top to bottom as an example, the first path node pair can have the starting falling position and the intermediate falling position of the second row as path nodes. Optionally, if the at least one intermediate falling position includes multiple positions, the second path node pair can have the intermediate falling position of the second row and the intermediate falling position of the third row as path nodes, and so on, until the current path node pair has the target falling position and the intermediate falling position of the row above the target falling position as path nodes.
[0176] In one specific embodiment, the determination of the control node corresponding to any path node pair based on the relative position relationship between the two path nodes in the path node pair can include: in the case where the first path node in the path node pair is located on the left side of the second path node in the vertical direction, the horizontal coordinate of the control node can be determined on the left side of the first path node in combination with a preset random range (the distance range between the control node and the first path node in the horizontal direction); in the case where the first path node is located on the right side of the second path node in the vertical direction, the horizontal coordinate of the control node can be determined on the right side of the first path node in combination with the preset random range; and the vertical coordinate of the control node can be randomly generated between the vertical coordinates of the first path node and the second path node.
[0177] In one specific embodiment, the positions of the path nodes in each path node pair and the position of the control node corresponding to any path node pair can be substituted into the second-order Bezier formula, and then the second-order Bezier curve corresponding to any path node pair can be generated. Specifically, the second-order Bezier curve corresponding to any path node pair can be a curve from the first path node in the path node pair to the second path node in the path node pair through the control node.
[0178] In a specific embodiment, the object falling trajectory can be obtained by splicing the second order Bezier curves corresponding to the plurality of path node pairs in combination with the adjacency relationship of the path nodes in each path node pair. Specifically, the object falling trajectory can be the trajectory of the first object falling from the starting falling position to the target falling position.
[0179] In the above embodiment, in the process of generating the object falling trajectory, the segmented trajectory calculation is performed in combination with the starting falling position, the target falling position and the at least one intermediate falling position. Then, the smoothness of the curve can be effectively ensured based on the second order Bezier curve. The calculation process of the second order Bezier curve is simple, which can effectively reduce the calculation complexity and the consumption of computing resources, and further improve the device performance.
[0180] In step S207, the falling process of the first object from the starting falling position to the target falling position is rendered in the first preset area based on the object falling trajectory.
[0181] In an optional embodiment, as shown in FIG. 7, the falling process of the first object from the starting falling position to the target falling position rendered in the first preset area based on the object falling trajectory can include the following steps: Figure 7
[0182] In step S701, the preset falling speed corresponding to the first object and the first preset friction in the falling process of the first object are obtained.
[0183] In step S703, the preset falling speed is corrected based on the first preset friction to obtain the target falling speed in the falling process of the first object.
[0184] In step S705, the falling process is rendered in the first preset area based on the object falling trajectory and the target falling speed.
[0185] In a specific embodiment, the preset falling speed can be set in advance in combination with the actual application. The first preset friction can be the air resistance set in advance. Optionally, the speed of the first object in the falling process caused by the first preset friction can be obtained based on the resistance formula under the condition that the first preset friction is applied to the first object. Then, the preset falling speed is corrected based on the speed to obtain the target falling speed.
[0186] In a specific embodiment, the falling process rendered in the first preset area based on the object falling trajectory and the target falling speed can include controlling the first object to fall along the object falling trajectory at the target falling speed.
[0187] In the above embodiment, when rendering the falling process of the first object from the starting falling position to the target falling position in the first preset area based on the falling trajectory of the object, the preset falling speed is corrected in combination with the first preset friction force, which can better simulate the falling process of the object, and further, on the basis of rendering the continuous and smooth falling process of the object, the authenticity of the falling process of the object can be greatly improved.
[0188] In step S209, when the first object falls to the target falling position, a push process of the second object corresponding to the target falling position type is rendered in a second preset area in the interactive page.
[0189] In a specific embodiment, the second object can be an object that needs to be pushed (pushing object), and different preset drop location types can be pre-set to correspond to different pushing objects (for example, different preset drop location types correspond to different types of pushing objects, or different preset drop location types correspond to different numbers of objects), and then the second object corresponding to the target drop location type can be determined.
[0190] In an optional embodiment, the second preset area is an isosceles trapezoidal object pushing area, and the second object may include at least one object. Optionally, when the first object falls to the target drop position, the push process of rendering the second object corresponding to the target drop position type in the second preset area in the interactive page may include:
[0191] When the first object falls to the target falling position, at least one object is rendered in the starting area of the second preset area, the second preset area displaying the at least one object is controlled to move toward the target pushing position, and during the movement of the second preset area toward the target pushing position, a preset squeezing force is applied to the starting object displayed in the second preset area based on a preset air wall rigid body, so that the object in the second preset area moves;
[0192] In a specific embodiment, the starting object is an object located in a starting area. Optionally, the starting object may include a currently rendered object (the second object) or a historically rendered object. Specifically, the starting area may be a designated area at the top of the first preset area. Specifically, the position on the target map may be pre-set based on actual application. Specifically, when a preset extrusion force is applied to the starting object, the starting object may move in a direction corresponding to the preset extrusion force.
[0193] In the above embodiment, the second preset area is set as an isosceles trapezoidal object pushing area, which can achieve the effect of simulating a three-dimensional perspective relationship with a two-dimensional image, greatly improving the realism of the simulation scene, and when the first object falls to the target falling position, at least one object is rendered in the starting area of the second preset area, and the second preset area displaying at least one object is controlled to move toward the target pushing position. In the process of the second preset area moving toward the target pushing position, a preset extrusion force is applied to the starting object displayed in the second preset area based on the preset air wall rigid body, thereby realizing an effective simulation of the object pushing process.
[0194] In an optional embodiment, at least one object is a circular object, and the number of at least one object is less than or equal to a preset threshold. Specifically, the preset threshold may be a preset upper limit on the number of push objects generated at a single time. In the case where the first object falls to the target drop location, the push process of rendering the second object corresponding to the target drop location type in the second preset area of the interactive page may further include:
[0195] During the movement of the second preset area toward the target push position, a collision edge corresponding to each object in the first preset area is generated;
[0196] Determining a target collision object in the first preset area based on a collision edge corresponding to each object;
[0197] A second preset friction force is applied to the target collision object to correct the speed of the target collision object during movement in the second preset area.
[0198] In actual applications, for some circular objects, collision calculations need to be performed as long as there is one point of contact between them. In order to reduce the computational complexity of collision calculations between circular objects, collision edges can be generated for each object. Accordingly, collision calculations can be performed in combination with the contact between edges. Optionally, the number of collision edges corresponding to each object can be pre-set. For example, if a pentagon is required to represent the corresponding edge, 5 collision edges can be generated. Optionally, the collision contact of the collision edges between different objects can be combined to determine each target collision object. Specifically, the target collision object can be an object that collides with other objects. Specifically, the second preset friction force can be the force caused by the collision between two objects. The optional magnitude of the second preset friction force can be pre-set, and the direction of the second preset friction force can be determined in combination with the collision situation between two objects in actual applications. Correspondingly, the above-mentioned application of a second preset friction force to the target collision object to correct the speed of the target collision object during movement in the second preset area may include: determining that there is a configured target collision edge for the target collision object, and combining the relative position relationship between the target collision object and the object that collides with the target collision object at the target collision edge, determining the direction of the second preset friction force, and combining the corresponding magnitude of the second preset friction force, calculating the speed brought by the second preset friction force on the target collision edge, and correcting the speed of the target collision object during movement in the second preset area based on the speed.
[0199] In the above embodiment, when the object to be pushed is circular, by setting a collision edge for the circular object, the amount of collision calculation during the pushing process can be reduced, and by controlling the number of objects generated to be pushed, the system resource consumption during the object pushing process can be effectively controlled, thereby effectively improving device performance.
[0200] In an optional embodiment, the above method may further include:
[0201] When the center of gravity of any object in the second preset area exceeds the target pushing edge of the first preset area, rendering an animation of the target falling object falling from the first preset area based on preset animation parameters;
[0202] In a specific embodiment, the target dropping object is an object whose corresponding center of gravity position in the second preset area exceeds the target push edge of the second preset area. The target push edge can be the edge of the second preset area close to the target push position. The preset animation parameters can be animation parameters that can render the object falling. Optionally, the target dropping object can fall into a third preset area, which is connected to the exit of the preset reward object. Accordingly, after the number of objects in the third preset area reaches a certain number, the user can obtain the reward object (the target dropping object that reaches the exit).
[0203] In the above embodiment, when the center of gravity of any object in the second preset area exceeds the target push edge of the first preset area, based on the preset animation parameters, the animation of the target falling object falling from the first preset area is rendered, and the object falling can be rendered quickly.
[0204] In an optional embodiment, the above method is applied to a terminal, and the terminal is provided with a rendering engine and a physics engine;
[0205] In a specific embodiment, the rendering engine is used to execute the steps of determining the starting falling position of the first object in the first preset area and the target falling position type corresponding to the first object, and rendering the falling process of the first object from the starting falling position to the target falling position in the first preset area based on the falling trajectory of the object; the physics engine is used to execute the steps of rendering the pushing process of the second object corresponding to the target falling position type in the second preset area of the interactive page when the first object falls to the target falling position.
[0206] In the above embodiment, during the execution of the preset interactive business, the combination of the rendering engine and the physics engine can effectively reduce the resource consumption caused by the simulation of the Lianggege physics engine in the related technology. The combination of the rendering engine and the physics engine can be developed without relying on traditional business engines such as game engines, and the rendering can be run smoothly on ordinary h5 pages, greatly improving the scalability of the business.
[0207] In addition, it should be noted that the velocities involved in the embodiments of this specification are all vectors with magnitude and direction.
[0208] In a specific embodiment, Figure 8 As shown, Figure 8 This is a schematic diagram of an interactive page provided according to an exemplary embodiment. Specifically, the area corresponding to 801 is the first preset area. The first object 801 moves horizontally above the first preset area 801, and when the execution instruction is triggered, the first object 801 is rendered from the starting drop position to the target drop position in the first preset area. Then, the second object 804 that needs to be rendered can be determined in combination with the target drop position type of the first object. Specifically, the area corresponding to 803 can be the second preset area. Further combination Figure 8 As can be seen from the diagram on the right side of the middle about the pushing process, the second preset area can push the first object forward.
[0209] It can be seen from the technical solutions provided by the above embodiments of this specification that, when an execution instruction of a preset interactive service is triggered, this specification can determine the target drop position and at least one intermediate drop position of the first object in the object drop rendering area of the interactive page in combination with the starting drop position of the first object and the target drop position type corresponding to the first object; then, in combination with the at least one intermediate drop position, the object drop trajectory between the starting drop position and the target drop position is constructed in segments. By constructing the segmented trajectory, the computational complexity in the trajectory construction process can be greatly reduced on the basis of effectively ensuring the smoothness of the trajectory. Then, based on the object drop trajectory obtained by the segmented trajectory construction, the falling process of the first object from the starting drop position to the target drop position can be rendered in the object drop rendering area, thereby greatly reducing the computing resource consumption in the object falling process; and when the first object falls to the target drop position, the push process of the second object corresponding to the target drop position type is rendered in the second preset area of the interactive page, thereby realizing the simulated rendering of the object falling and object pushing during the execution of the preset interactive service, and greatly improving the device performance by reducing the computing resource consumption.
[0210] Figure 9 FIG. 1 is a block diagram of a data processing device according to an exemplary embodiment. Figure 9 , the device comprises:
[0211] The data determination module 910 is configured to execute an execution instruction in response to a preset interactive service and determine a starting drop position of the first object and a target drop position type corresponding to the first object within a first preset area; the first preset area is an object drop rendering area in an interactive page corresponding to the preset interactive service;
[0212] A drop position determination module 920 is configured to determine a target drop position and at least one intermediate drop position of the first object in the first preset area according to the starting drop position and the target drop position type;
[0213] The object falling trajectory construction module 930 is configured to construct the object falling trajectory from the starting falling position to the target falling position in segments based on at least one intermediate falling position;
[0214] The falling process rendering module 940 is configured to render the falling process of the first object from the starting falling position to the target falling position in the first preset area based on the falling trajectory of the object;
[0215] The push process rendering module 950 is configured to execute a push process of rendering a second object corresponding to the target drop location type in a second preset area in the interactive page when the first object drops to the target drop location.
[0216] In an optional embodiment, the object falling trajectory construction module 930 includes:
[0217] a path node pair determining unit configured to determine a plurality of path node pairs from a starting drop position, a target drop position, and at least one intermediate drop position, wherein any path node pair is a node pair having any two adjacent positions among the starting drop position, the target drop position, and the at least one intermediate drop position as path nodes;
[0218] a control node determining unit configured to determine a control node corresponding to any path node pair based on a relative position relationship between two path nodes in any path node pair;
[0219] A second-order Bezier curve generating unit is configured to generate a second-order Bezier curve corresponding to any path node pair according to any path node pair and a control node corresponding to the path node pair;
[0220] The curve splicing unit is configured to perform splicing processing on the second-order Bezier curves corresponding to the multiple path node pairs to obtain the falling trajectory of the object.
[0221] In an optional embodiment, the first preset area includes multiple rows of preset collision objects and multiple rows of drop holes corresponding to the multiple rows of preset collision objects, there is a drop hole between two adjacent preset collision objects in each row of preset collision objects, and the multiple rows of drop holes are geometrically arranged with any drop hole in the top row of drop holes as the position of the first row element of the Pascal's triangle; the first object moves horizontally above a target row in the first preset area, and the target row is the row where the top row of drop holes is located; the data determination module 910 includes:
[0222] A current position determining unit, configured to determine a current position of the first object when the execution instruction is triggered;
[0223] The starting drop position determining unit is configured to set a position in the target row immediately below the current position as the starting drop position.
[0224] In an optional embodiment, the first preset area includes multiple rows of preset collision objects and multiple rows of drop openings corresponding to the multiple rows of preset collision objects, there is a drop opening between two adjacent preset collision objects in each row of preset collision objects, and the multiple rows of drop openings are a geometric arrangement in which any drop opening in the top row of drop openings is the position of the first row element of the Pascal's triangle; the position of the drop opening in the bottom row of the multiple rows of drop openings is a plurality of preset drop positions, the multiple preset drop positions correspond to at least one preset drop position type, each preset drop position corresponds to one preset drop position type of the at least one preset drop position type, and the at least one preset drop position type includes a target drop position type;
[0225] The drop location determination module 920 includes:
[0226] a starting drop opening determining unit, configured to determine a starting drop opening from a top row of drop openings according to a starting drop position;
[0227] a drop hole determination unit configured to, under collision constraints of multiple rows of preset collision objects, determine, based on the starting drop hole, a target drop hole corresponding to the target drop location type from the bottom row of drop holes, and determine at least one intermediate drop hole from the intermediate rows of drop holes, wherein the intermediate row of drop holes is at least one row of drop holes located between the top row of drop holes and the bottom row of drop holes in the multiple rows of drop holes;
[0228] The target collision point determination unit is configured to determine, starting from the initial drop position and based on the shortest path constraint, a target collision point corresponding to each path drop outlet from preset collision objects corresponding to each path drop outlet, wherein each path drop outlet is each drop outlet between the target drop outlet and at least one intermediate drop outlet; and the preset collision object corresponding to each path drop outlet is a preset collision object adjacent to each path drop outlet;
[0229] a target drop position determination unit configured to use the position of the target collision point corresponding to the target drop opening as the target drop position;
[0230] The intermediate drop position determination unit is configured to use a position of a target collision point corresponding to at least one intermediate drop opening as at least one intermediate drop position.
[0231] In an optional embodiment, the falling process rendering module 940 includes:
[0232] A data acquisition unit is configured to acquire a preset falling speed corresponding to the first object and a first preset friction force during the falling process of the first object;
[0233] A first speed correction unit is configured to correct the preset falling speed based on the first preset friction force to obtain a target falling speed during the falling process of the first object;
[0234] The falling process rendering unit is configured to render the falling process in a first preset area based on the falling trajectory of the object and the target falling speed.
[0235] In an optional embodiment, the second preset area is an isosceles trapezoidal object pushing area, the second object includes at least one object, and the pushing process rendering module 950 includes:
[0236] The first rendering unit is configured to, when the first object falls to the target falling position, render at least one object in the starting area of the second preset area, control the second preset area displaying the at least one object to move toward the target pushing position, and, during the movement of the second preset area toward the target pushing position, apply a preset squeezing force to the starting object displayed in the second preset area based on a preset air wall rigid body, so as to move the object in the second preset area;
[0237] The starting object is the object located in the starting area.
[0238] In an optional embodiment, at least one object is a circular object, and the number of at least one object is less than or equal to a preset threshold; the push process rendering module 950 further includes:
[0239] A collision edge generating unit is configured to generate a collision edge corresponding to each object in the first preset area during the movement from the second preset area to the target pushing position;
[0240] A target collision object determining unit is configured to determine a target collision object that is present in the first preset area based on a collision edge corresponding to each object;
[0241] The second speed correction unit is configured to apply a second preset friction force to the target collision object to correct the speed of the target collision object during its movement in the second preset area.
[0242] In an optional embodiment, the above device further includes:
[0243] A falling animation rendering module is configured to execute, when the center of gravity position of any object in the second preset area exceeds the target pushing edge of the first preset area, rendering an animation of the target falling object falling from the first preset area based on preset animation parameters;
[0244] The target falling object is an object in the second preset area whose corresponding center of gravity position exceeds the target pushing edge of the second preset area.
[0245] In an optional embodiment, the method is applied to a terminal, and the terminal is provided with a rendering engine and a physics engine;
[0246] The rendering engine is configured to execute the steps of determining a starting falling position of the first object in the first preset area and a target falling position type corresponding to the first object, and rendering a falling process of the first object from the starting falling position to the target falling position in the first preset area based on the falling trajectory of the object;
[0247] The physics engine is used to execute the step of pushing a second object corresponding to the target falling position type in a second preset area of the interactive page when the first object falls to the target falling position.
[0248] Regarding the apparatus in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0249] Figure 10 is a block diagram of an electronic device for data processing according to an exemplary embodiment. The electronic device may be a terminal, and its internal structure diagram may be as shown in FIG. Figure 10 As shown. The electronic device includes a processor, a memory, a network interface, a display screen and an input device connected via a system bus. The processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the electronic device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a data processing method is implemented. The display screen of the electronic device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the electronic device can be a touch layer covering the display screen, or a button, trackball or touchpad provided on the housing of the electronic device, or an external keyboard, touchpad or mouse, etc.
[0250] Those skilled in the art will understand that Figure 10 The structure shown in the figure is only a block diagram of a part of the structure related to the scheme of the present disclosure, and does not constitute a limitation on the electronic device to which the scheme of the present disclosure is applied. The specific electronic device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0251] In an exemplary embodiment, an electronic device is further provided, including: a processor; and a memory for storing instructions executable by the processor; wherein the processor is configured to execute the instructions to implement the data processing method in the embodiment of the present disclosure.
[0252] In an exemplary embodiment, a computer-readable storage medium is further provided. When instructions in the storage medium are executed by a processor of an electronic device, the electronic device can execute the data processing method in the embodiment of the present disclosure.
[0253] In an exemplary embodiment, a computer program product containing instructions is also provided. When the computer program product is run on a computer, the computer is caused to execute the data processing method in the embodiment of the present disclosure.
[0254] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program, which can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0255] Other embodiments of the present disclosure will readily occur to those skilled in the art after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art not disclosed herein. The description and examples are to be considered as exemplary only, with the true scope and spirit of the present disclosure being indicated by the following claims.
[0256] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes can be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A data processing method, characterized in that: include: In response to an execution instruction of a preset interactive service, determining a starting drop position of a first object within a first preset area and a target drop position type corresponding to the first object; The first preset area is an object drop rendering area in the interactive page corresponding to the preset interactive service; the first preset area includes multiple rows of preset collision objects based on the Pascal's triangle layout and multiple rows of drop openings corresponding to the multiple rows of preset collision objects; According to the starting drop position, determining a starting drop opening from the top row of drop openings among the multiple rows of drop openings; Under the collision constraints of the multiple rows of preset collision objects, based on the starting drop port, determining a target drop port corresponding to the target drop location type from a bottom row of drop ports among the multiple rows of drop ports, and determining at least one intermediate drop port from an intermediate row of drop ports among the multiple rows of drop ports; Taking the initial drop position as a starting point, and based on a shortest path constraint, determining a target collision point corresponding to each path drop from among the target drop and the preset collision objects adjacent to each path drop in the at least one intermediate drop; The target collision point corresponding to the target drop opening is used as the target drop position; The position of the target collision point corresponding to the at least one intermediate drop opening is used as at least one intermediate drop position; Based on the at least one intermediate falling position, constructing a falling trajectory of the object from the starting falling position to the target falling position in segments; Based on the falling trajectory of the object, rendering in the first preset area a falling process of the first object from the starting falling position to the target falling position; In the case where the first object falls to the target falling position, a second preset area in the interactive page renders a pushing process of a second object corresponding to the target falling position type.
2. The data processing method according to claim 1, wherein: The step of constructing the object falling trajectory from the starting falling position to the target falling position in segments based on the at least one intermediate falling position includes: Determining a plurality of path node pairs from the starting drop position, the target drop position, and the at least one intermediate drop position, wherein any path node pair is a node pair having any two adjacent positions among the starting drop position, the target drop position, and the at least one intermediate drop position as path nodes; Determining a control node corresponding to any path node pair based on a relative positional relationship between two path nodes in any path node pair; generating a second-order Bezier curve corresponding to any path node pair according to the any path node pair and the control node corresponding to the any path node pair; The second-order Bezier curves corresponding to the multiple path node pairs are spliced to obtain the falling trajectory of the object.
3. The data processing method according to claim 1, wherein: The first preset area includes multiple rows of preset collision objects and multiple rows of drop-off openings corresponding to the multiple rows of preset collision objects, there is a drop-off opening between two adjacent preset collision objects in each row of preset collision objects, and the multiple rows of drop-off openings are geometrically arranged with any drop-off opening in the top row of drop-off openings as the position of the first row element of the Pascal's triangle; the first object moves horizontally above a target row in the first preset area, and the target row is the row where the top row of drop-off openings is located; Determining the starting falling position of the first object in the first preset area includes: determining a current location of the first object when the execution instruction is triggered; The position in the target row directly below the current position is used as the starting falling position.
4. The data processing method according to claim 1, wherein: The step of rendering the falling process of the first object from the starting falling position to the target falling position in the first preset area based on the falling trajectory of the object includes: Obtaining a preset falling speed corresponding to the first object and a first preset friction force during the falling process of the first object; Correcting the preset falling speed based on the first preset friction force to obtain a target falling speed of the first object during its falling process; The falling process is rendered in the first preset area based on the falling trajectory of the object and the target falling speed.
5. The data processing method according to claim 1, wherein: The second preset area is an isosceles trapezoidal object pushing area, the second object includes at least one object, and when the first object falls to the target falling position, the pushing process of rendering the second object corresponding to the target falling position type in the second preset area on the interactive page includes: When the first object falls to the target falling position, rendering the at least one object in a starting area of the second preset area, controlling the second preset area displaying the at least one object to move toward the target pushing position, and applying a preset squeezing force to the starting object displayed in the second preset area based on a preset air wall rigid body during the movement of the second preset area toward the target pushing position, so as to move the object in the second preset area; The starting object is an object located in the starting area.
6. The data processing method according to claim 5, characterized in that: The at least one object is a circular object, and the number of the at least one object is less than or equal to a preset threshold; and when the first object falls to the target falling position, the pushing process of rendering a second object corresponding to the target falling position type in a second preset area on the interactive page further includes: During the movement of the second preset area toward the target push position, generating a collision edge corresponding to each object in the first preset area; Determining a target collision object in the first preset area based on a collision edge corresponding to each object; A second preset friction force is applied to the target collision object to correct the speed of the target collision object during movement in the second preset area.
7. The data processing method according to claim 5, characterized in that: The method further comprises: When the center of gravity of any object in the second preset area exceeds the target pushing edge of the first preset area, rendering an animation of the target falling object falling from the first preset area based on preset animation parameters; The target falling object is an object in the second preset area whose corresponding center of gravity position exceeds the target pushing edge of the second preset area.
8. The data processing method according to any one of claims 1 to 7, characterized in that: The method is applied to a terminal, wherein the terminal is provided with a rendering engine and a physics engine; The rendering engine is configured to execute the steps of determining the starting falling position of the first object in the first preset area and the target falling position type corresponding to the first object, and rendering the falling process of the first object from the starting falling position to the target falling position in the first preset area based on the falling trajectory of the object; The physics engine is used to execute the step of rendering a push process of a second object corresponding to the target falling position type in a second preset area of the interactive page when the first object falls to the target falling position.
9. A data processing device, characterized in that: include: a data determination module configured to execute an execution instruction in response to a preset interactive service, and determine a starting falling position of a first object within a first preset area and a target falling position type corresponding to the first object; The first preset area is an object drop rendering area in the interactive page corresponding to the preset interactive service; the first preset area includes multiple rows of preset collision objects based on the Pascal's triangle layout and multiple rows of drop openings corresponding to the multiple rows of preset collision objects; a drop position determination module, wherein the drop position determination module is specifically configured to determine a starting drop opening from a topmost row of drop openings among the multiple rows of drop openings according to the starting drop position; Under the collision constraints of the multiple rows of preset collision objects, based on the starting drop port, determining a target drop port corresponding to the target drop location type from a bottom row of drop ports among the multiple rows of drop ports, and determining at least one intermediate drop port from an intermediate row of drop ports among the multiple rows of drop ports; Taking the initial drop position as the starting point, based on the shortest path constraint, determining a target collision point corresponding to each path drop position from the target drop position and the preset collision objects adjacent to each path drop position in the at least one intermediate drop position; using the location of the target collision point corresponding to the target drop position as the target drop position; and using the location of the target collision point corresponding to the at least one intermediate drop position as the at least one intermediate drop position; an object falling trajectory construction module, configured to construct the object falling trajectory from the starting falling position to the target falling position in segments based on the at least one intermediate falling position; a falling process rendering module, configured to render, in the first preset area, a falling process of the first object falling from the starting falling position to the target falling position based on the falling trajectory of the object; The push process rendering module is configured to execute a push process of rendering a second object corresponding to the target falling location type in a second preset area of the interactive page when the first object falls to the target falling location.
10. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the data processing method according to any one of claims 1 to 8.
11. A computer-readable storage medium, characterized in that When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the data processing method according to any one of claims 1 to 8.
12. A computer program product, characterized in that When the computer program product is run on a computer, the computer is caused to execute the data processing method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Collision rendering method and device
CN111080751A
Representing physical state in gaming systems
US20110081959A1