Splicing control method and related device
By obtaining the splicing points in the initial relative position of the splicing elements, combining the attribute information of the splicing points for splicing, and setting the physical properties of the splicing body, the problem of insufficient flexibility and authenticity of object splicing in the prior art is solved, and efficient object splicing and motion control is achieved.
Patent Information
- Application Number
- CN202411820205.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-11
- Publication Date
- 2025-03-07
- Estimated Expiration
- 2044-12-11
AI Technical Summary
The prior art is difficult to effectively perform object splicing operations based on user needs, resulting in insufficient splicing flexibility and performance effects.
By obtaining the first splicing element and the second splicing element, the splicing point in its initial relative position is determined, the splicing operation is performed based on the attribute information of the splicing point, and the physical attributes of the splicing body, such as the center of gravity, are set to realize the real splicing and motion control of the object.
It realizes flexible splicing and realism of objects, and users can freely interact and control splicing bodies to meet users' motion needs.
Smart Images

Figure CN119565147A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of object splicing, and more specifically, to a splicing control method and related devices. Background Art
[0002] At present, some game software supports the UGC (User Generated Content) function, and users can create personalized game objects according to their own needs. For example, users can adjust the color, type, and hairstyle of characters' clothes. Or, users can configure the position and type of decorations in the room. In the construction scene, as user needs continue to increase, some users have the need to splice objects.
[0003] Therefore, how to perform object splicing operations based on user needs is a technical problem that technical personnel in this field urgently need to solve. Summary of the invention
[0004] In view of this, the present application provides a splicing control method and related devices to solve the problem of urgently needing to perform object splicing operations based on user needs.
[0005] In order to solve the above technical problems, this application adopts the following technical solutions:
[0006] A splicing control method, comprising:
[0007] Get the first splicing element and the second splicing element;
[0008] Determining a first splicing point in the first splicing element and a second splicing point in the second splicing element based on an initial relative position of the first splicing element and the second splicing element;
[0009] According to the attribute information of the first splicing point and the attribute information of the second splicing point, a splicing operation is performed on the first splicing element and the second splicing element to obtain an initial splicing body;
[0010] Setting the physical properties of the initial spliced body to obtain a target spliced body; the physical properties at least include the center of gravity;
[0011] A motion control operation is performed on the target spliced body.
[0012] Optionally, determining a first splicing point in the first splicing element and a second splicing point in the second splicing element based on initial relative positions of the first splicing element and the second splicing element includes:
[0013] Obtaining the initial relative positions of the first splicing element and the second splicing element when they are not spliced together;
[0014] Based on the initial relative position, selecting a splicing point that is closest to the second splicing element from a plurality of splicing points in the first splicing element and using it as a first splicing point;
[0015] Based on the initial relative position, a splicing point that is closest to the first splicing element is selected from a plurality of splicing points in the second splicing element and is used as the second splicing point.
[0016] Optionally, the attribute information includes a type; the type includes at least one of a surface splicing point and a line splicing point;
[0017] The method of performing a splicing operation on the first splicing element and the second splicing element according to the attribute information of the first splicing point and the attribute information of the second splicing point to obtain an initial splicing body includes:
[0018] According to the attribute information of the first splicing point and the attribute information of the second splicing point, adjust the position of at least one of the first splicing element and the second splicing element so that there is at least one contact point between the first splicing element and the second splicing element;
[0019] Based on the current relative positions of the first splicing element and the second splicing element, a direction correction operation is performed on at least one of the first splicing element and the second splicing element to obtain an initial splicing body.
[0020] Optionally, when the type of the first splicing point is a plane splicing point and the type of the second splicing point is a plane splicing point, there is at least one contact point between the first splicing element and the second splicing element: the first splicing point and the second splicing point coincide with each other and the normal vectors of the plane where the first splicing point is located and the plane where the second splicing point is located are parallel;
[0021] In the case where the type of the first splicing point is a surface splicing point and the type of the second splicing point is a line splicing point, there is at least one contact point between the first splicing element and the second splicing element: the first splicing point and the second splicing point coincide with each other and the normal vectors of the edge where the first splicing point is located and the plane where the second splicing point is located are perpendicular;
[0022] In the case where the first splicing point is a linear splicing point and the second splicing point is a linear splicing point, there is at least one contact point between the first splicing element and the second splicing element: the first splicing point and the second splicing point overlap.
[0023] Optionally, after performing a direction correction operation on at least one of the first splicing element and the second splicing element based on the current relative positions of the first splicing element and the second splicing element to obtain an initial splicing body, the method further includes:
[0024] If at least one of the first splicing point and the second splicing point is a hinge splicing point among surface splicing points, a hinge joint is configured on the first splicing point or the second splicing point so that the first splicing element and the second splicing element can rotate freely around a straight line that is perpendicular to the splicing plane and passes through the first splicing point or the second splicing point.
[0025] Optionally, in the case where the target spliced body includes a special spliced element, performing a motion control operation on the target spliced body includes:
[0026] If the special splicing element is a drivable tire, receiving a control instruction inputted through the operating lever;
[0027] Decomposing the control instruction to obtain a first direction instruction and a second direction instruction;
[0028] In a first direction, based on the relative position between the drivable tire and the target splicing body and the first direction instruction, calculating the rotation angle of the drivable tire;
[0029] In a second direction, based on the relative position of the drivable tire and the target splicing body and the second direction instruction, calculating the rotation speed of the drivable tire;
[0030] The movement of the drivable tire is controlled according to the rotation angle and the rotation speed.
[0031] Optionally, performing a motion control operation on the target spliced body further includes:
[0032] If the special splicing element is a fan, receiving a target torque inputted through an operating lever;
[0033] adjusting the motion posture of the target spliced body based on the target torque;
[0034] During the movement of the target splicing body, if the inclination angle of the target splicing body is greater than a preset angle, the movement posture of the target splicing body is adjusted by applying a torque in a reverse direction so that the target splicing body maintains balance.
[0035] Optionally, after performing the motion control operation on the target spliced body, the method further includes:
[0036] Recording the splicing information of the target splicing body, the splicing information at least includes parameter information of each splicing element constituting the target splicing body, splicing element connection information, and position information of the splicing element relative to the target splicing body;
[0037] If a trigger instruction for the splicing information is received, in response to the trigger instruction, the various splicing elements constituting the target splicing body are spliced into the target splicing body according to the splicing information.
[0038] A splicing control device, comprising:
[0039] An element acquisition module, used to acquire a first splicing element and a second splicing element;
[0040] a splicing point determination module, configured to determine a first splicing point in the first splicing element and a second splicing point in the second splicing element based on an initial relative position of the first splicing element and the second splicing element;
[0041] A splicing module, configured to perform a splicing operation on the first splicing element and the second splicing element according to the attribute information of the first splicing point and the attribute information of the second splicing point to obtain an initial splicing body;
[0042] A setting module, used for setting the physical properties of the initial spliced body to obtain a target spliced body; the physical properties at least include the center of gravity;
[0043] The motion control module is used to perform motion control operations on the target splicing body.
[0044] An electronic device comprises at least one processor and a memory connected to the processor, wherein:
[0045] The memory is used to store computer programs;
[0046] The processor is used to execute the computer program so that the electronic device can implement the above-mentioned splicing control method.
[0047] The present application provides a splicing control method and related devices. In the present application, based on the initial relative positions of the first splicing element and the second splicing element, the first splicing point in the first splicing element and the second splicing point in the second splicing element are determined, and according to the attribute information of the first splicing point and the attribute information of the second splicing point, the first splicing element and the second splicing element are spliced to obtain an initial splicing body, thereby realizing the splicing operation of the object. In addition, in order to realize the authenticity of the object splicing, physical properties such as the center of gravity will be set so that the spliced body is closer to the real object. Furthermore, the target splicing body can also be subjected to motion control operations, thereby realizing the free interaction between the user and the target splicing body and satisfying the user's motion requirements for the splicing body. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the drawings required for use in the embodiments or the related technical descriptions are briefly introduced below. Obviously, the drawings described below are merely embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0049] Figure 1 A flow chart of a splicing control method provided in an embodiment of the present application;
[0050] Figure 2 A splicing schematic diagram provided for an embodiment of the present application;
[0051] Figure 3 A schematic diagram of a fan provided in an embodiment of the present application;
[0052] Figure 4 is a schematic diagram of a drivable tire provided in an embodiment of the present application;
[0053] Figure 5 A flow chart of a splicing process provided in an embodiment of the present application;
[0054] Figure 6 Another splicing schematic diagram provided for an embodiment of the present application;
[0055] Figure 7 Another splicing schematic diagram provided for an embodiment of the present application;
[0056] Figure 8 Another splicing schematic diagram provided for an embodiment of the present application;
[0057] Fig. 9 A schematic diagram of the structure of a splicing control device provided in an embodiment of the present application;
[0058] Fig.10A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0059] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0060] In order to enable those skilled in the art to have a clearer understanding of the present application, the professional terms in the present application are now explained.
[0061] UGC: UGC is the abbreviation of "User Generated Content", which means user-generated content. It means that users spread their own content through the Internet platform and interact with other users.
[0062] Spliced body: The whole body after splicing is called a spliced body.
[0063] Splicing elements: The objects that make up the splicing body are called splicing elements.
[0064] Blueprint: In object splicing gameplay, blueprint specifically refers to the record of how an object is spliced together. The spliced object can be restored with the help of the blueprint.
[0065] At present, some game software supports UGC function, which can give full play to the creativity of game players and bring more game fun to users. Users can create personalized game objects according to their own needs. For example, users can adjust the color, type, and hairstyle of characters' clothes. Or, users can configure the position and type of decorations in the room. In the construction scene, as user needs continue to increase, some users have the need to splice objects.
[0066] When performing object splicing operations based on user needs, some games support home gameplay. In home gameplay, the splicing method is limited and can only be spliced according to fixed rules, such as limiting a fixed splicing position and only splicing operations can be performed according to this position. Or set the rotation direction of the object and only rotate in the set direction, etc. In addition, the position of the spliced object is fixed and cannot be moved. In addition, the spliced scene is not close to the real scene. Ultimately, the flexibility and performance of UGC splicing will be somewhat lacking.
[0067] To this end, in an embodiment of the present application, based on the initial relative positions of the first splicing element and the second splicing element, a first splicing point in the first splicing element and a second splicing point in the second splicing element are determined, and according to the attribute information of the first splicing point and the attribute information of the second splicing point, a splicing operation is performed on the first splicing element and the second splicing element to obtain an initial splicing body, thereby realizing the splicing operation of the object. The present application supports splicing operations of multiple types of splicing points, reducing the limitations of splicing methods.
[0068] For the spliced body, in order to achieve the authenticity of object splicing, physical properties such as the center of gravity will be set to make the spliced body closer to the splicing of real objects.
[0069] Furthermore, the target spliced body can also be subjected to motion control operations, thereby realizing free interaction between the user and the target spliced body, satisfying the user's motion requirements for the spliced body, and solving the problem in the related art that the position of the spliced object cannot be moved.
[0070] Based on the above content, an embodiment of the present application provides a splicing control method, the execution subject may be an electronic device, and the electronic device may be a device used by a user to play games, such as a computer, a mobile phone, etc.
[0071] Reference Figure 1 , a splicing control method may include:
[0072] S11. Obtain a first splicing element and a second splicing element.
[0073] The first splicing element and the second splicing element refer to the splicing elements that need to be spliced. The types of splicing elements include ordinary splicing elements and special splicing elements. Ordinary splicing elements refer to splicing elements that do not have special physical effects, such as wooden boards, blocks, cubes, etc. Figure 2 As shown, Figure 2 It is a splicing operation for two cuboids. Figure 2 The original circle in the figure indicates the splicing point. When two cuboids are close to each other, the splicing point will be prompted. If the user does not adjust the position of one of the cuboids, the splicing operation will be performed according to the splicing point. If the user adjusts the position of one of the cuboids, a new splicing point may be prompted.
[0074] Special splicing elements can be fans and drivable tires, etc. The schematic diagram of the fan can be as follows Figure 3 The fan has two states: on and off. When the fan is on, a force field with gradually weakening force will be formed at the air outlet. Figure 3 The downward wind force in the fan is used to blow the objects below the fan. In addition, the fan will also give itself a force in the opposite direction of the wind. For details, refer to Figure 3 Since the fan can use wind force and thrust to move the fan up and down, the fan can be spliced into a flying vehicle so that the flying vehicle moves in the air using the force provided by the fan.
[0075] A schematic diagram of a drivable tire may be shown in FIG4 . Figure 4 It is the change before and after the drivable wheel is spliced. Generally speaking, the drivable tire has two axles, one on the left and one on the right. Figure 4 It is to splice the drivable tire with a cuboid. When the drivable tire is spliced, the axle on the other side will be automatically hidden according to the position of the splicing point. Figure 4 As shown, the drivable tire is located on the right side of the rectangular block. At this time, the left axis of the drivable tire is spliced with the rectangular block, and the right axis will be hidden to avoid the problem of poor display effect caused by the abruptness of the right axis due to failure to hide the right axis.
[0076] The drivable tires can accept input from the joystick to change the angle and speed, have the physical effects of vehicle suspension and tire friction, and can be used to splice vehicle-type vehicles.
[0077] In actual scenarios, a large number of splicing elements can be stored in the splicing body library, including the above-mentioned common splicing elements and special splicing elements, and the user can select the splicing elements by means of a mouse or the like.
[0078] When the user selects a splicing element, the first splicing element and the second splicing element can be determined according to the order of the user's selection. If the user selects a splicing element first, the splicing element is called the first splicing element. If the user selects a splicing element again, the splicing element is called the second splicing element. In an embodiment of the present application, it can be set that after selecting the second splicing element, the first splicing element is fixed and the second splicing element is spliced onto the first splicing element. In another embodiment, the first splicing element and the second splicing element can be moved relative to each other, that is, the user can adjust the position and other information of any splicing element.
[0079] It should be noted that, in general, the first splicing element can be a part of a splicing body spliced by multiple splicing elements. For example, if a user wants to assemble a vehicle, a large part has been spliced, and only a tire is missing. In this case, the already assembled part can be called the first splicing element, and the tire to be spliced can be called the second splicing element. In addition, the first splicing element can also be a separate splicing element, such as a wooden block, which is specifically configured according to user needs.
[0080] The second splicing element is generally a separate splicing element, such as a wooden block, a drivable tire, a fan, a block, etc.
[0081] S12: Determine a first splicing point in the first splicing element and a second splicing point in the second splicing element based on initial relative positions of the first splicing element and the second splicing element.
[0082] like Figure 2 As shown, when the first splicing element and the second splicing element are spliced, a splicing point is selected for splicing operation, the first splicing point is a splicing point located in the first splicing element, and the second splicing point is a splicing point located in the second splicing element. The splicing point can be determined based on the initial relative position of the first splicing element and the second splicing element.
[0083] Specifically, based on the initial relative positions of the first splicing element and the second splicing element, determining a first splicing point in the first splicing element and a second splicing point in the second splicing element includes:
[0084] 1) Obtaining the initial relative positions of the first splicing element and the second splicing element before they are spliced together.
[0085] The initial relative position refers to the relative orientation, relative distance, etc. between the first splicing element and the second splicing element.
[0086] The initial relative positions of the first splicing element and the second splicing element when they are not spliced are as follows: Figure 2 The rectangular parallelepiped on the left is the first splicing element, and the rectangular parallelepiped on the right is the second splicing element. The initial relative positions of the two are left-right, and the sides of the two rectangular parallelepipeds are close to each other.
[0087] 2) Based on the initial relative position, a splicing point that is closest to the second splicing element is selected from a plurality of splicing points in the first splicing element and used as the first splicing point.
[0088] Specifically, the user moves the second splicing element close to the first splicing element, which means that the user wants to move the second splicing element close to one side or one surface of the first splicing element and splice it with the first splicing element.
[0089] The edges and faces where the first splicing element and the second splicing element are close to each other are edges and faces that require splicing.
[0090] In actual scenarios, there will be many splicing points on the edge and face of a splicing element. For example, there are 10 splicing points on one side of a cuboid. Although the face of a splicing element is close to the edge or face of another splicing element, since there are multiple splicing points on the face of the splicing element, the optimal splicing point needs to be selected from them. The same is true for splicing lines. There are also multiple splicing points on a line, and the optimal splicing point also needs to be selected from them.
[0091] To this end, in the embodiment of the present application, a splicing point that is closest to the second splicing element may be selected from a plurality of splicing points in the first splicing element, and the selected splicing point may be used as the first splicing point.
[0092] 3) Based on the initial relative position, a splicing point closest to the first splicing element is selected from a plurality of splicing points in the second splicing element, and the splicing point is used as the second splicing point.
[0093] At the same time, based on the initial relative position, a splicing point closest to the first splicing element is selected from a plurality of splicing points in the second splicing element and is used as the second splicing point.
[0094] For the selected first splicing point and the second splicing point, the splicing point has corresponding attribute information, and the attribute information may include type and position, etc.
[0095] The type includes at least one of a surface splicing point and a line splicing point. A surface splicing point refers to a splicing point where the entire surface is spliced with another splicing element. A line splicing point refers to a splicing point where the entire line is spliced with another splicing element.
[0096] In one implementation, the surface splicing points are further subdivided into ordinary surface splicing points and hinge splicing points. When ordinary surface splicing points are used for specific splicing, the surface is directly spliced with another splicing element. Hinge splicing points are a special type of surface splicing point. Unlike surface splicing points, which turn two objects into a whole that cannot move relative to each other after splicing, after the hinge splicing points are spliced, the two objects can rotate freely about the straight line that is perpendicular to the splicing plane and passes through the splicing points. With this feature, players can splice objects such as unpowered cars and seesaws. Taking an unpowered car as an example, the splicing point on the tire is the hinge splicing point. After the tire is spliced with the frame, the tire can rotate relative to the frame to achieve the movement of the car.
[0097] The attribute information of the splicing points can be specified by configuring a table. For example, during the game development process or the game upgrade process, multiple splicing points and their positions, types and other information can be configured in a table. The content in the table can be modified later through maintenance, such as adjusting the position of a splicing point, adjusting the type of a splicing point, increasing the number of splicing points, etc.
[0098] In addition, when two splicing elements are close to each other and are about to be spliced, two splicing points that can be adsorbed will be selected according to the above-mentioned method of the closest distance, and the splicing point prompt operation will be performed. If the user wants to adjust the splicing point, the position of the splicing point to be spliced can be adjusted, thereby adjusting the selected splicing point accordingly.
[0099] S13: Perform a splicing operation on the first splicing element and the second splicing element according to the attribute information of the first splicing point and the attribute information of the second splicing point to obtain an initial splicing body.
[0100] After the first splicing point and the second splicing point and the corresponding attribute information are determined, the first splicing element and the second splicing element may be spliced based on the attribute information of the two splicing points to obtain an initial splicing body.
[0101] In the initial splicing body, the first splicing point and the second splicing point coincide with each other, thereby realizing the splicing of the two splicing elements.
[0102] S14, setting the physical properties of the initial spliced body to obtain a target spliced body.
[0103] Wherein, the physical properties at least include the center of gravity.
[0104] Specifically, after the first splicing element and the second splicing element are spliced into the initial splicing body, since each splicing element will have their physical collision and weight, and the shape, weight, center of gravity and other contents of the first splicing element and the second splicing element are different. When the splicing elements are spliced, the physical properties of these splicing elements will act on the final splicing body according to the type of splicing points and the relative posture between the objects during splicing. If the center of gravity of the target splicing body is not set, the target splicing point will have a suspended effect, which does not conform to the actual object performance. Therefore, in the embodiment of the present application, it is necessary to set the physical properties of the initial splicing body. Generally, the physical properties at least include the center of gravity. The process of setting the center of gravity is:
[0105] By means of a table, weight and center of gravity are configured in advance for each splicing element that can be spliced. Whenever a new splicing element is spliced, the center of gravity of the initial splicing body is recalculated according to the relative position, weight and center of gravity of each splicing element. Specifically, it can be calculated based on the center of gravity calculation formula. After the center of gravity of the initial splicing body is calculated, the center of gravity of the initial splicing body is set to the calculated center of gravity to obtain the target splicing body, so that the target splicing body is closer to the actual splicing effect, improving the flexibility and performance of the splicing.
[0106] S15, performing motion control operations on the target spliced body.
[0107] In this embodiment, after obtaining the target splicing body, the user can operate the target splicing body to move. For example, for an unpowered car, if the car is located on a hillside, the car will move down the hillside due to its own inertia.
[0108] When the target spliced body is a flying vehicle, the flying vehicle is equipped with a fan. For the fan, the user can operate the operating lever in the flying vehicle to control the attitude change of the fan, thereby adjusting the flight attitude of the flying vehicle.
[0109] When the target spliced body is a land vehicle, such as a powered car, the movement of the car can also be controlled based on the operating lever in the flying vehicle.
[0110] It should be noted that the difference between an unpowered car and a powered car is that an unpowered car cannot be controlled by an operating lever and can only move by its own inertia. A powered car can be controlled by an operating lever, such as turning, accelerating, and decelerating.
[0111] In this embodiment, based on the initial relative position of the first splicing element and the second splicing element, the first splicing point in the first splicing element and the second splicing point of the second splicing element are determined, and according to the attribute information of the first splicing point and the attribute information of the second splicing point, the first splicing element and the second splicing element are spliced to obtain an initial splicing body, thereby realizing the splicing operation of the object. In addition, in order to realize the authenticity of the object splicing, physical properties such as the center of gravity are set so that the spliced body is closer to the real object. Furthermore, the target splicing body can also be subjected to motion control operations, thereby realizing the free interaction between the user and the target splicing body and satisfying the user's motion requirements for the splicing body.
[0112] In another implementation of the present application, different splicing points of the splicing elements may have different attribute types, such as different types. In order to realize the splicing of the splicing points in the splicing elements, the splicing logic between the splicing elements can be set. The splicing logic is the basis and beginning of the entire object splicing method. The design core of the splicing logic is to ensure the freedom of hardcore players, allowing them to give full play to their creativity, while also ensuring ease of use during light play. In general, it can be divided into two modes, namely splicing with preset splicing points and free splicing.
[0113] For splicing with preset splicing points, in order to allow players to easily piece together the neat splicing bodies they want, splicing with preset splicing points can be designed. Some splicing points are pre-configured on some specific splicing bodies. The types of splicing points can be the above-mentioned surface splicing points, line splicing points, etc. Then, according to the different types of splicing points, different splicing scenes will be generated. The specific scenes are divided into surface splicing points and surface splicing points splicing scenes, surface splicing points and line splicing points splicing scenes, and line splicing points and line splicing points splicing scenes. In different scenes, the type and position of the splicing points are specified by means of a table. When two objects are close to each other and are about to be spliced, two splicing points that can be adsorbed will be selected (specifically, Figure 2As shown in the figure), two stitching points are stitched together according to their types and their directions are corrected to make the stitching effect neat and orderly. Among them, one stitching point only supports the stitching of one stitching element.
[0114] Now we will introduce different splicing scenarios respectively.
[0115] 1. The type of the first splicing point is a surface splicing point and the type of the second splicing point is a surface splicing point.
[0116] Then, refer to Figure 5 , performing a splicing operation on the first splicing element and the second splicing element according to the attribute information of the first splicing point and the attribute information of the second splicing point to obtain an initial splicing body, including:
[0117] S21. Adjust the position of at least one of the first splicing element and the second splicing element according to the attribute information of the first splicing point and the attribute information of the second splicing point, so that there is at least one contact point between the first splicing element and the second splicing element.
[0118] Specifically, Figure 6 As shown, the surface splicing point refers to the preset splicing point on a plane. When two surface splicing points are spliced, such as Figure 6 As shown in (1), if the second splicing element is spliced onto the first splicing element, the element to be spliced later, i.e., the position of the second splicing element, can be moved so that it fits with the first splicing element. The fit between the two means that the first splicing point and the second splicing point coincide and the normal vectors of the plane where the first splicing point is located and the plane where the second splicing point is located are parallel. In this way, it can be ensured that Figure 6 The two splicing elements including the face splicing points in (1) are composed as follows Figure 6 (2) The splicing structure described in.
[0119] It should be noted that, in the present embodiment, the position of the first splicing element remains stationary, and the second splicing element is moved so that the first splicing element and the second splicing element are spliced together. This is because when splicing the second splicing element, the player has already set the position of the first splicing element, and at this time the player does not want the position of the first splicing element to be adjusted, but only needs to splice the second splicing element into the first splicing element.
[0120] In addition, if there is no position restriction, in addition to arranging to move the second splicing element so that the first splicing element and the second splicing element are spliced, it is also possible to arrange to randomly move at least one of the first splicing element and the second splicing element so that the two splicing elements are spliced.
[0121] S22: Based on the current relative positions of the first splicing element and the second splicing element, perform a direction correction operation on at least one of the first splicing element and the second splicing element to obtain an initial splicing body.
[0122] In actual scenarios, when the second splicing element is spliced into the first splicing element, the user does not adjust the position of the second splicing element properly, so that the splicing angle and direction of the first splicing element and the second splicing element are not what the user needs. For example, the player hopes that after the first splicing element and the second splicing element are spliced together, the first splicing element is perpendicular to the second splicing element. However, in the actual spliced splicing body, the angle between the first splicing element and the second splicing element is 85°, which does not meet the actual player's needs. For another example: the player hopes that the first splicing element and the second splicing element are spliced into the following Figure 6 (3) is a regular splicing body, but the actual splicing is as follows Figure 6 (2) Some splices with relative orientations.
[0123] Therefore, in order to improve user satisfaction, a direction correction operation may be performed on at least one of the first splicing element and the second splicing element based on the current relative positions of the first splicing element and the second splicing element to obtain an initial splicing body.
[0124] When performing the specific direction correction, the direction correction is performed in units of 45 degrees according to the posture during splicing. If the relative orientation of the two splicing elements is closer to 0°, the position of the second splicing element can be adjusted so that the relative orientation of the two splicing elements is 0°. If the relative orientation of the two splicing elements is closer to 45°, the position of the second splicing element can be adjusted so that the relative orientation of the two splicing elements is 45°. For another example, if the relative orientation of the two splicing elements is closer to 90°, the position of the second splicing element can be adjusted so that the relative orientation of the two splicing elements is 90°. Other angles are similar, and other angles are multiples of 45°, such as 135°, 180°, etc.
[0125] In this embodiment, through the above correction, the player can easily align and splice two identical cubes together. The specific situation of splicing correction is as follows: Figure 6 shown.
[0126] In another embodiment of the present application, since the surface splicing points are specifically subdivided into ordinary surface splicing points and hinge splicing points, ordinary surface splicing points directly splice the surface with another splicing element during splicing. Hinge splicing points are a special type of surface splicing point. Unlike surface splicing points, which will turn two objects into a whole that cannot move relative to each other after splicing, after the hinge splicing points are spliced, the two objects can rotate freely with the straight line perpendicular to the splicing plane and passing through the splicing point as the axis.
[0127] In order to realize the free rotation of the hinge splicing point, if at least one of the first splicing point and the second splicing point is a hinge splicing point among surface splicing points, a hinge joint is configured on the first splicing point or the second splicing point so that the first splicing element and the second splicing element can rotate freely about a straight line perpendicular to the splicing plane and passing through the first splicing point or the second splicing point as an axis.
[0128] It should be noted that, since the first splicing point and the second splicing point overlap after being spliced, there is only one splicing point at this time, that is, the first splicing point and the second splicing point are the same splicing point.
[0129] In this embodiment, hinge joints are specially set. All joints except hinge joints will make the object a whole rigid body. There will be no relative displacement between them. However, after splicing through hinge joints, two rigid bodies connected by hinge joints will be formed. Relative movement can be formed between the splicing elements, thereby realizing the movement of the object.
[0130] 2. The type of the first splicing point is a surface splicing point and the type of the second splicing point is a line splicing point.
[0131] At this time, performing a splicing operation on the first splicing element and the second splicing element according to the attribute information of the first splicing point and the attribute information of the second splicing point to obtain an initial splicing body may include:
[0132] 1) According to the attribute information of the first splicing point and the attribute information of the second splicing point, adjusting the position of at least one of the first splicing element and the second splicing element so that there is at least one contact point between the first splicing element and the second splicing element.
[0133] For some thin joints (such as wooden boards), some joint points will be preset on their thin edges. These joint points are regarded as linear joint points. Figure 7 As shown, the upper wooden board is a splicing element including linear splicing points, namely, the second splicing element, and the lower wooden board is a splicing element including planar splicing points, namely, the first splicing element.
[0134] When stitching, first adjust the position of the second stitching element so that the first stitching point and the second stitching point coincide and the normal vector of the edge where the first stitching point is located is perpendicular to the plane where the second stitching point is located. At this time, the line where the linear stitching point is located will fit the plane where the face stitching point is located, achieving Figure 7 The two splicing elements in (1) are composed as follows Figure 7 (2) The splicing structure described in.
[0135] The specific implementation process of this step is similar to the splicing process of the two surface splicing points mentioned above.
[0136] 2) Based on the current relative positions of the first splicing element and the second splicing element, a direction correction operation is performed on at least one of the first splicing element and the second splicing element to obtain an initial splicing body.
[0137] In this embodiment, the direction correction rules of the surface splicing points and the line splicing points are more complicated. When the direction correction is performed, the direction correction is performed in units of 45 degrees. The process of direction correction is as follows:
[0138] 1) The specified edge of the line where the linear splicing point is located and the plane where the surface splicing point is located (such as Figure 7 If the tilt angle is closer to 0°, the position of the second splicing element can be adjusted so that the relative orientation of the line where the linear splicing point is located and the designated edge of the plane where the type splicing point is located is 0°. Similarly, if the tilt angle is closer to 45°, the position of the second splicing element can be adjusted so that the relative orientation of the line where the linear splicing point is located and the designated edge of the plane where the type splicing point is located is 45°. For another example, if the tilt angle is closer to 90°, the position of the second splicing element can be adjusted so that the relative orientation of the line where the linear splicing point is located and the designated edge of the plane where the type splicing point is located is 90°. Other angles are similar, and other angles are multiples of 45°, such as 135°, 180°, etc.
[0139] 2) If the relative angle between the normal vectors of the line where the linear splicing point is located and the plane where the face splicing point is located is closer to 0°, the position of the second splicing element can be adjusted so that the relative angle between the normal vectors of the line where the linear splicing point is located and the plane where the face splicing point is located is 0°. If the relative angle is closer to 45°, the position of the second splicing element can be adjusted so that the relative angle between the normal vectors of the line where the linear splicing point is located and the plane where the face splicing point is located is 45°. If the relative angle is closer to 90°, the position of the second splicing element can be adjusted so that the relative angle between the normal vectors of the line where the linear splicing point is located and the plane where the face splicing point is located is 90°. Other angles are similar, and other angles are multiples of 45°, such as 135°, 180°, etc.
[0140] like Figure 7 As shown in (2) and (3), after correction, the included angle between the board and the bottom plane (including the angles in the above two cases) is always a multiple of 45 degrees.
[0141] 3. The type of the first splicing point is a linear splicing point and the type of the second splicing point is a linear splicing point.
[0142] At this time, according to the attribute information of the first splicing point and the attribute information of the second splicing point, the first splicing element and the second splicing element are spliced to obtain an initial splicing body, including:
[0143] 1) According to the attribute information of the first splicing point and the attribute information of the second splicing point, adjusting the position of at least one of the first splicing element and the second splicing element so that there is at least one contact point between the first splicing element and the second splicing element.
[0144] The existence of at least one contact point between the first splicing element and the second splicing element means that the first splicing point and the second splicing point overlap.
[0145] Specifically, examples of the splicing of line-type splicing points and line-type splicing points can be as follows: Figure 8 As shown, Figure 8 In the embodiment, the first splicing element is a partially spliced body composed of two wooden boards, the second splicing element is also a wooden board, and one edge of the second splicing element is spliced with one edge of the first splicing element. In this case, two linear splicing points are spliced.
[0146] When splicing, first adjust the position of the second splicing element so that the first splicing point and the second splicing point coincide with each other. Figure 8 As shown, at this time, only two linear splicing points overlap, but the line where the linear splicing point of the first splicing element is located and the edge where the linear splicing point of the second splicing element is located have not been spliced.
[0147] 2) Based on the current relative positions of the first splicing element and the second splicing element, a direction correction operation is performed on at least one of the first splicing element and the second splicing element to obtain an initial splicing body.
[0148] When performing direction correction, the connection between two linear joint points is relatively arbitrary, and it is sufficient that the relative rotation of the two joint elements on each axis (i.e., x, y, and z axes) is a multiple of 45 degrees. Specifically, if the component on a certain axis is close to 0°, the component on that axis can be set to 0°; if the component on a certain axis is close to 45°, the component on that axis can be set to 45°, and the same applies to other angles.
[0149] After the above-mentioned direction correction, the splicing seems to be random, but the splicing elements can be kept relatively orderly, such as Figure 8 In the figure, after the splicing elements are spliced together, the left wooden board in the first splicing element is parallel to the second splicing element.
[0150] In addition to the above-mentioned splicing of face-type splicing points and face-type splicing points, face-type splicing points and linear splicing points, and linear splicing points and linear splicing points, there is also splicing without preset splicing points, which is free splicing. Free splicing means that when two splicing elements are to be spliced and no suitable splicing points are found within a certain range, the two splicing elements will be spliced with the closest point to each other as the splicing point. This splicing mode ensures the freedom of splicing.
[0151] In this embodiment, two modes of splicing are set, namely, splicing with preset splicing points and free splicing, so that free splicing can be performed according to user needs, ensuring the flexibility, freedom and ease of use of players when splicing, and giving full play to the creativity of players.
[0152] In another implementation of the present application, the implementation of motion control operation on the target spliced body is introduced.
[0153] According to the above description, there are special splicing elements, such as fans and drivable tires, which can move relatively after being driven. Taking the drivable tires in land vehicles as an example, unlike the traditional vehicle operation method, in this embodiment, the relative position of the tires in the vehicle cannot be preset. Therefore, a set of vehicle control algorithms suitable for object splicing has been developed to allow players to assemble vehicles at will as much as possible. The vehicle control algorithms can be divided into land vehicles and flying vehicles.
[0154] In the embodiment of the present application, when the target splicing body includes a special splicing element and the special splicing element is a drivable tire, the motion control operation on the target splicing body includes:
[0155] 1) Receive control instructions input through the joystick.
[0156] In practical applications, the target assembly body including the drivable tires is a land vehicle. In order to realize the driving of the drivable tires, a special assembly element-an operating rod needs to be installed on the land vehicle. The operating rod can drive the tires and the fan, so that the drivable tires and the fan can move, thereby realizing the movement of the land vehicle and the flying vehicle.
[0157] It should be noted that there is no limitation on when the operating rod and the drivable tire are spliced to the land vehicle, as long as the target spliced body obtained by the final splicing includes the operating rod and the drivable tire.
[0158] In order to enable the user to control the drivable tires through the operating lever, in the embodiment of the present application, since the power source of the land vehicle is the drivable tires, after the user gives an input through the operating lever (the input can be called a control instruction), the control instruction input by the user through the operating lever can be received, and the control instruction is a two-dimensional vector.
[0159] 2) Decomposing the control instruction to obtain a first direction instruction and a second direction instruction.
[0160] For land vehicles, such as a powered car, the car can move forward and backward, such as accelerating and decelerating, or left and right, such as turning, while driving. At this time, the above two-dimensional vector can be decomposed into a first direction instruction and a second direction instruction.
[0161] The first direction instruction is the left-right direction, and the second direction instruction is the front-back direction. That is, after the user gives an input through the joystick, the operation algorithm will decompose the output into the front-back direction input and the left-right direction input. The left-right direction input is the first direction instruction, and the front-back direction input is the second direction instruction.
[0162] 3) In a first direction, based on the relative position between the drivable tire and the target splicing body and the first direction instruction, calculating the rotation angle of the drivable tire.
[0163] Specifically, the powered car rotates in the left and right directions, such as turning left, turning right, etc. Since the powered car has multiple drivable tires, it is necessary to determine the rotation angle of each drivable tire in turn.
[0164] It should be noted that there is not necessarily a specified number of powered vehicles, such as 4 drivable tires, there may be 3, 2, 5, etc. drivable tires.
[0165] At this time, for each drivable tire, the rotation angle of the drivable tire can be calculated based on the relative position of the tire and the target splicing body, such as when the tire is on the left front side of the powered car, based on the first direction instruction, and the specific calculation process can use the corresponding calculation formula.
[0166] It should be noted that for the drivable tires at different positions in the same powered car, due to their different relative positions with the powered car, the rotation angles of the different drivable tires are different. For example, when turning left, the rotation angles of the left front wheel and the right front wheel are different, the left front wheel has a smaller rotation angle, and the right front wheel has a larger rotation angle. In addition, the tires before and after the operating lever have different rotation directions. For example, when turning left, the left front wheel needs to turn left, but the left rear wheel needs to turn right.
[0167] 4) In a second direction, based on the relative position between the drivable tire and the target splicing body and the second direction instruction, calculating the rotation speed of the drivable tire.
[0168] In the front-to-back direction, the rotation speed of each drivable tire is determined according to the input front-to-back direction component and the relative position of the drivable tire and the target splicing body, and the corresponding calculation formula is used for the specific calculation.
[0169] When traveling straight, the rotation speeds of different drivable tires are the same, but when turning, the rotation speeds of different drivable tires are different, which is determined by the relative positions of the drivable tires and the target splicing body.
[0170] 5) Controlling the movement of the drivable tire according to the rotation angle and the rotation speed.
[0171] In this embodiment, for each drivable tire, a driving force is applied to the tire according to the rotation angle and the rotation speed corresponding to the tire to make it move.
[0172] It should be noted that after the player assembles a balanced land vehicle, the player can control the forward, backward, turning, etc. of the land vehicle based on the joystick, realizing the free interaction between the user and the assembled body.
[0173] Since the splicing body in the present application is movable, the implementation methods of the splicing body are enriched and the user experience is improved.
[0174] In another implementation of the present application, if the special splicing element is a fan, the fan can be spliced into an aircraft, and the power source of the aircraft is the fan. The operating algorithm will gradually reduce the size of the wind according to the altitude to limit the maximum flight altitude of the aircraft.
[0175] On this basis, the motion control operation on the target spliced body may include:
[0176] 1) Receive the target torque input through the operating lever.
[0177] Specifically, the user may input a control instruction through the joystick, and the control instruction may be a target torque value, and the flight control of the flying vehicle needs to be performed according to the target torque value.
[0178] 2) Adjusting the motion posture of the target spliced body based on the target torque.
[0179] In this embodiment, during the normal driving of the aircraft, the operating algorithm will also adjust the motion posture of the aircraft according to the target torque, so that the aircraft is tilted in the direction of travel to move the aircraft forward.
[0180] When adjusting the motion posture of the flying vehicle according to the target torque, the greater the torque, the greater the adjustment angle of the motion posture, and the smaller the torque, the smaller the adjustment angle of the motion posture.
[0181] 3) During the movement of the target splicing body, if the inclination angle of the target splicing body is greater than a preset angle, the movement posture of the target splicing body is adjusted by applying a torque in a reverse direction so that the target splicing body maintains balance.
[0182] Specifically, the wind in the game scene is real. In actual scenes, it is unlikely that players can assemble an absolutely balanced vehicle, so during the flight of the vehicle, the operating algorithm will always maintain the tilt angle of the vehicle relative to the balanced position. When the tilt angle of the flying vehicle is greater than the preset angle, the algorithm will provide a reverse torque to adjust the movement posture of the target assembly so that the vehicle remains balanced.
[0183] In this embodiment, special splicing elements are introduced, such as fans, drivable tires, operating levers, etc., so that the types of splicing elements are more diverse. In addition to being able to splice conventional splicing bodies, flying vehicles and land vehicles can also be spliced together, so that the splicing body has a more realistic physical effect, and a variety of drivable vehicles can be spliced together, and simple and easy-to-use control methods are provided for the vehicles, allowing players to better explore the game world with the help of splicing gameplay.
[0184] In another implementation of the present application, when a player completes a more complex splicing body, in order to avoid tedious repetitive operations next time, the present application embodiment provides a blueprint function. The player can save the splicing result and generate a blueprint. Later, the splicing body can be restored with one click according to the saved blueprint, and the blueprint is also easy to share among players.
[0185] Specifically, after the motion control operation is performed on the target spliced body, the splicing information of the target spliced body is recorded. The splicing information may be recorded in a JSON (JavaScript Object Notation) file.
[0186] The splicing information at least includes parameter information of each splicing element constituting the target splicing body, splicing element connection information, and position information of the splicing elements relative to the target splicing body.
[0187] Among them, for a splicing body, it is composed of multiple splicing elements. For each splicing element in the splicing body, the information to be recorded is as follows:
[0188] 1. Parameter information.
[0189] The parameter information specifically includes the logical ID (Identity document, unique code, which can be obtained by sorting the various splicing elements in the splicing body. The sorting method is not limited, such as sorting in the order of splicing), the resource ID of the splicing element configured in the table, etc. Among them, the resource ID is used to characterize which splicing element is used. Different splicing elements have different resource IDs. For example, wooden boards, drivable tires, blocks, fans, etc. correspond to different resource IDs. It should be noted that the resource IDs of large blocks and small blocks are different, that is, as long as the two splicing elements are different in size and shape, they have different resource IDs.
[0190] 2. Splice element connection information.
[0191] Among them, each splicing element may be connected to multiple splicing elements, so the splicing element connection information can be displayed in the form of an array, and each element in the array contains the following information:
[0192] The logical ID of the connected splicing element and the ID of the splicing point (-1 if it is a free splicing).
[0193] 3. The position information of the splicing element relative to the target splicing body.
[0194] The position information specifically includes the position information of the splicing element with the splicing body coordinate origin as a reference object, the rotation information of the splicing element with the splicing body as a reference object, and the like.
[0195] After the splicing of the splicing body is completed, the user can use the blueprint function when he goes online again after going offline. By selecting the splicing information, a trigger instruction for the splicing information can be received, and then the trigger instruction is responded to to splice the various splicing elements constituting the target splicing body into the target splicing body according to the splicing information.
[0196] In this embodiment, after the splicing is completed, in order to allow players to easily save and reproduce their own splicing bodies without having to re-splice them every time, the embodiment of the present application will record the splicing information, so as to restore the splicing method of the splicing body based on the blueprint function and the splicing information, thereby realizing the preservation and restoration of the splicing body.
[0197] It should be noted that in the embodiment of the present application, when splicing, one only needs to pay attention to the structure of the spliced body obtained by the final splicing, record its splicing information, and use the splicing information to restore the spliced body. There is no need to record the splicing process. The user does not need to pay attention to how to splice the spliced body during restoration. At this time, the spliced body can be restored according to the principle of the fastest speed or the simplest splicing method.
[0198] Based on the above-mentioned embodiment of the splicing control method, another embodiment of the present application provides a splicing control device, referring to Fig. 9 ,include:
[0199] An element acquisition module 11 is used to acquire a first splicing element and a second splicing element;
[0200] A splicing point determination module 12, configured to determine a first splicing point in the first splicing element and a second splicing point in the second splicing element based on an initial relative position of the first splicing element and the second splicing element;
[0201] A splicing module 13, configured to perform a splicing operation on the first splicing element and the second splicing element according to the attribute information of the first splicing point and the attribute information of the second splicing point to obtain an initial splicing body;
[0202] A setting module 14 is used to set the physical properties of the initial spliced body to obtain a target spliced body; the physical properties at least include the center of gravity;
[0203] The motion control module 15 is used to perform motion control operations on the target spliced body.
[0204] In one implementation, the splicing point determination module 12 includes:
[0205] A position acquisition submodule, used for acquiring the initial relative position of the first splicing element and the second splicing element when they are not spliced together;
[0206] A first splicing point determination submodule, configured to select, based on the initial relative position, from a plurality of splicing points in the first splicing element, a splicing point that is closest to the second splicing element and use the splicing point as a first splicing point;
[0207] The second splicing point determination submodule is used to select, based on the initial relative position, a splicing point that is closest to the first splicing element from a plurality of splicing points in the second splicing element, and use the splicing point as the second splicing point.
[0208] In one implementation, the attribute information includes a type; the type includes at least one of a surface splicing point and a line splicing point;
[0209] The splicing module 13 includes:
[0210] a splicing submodule, configured to adjust a position of at least one of the first splicing element and the second splicing element according to the attribute information of the first splicing point and the attribute information of the second splicing point, so that the first splicing element and the second splicing element have at least one contact point;
[0211] The direction correction submodule is used to perform a direction correction operation on at least one of the first splicing element and the second splicing element based on the current relative positions of the first splicing element and the second splicing element to obtain an initial splicing body.
[0212] In one implementation, when the type of the first splicing point is a plane splicing point and the type of the second splicing point is a plane splicing point, there is at least one contact point between the first splicing element and the second splicing element: the first splicing point and the second splicing point coincide with each other and the normal vectors of the plane where the first splicing point is located and the plane where the second splicing point is located are parallel;
[0213] In the case where the type of the first splicing point is a surface splicing point and the type of the second splicing point is a line splicing point, there is at least one contact point between the first splicing element and the second splicing element: the first splicing point and the second splicing point coincide with each other and the normal vectors of the edge where the first splicing point is located and the plane where the second splicing point is located are perpendicular;
[0214] In the case where the first splicing point is a linear splicing point and the second splicing point is a linear splicing point, there is at least one contact point between the first splicing element and the second splicing element: the first splicing point and the second splicing point overlap.
[0215] In one implementation, the splicing module 13 further includes:
[0216] A joint configuration submodule is used to configure a hinge joint on the first splicing point or the second splicing point if at least one of the first splicing point and the second splicing point is a hinge splicing point in a surface splicing point, so that the first splicing element and the second splicing element can rotate freely around a straight line that is perpendicular to the splicing plane and passes through the first splicing point or the second splicing point as an axis.
[0217] In one implementation, when the target splicing body includes special splicing elements, the motion control module 15 includes:
[0218] An instruction receiving submodule, used for receiving a control instruction inputted through an operating lever if the special splicing element is a drivable tire;
[0219] A decomposition submodule, used for decomposing the control instruction to obtain a first direction instruction and a second direction instruction;
[0220] An angle calculation submodule, configured to calculate a rotation angle of the drivable tire in a first direction based on a relative position between the drivable tire and the target splicing body and the first direction instruction;
[0221] a speed calculation submodule, configured to calculate a rotation speed of the drivable tire in a second direction based on a relative position between the drivable tire and the target splicing body and the second direction instruction;
[0222] The tire control submodule is used to control the movement of the drivable tire according to the rotation angle and the rotation speed.
[0223] In one implementation, the motion control module 15 further includes:
[0224] A torque receiving submodule, used for receiving a target torque inputted through an operating lever if the special splicing element is a fan;
[0225] A posture adjustment submodule, used for adjusting the motion posture of the target spliced body based on the target torque;
[0226] The balance control submodule is used to adjust the movement posture of the target splicing body by applying a reverse torque during the movement of the target splicing body if the inclination angle of the target splicing body is greater than a preset angle, so that the target splicing body maintains balance.
[0227] In one implementation, the method further includes:
[0228] An information recording module, used for recording the splicing information of the target splicing body, wherein the splicing information at least includes parameter information of each splicing element constituting the target splicing body, splicing element connection information, and position information of the splicing element relative to the target splicing body;
[0229] The splicing body restoration module is used for, if receiving a trigger instruction for the splicing information, responding to the trigger instruction, splicing the various splicing elements constituting the target splicing body into the target splicing body according to the splicing information.
[0230] In this embodiment, based on the initial relative position of the first splicing element and the second splicing element, the first splicing point in the first splicing element and the second splicing point of the second splicing element are determined, and according to the attribute information of the first splicing point and the attribute information of the second splicing point, the first splicing element and the second splicing element are spliced to obtain an initial splicing body, thereby realizing the splicing operation of the object. In addition, in order to realize the authenticity of the object splicing, physical properties such as the center of gravity are set so that the spliced body is closer to the real object. Furthermore, the target splicing body can also be subjected to motion control operations, thereby realizing the free interaction between the user and the target splicing body and satisfying the user's motion requirements for the splicing body.
[0231] It should be noted that, for the working process of each module and sub-module in this embodiment, please refer to the corresponding description in the above embodiment, which will not be repeated here.
[0232] An embodiment of the present application also provides an electronic device, including at least one processor and a memory connected to the processor, wherein:
[0233] The memory is used to store computer programs;
[0234] The processor is used to execute the computer program so that the electronic device can implement the above-mentioned splicing control method.
[0235] refer to Fig.10 As shown, it shows a schematic diagram of the structure of an electronic device suitable for implementing the embodiment of the present application. The electronic device in the embodiment of the present application may include but is not limited to fixed terminals such as mobile phones, laptops, PDAs (personal digital assistants), PADs (tablet computers), desktop computers, etc. Fig.10 The electronic device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0236] like Fig.10 As shown, the electronic device may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage device 608 to a random access memory (RAM) 603. When the electronic device is powered on, various programs and data required for the operation of the electronic device are also stored in the RAM 603. The processing device 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0237] Typically, the following devices may be connected to the I / O interface 605: an input device 606 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 608 including, for example, a memory card, a hard disk, etc.; and a communication device 609. The communication device 609 may allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. Although Fig.10 An electronic device having various devices is shown, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.
[0238] An embodiment of the present application also provides a computer program product including computer-readable instructions. When the computer-readable instructions are executed on an electronic device, the electronic device implements any splicing control method provided in the embodiment of the present application.
[0239] A computer-readable storage medium is also provided in an embodiment of the present application. The storage medium carries one or more computer programs. When the one or more computer programs are executed by an electronic device, the electronic device can implement any splicing control method provided in the embodiment of the present application.
[0240] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A splicing control method, characterized in that: include: Get the first splicing element and the second splicing element; Determining a first splicing point in the first splicing element and a second splicing point in the second splicing element based on an initial relative position of the first splicing element and the second splicing element; According to the attribute information of the first splicing point and the attribute information of the second splicing point, a splicing operation is performed on the first splicing element and the second splicing element to obtain an initial splicing body; Setting the physical properties of the initial spliced body to obtain a target spliced body; the physical properties at least include the center of gravity; A motion control operation is performed on the target spliced body.
2. The splicing control method according to claim 1, characterized in that: Determining a first splicing point in the first splicing element and a second splicing point in the second splicing element based on initial relative positions of the first splicing element and the second splicing element includes: Obtaining the initial relative positions of the first splicing element and the second splicing element when they are not spliced together; Based on the initial relative position, selecting a splicing point that is closest to the second splicing element from a plurality of splicing points in the first splicing element and using it as a first splicing point; Based on the initial relative position, a splicing point that is closest to the first splicing element is selected from a plurality of splicing points in the second splicing element and is used as the second splicing point.
3. The splicing control method according to claim 1, characterized in that: The attribute information includes a type; the type includes at least one of a surface splicing point and a line splicing point; The method of performing a splicing operation on the first splicing element and the second splicing element according to the attribute information of the first splicing point and the attribute information of the second splicing point to obtain an initial splicing body includes: According to the attribute information of the first splicing point and the attribute information of the second splicing point, adjust the position of at least one of the first splicing element and the second splicing element so that there is at least one contact point between the first splicing element and the second splicing element; Based on the current relative positions of the first splicing element and the second splicing element, a direction correction operation is performed on at least one of the first splicing element and the second splicing element to obtain an initial splicing body.
4. The splicing control method according to claim 3, characterized in that: In the case where the type of the first splicing point is a surface splicing point and the type of the second splicing point is a surface splicing point, there is at least one contact point between the first splicing element and the second splicing element: the first splicing point and the second splicing point coincide with each other and the normal vectors of the plane where the first splicing point is located and the plane where the second splicing point is located are parallel; In the case where the type of the first splicing point is a surface splicing point and the type of the second splicing point is a line splicing point, there is at least one contact point between the first splicing element and the second splicing element: the first splicing point and the second splicing point coincide with each other and the normal vectors of the edge where the first splicing point is located and the plane where the second splicing point is located are perpendicular; In the case where the first splicing point is a linear splicing point and the second splicing point is a linear splicing point, there is at least one contact point between the first splicing element and the second splicing element: the first splicing point and the second splicing point overlap.
5. The splicing control method according to claim 3, characterized in that: After performing a direction correction operation on at least one of the first splicing element and the second splicing element based on the current relative positions of the first splicing element and the second splicing element to obtain an initial splicing body, the method further includes: If at least one of the first splicing point and the second splicing point is a hinge splicing point among surface splicing points, a hinge joint is configured on the first splicing point or the second splicing point so that the first splicing element and the second splicing element can rotate freely around a straight line that is perpendicular to the splicing plane and passes through the first splicing point or the second splicing point.
6. The splicing control method according to claim 1, characterized in that: In the case where the target splicing body includes a special splicing element, performing a motion control operation on the target splicing body includes: If the special splicing element is a drivable tire, receiving a control instruction inputted through the operating lever; Decomposing the control instruction to obtain a first direction instruction and a second direction instruction; In a first direction, based on the relative position between the drivable tire and the target splicing body and the first direction instruction, calculating the rotation angle of the drivable tire; In a second direction, based on the relative position of the drivable tire and the target splicing body and the second direction instruction, calculating the rotation speed of the drivable tire; The movement of the drivable tire is controlled according to the rotation angle and the rotation speed.
7. The splicing control method according to claim 6, characterized in that: The step of performing motion control operation on the target spliced body further includes: If the special splicing element is a fan, receiving a target torque inputted through an operating lever; adjusting the motion posture of the target spliced body based on the target torque; During the movement of the target splicing body, if the inclination angle of the target splicing body is greater than a preset angle, the movement posture of the target splicing body is adjusted by applying a torque in a reverse direction so that the target splicing body maintains balance.
8. The splicing control method according to claim 1, characterized in that: After the motion control operation is performed on the target spliced body, the method further includes: Recording the splicing information of the target splicing body, the splicing information at least includes parameter information of each splicing element constituting the target splicing body, splicing element connection information, and position information of the splicing element relative to the target splicing body; If a trigger instruction for the splicing information is received, in response to the trigger instruction, the various splicing elements constituting the target splicing body are spliced into the target splicing body according to the splicing information.
9. A splicing control device, characterized in that: include: An element acquisition module, used to acquire a first splicing element and a second splicing element; a splicing point determination module, configured to determine a first splicing point in the first splicing element and a second splicing point in the second splicing element based on an initial relative position of the first splicing element and the second splicing element; A splicing module, configured to perform a splicing operation on the first splicing element and the second splicing element according to the attribute information of the first splicing point and the attribute information of the second splicing point to obtain an initial splicing body; A setting module, used for setting the physical properties of the initial spliced body to obtain a target spliced body; the physical properties at least include the center of gravity; The motion control module is used to perform motion control operations on the target splicing body.
10. An electronic device, characterized in that: The method comprises at least one processor and a memory connected to the processor, wherein: The memory is used to store computer programs; The processor is used to execute the computer program so that the electronic device can implement the splicing control method as described in any one of claims 1 to 8.
Citation Information
Patent Citations
Object creation method and device
CN114255310A
Device and method of analysing an object for 3D printing
US20190270251A1