A splicing control method and related device
By determining the splicing points and setting physical properties, the problem of restricted splicing methods in the game software is solved, the authenticity of objects and user interaction is realized, and the flexibility and performance effect of splicing bodies are improved.
Patent Information
- Application Number
- CN202411820205.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-11
- Publication Date
- 2025-07-08
- Estimated Expiration
- 2044-12-11
AI Technical Summary
In the object splicing operation driven by user requirements, existing game software has problems such as restricted splicing methods, fixed positions, limited rotation directions, and the scene after splicing is not close to the real scene, resulting in lack of flexibility and performance effects of UGC splicing.
By obtaining the initial relative positions of the first and second splicing elements, determining the splicing points, and performing splicing operations based on the attribute information of the splicing points, setting physical attributes such as the center of gravity, realizing splicing and motion control of objects, and supporting operations of multiple types of splicing points and special splicing elements.
It realizes the authenticity and flexibility of object splicing, allows users to interact freely and control motion, meets users' diverse needs for splicing, and improves the authenticity and user experience of splicing.
Smart Images

Figure CN119565147B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of object splicing, and more specifically, to a splicing control method and related devices. Background Art
[0002] Currently, 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 and type of the character's clothes, the hairstyle of the character, etc. Or, users can configure the position and type of the room decorations. In the context of building a scene, as the user's needs increase, some users have the need for object splicing.
[0003] Then, how to perform object splicing operations based on user needs is a technical problem that those skilled in the art urgently need to solve. Summary of the Invention
[0004] In view of this, this 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] To solve the above technical problem, this application adopts the following technical solutions:
[0006] A splicing control method includes:
[0007] Obtain a first splicing element and a second splicing element;
[0008] Based on the initial relative positions of the first splicing element and the second splicing element, determine a first splicing point in the first splicing element and a second splicing point in the second splicing element;
[0009] According to the attribute information of the first splicing point and the attribute information of the second splicing point, perform a splicing operation on the first splicing element and the second splicing element to obtain an initial spliced body;
[0010] Set the physical attributes of the initial spliced body to obtain a target spliced body; the physical attributes at least include the center of gravity;
[0011] Perform a motion control operation on the target spliced body.
[0012] Optionally, 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:
[0013] Obtain the initial relative positions of the first splicing element and the second splicing element when they are not spliced;
[0014] Based on the initial relative position, select, from among multiple splicing points in the first splicing element, the splicing point that is closest to the second splicing element, and use it as the first splicing point;
[0015] Based on the initial relative position, select, from among multiple splicing points in the second splicing element, the splicing point that is closest to the first splicing element, and use it as the second splicing point.
[0016] Optionally, the attribute information includes type; the type includes at least one of a surface splicing point and a linear splicing point;
[0017] 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 spliced body, including:
[0018] Adjust the positions 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;
[0019] Based on the current relative position 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 spliced body.
[0020] Optionally, 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 and the normal vectors of the planes where the first splicing point and the second splicing point are 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 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 coincide and the side where the first splicing point is located is perpendicular to the normal vector of the plane where the second splicing point is located;
[0022] In the case where 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, 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.
[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 position of the first splicing element and the second splicing element to obtain an initial spliced 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 the surface splicing points, a hinge joint is configured at the first splicing point or the second splicing point, so that the first splicing element and the second splicing element can freely rotate about an axis perpendicular to the splicing plane and passing through the first splicing point or the second splicing point.
[0025] Optionally, when the target spliced body includes a special splicing 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 input through an operating lever;
[0027] Performing a decomposition operation on the control instruction to obtain a first direction instruction and a second direction instruction;
[0028] In a first direction, calculating a rotation angle of the drivable tire based on the relative position between the drivable tire and the target spliced body and the first direction instruction;
[0029] In a second direction, calculating a rotation speed of the drivable tire based on the relative position between the drivable tire and the target spliced body and the second direction instruction;
[0030] Controlling the movement of the drivable tire 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 input 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 spliced body, if the inclination angle of the target spliced body is greater than a preset angle, adjusting the motion posture of the target spliced body by applying a reverse torque to keep the target spliced body balanced.
[0035] Optionally, after performing a motion control operation on the target spliced body, the method further includes:
[0036] Record the splicing information of the target spliced body, where the splicing information at least includes parameter information of each splicing element constituting the target spliced body, splicing element connection information, and position information of the splicing element relative to the target spliced body;
[0037] If a trigger instruction for the splicing information is received, in response to the trigger instruction, splice each splicing element constituting the target spliced body into the target spliced body according to the splicing information.
[0038] A splicing control device, comprising:
[0039] An element acquisition module, configured 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 the initial relative positions 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 spliced body;
[0042] A setting module, configured to set physical attributes of the initial spliced body to obtain a target spliced body; the physical attributes at least include the center of gravity;
[0043] A motion control module, configured to perform a motion control operation on the target spliced body.
[0044] An electronic device, comprising at least one processor and a memory connected to the processor, wherein:
[0045] The memory is used to store a computer program;
[0046] The processor is configured 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. 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 spliced body, realizing the splicing operation of an object. In addition, in order to achieve the authenticity of object splicing, physical attributes such as the center of gravity are set to make the spliced body obtained by splicing closer to a real object. Further, motion control operations can also be performed on the target spliced body, realizing free interaction between the user and the target spliced body and meeting the user's motion requirements for the spliced body. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following will briefly introduce the drawings required for use in the description of the embodiments or related technologies. Obviously, the drawings in the following description are only the embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained according to the provided drawings without creative efforts.
[0049] Figure 1 It is a flowchart of a splicing control method provided by an embodiment of the present application;
[0050] Figure 2 It is a splicing schematic diagram provided by an embodiment of the present application;
[0051] Figure 3 It is a schematic diagram of a fan provided by an embodiment of the present application;
[0052] Figure 4 It is a schematic diagram of a drivable tire provided by an embodiment of the present application;
[0053] Figure 5 It is a flowchart of a splicing process provided by an embodiment of the present application;
[0054] Figure 6 It is another splicing schematic diagram provided by an embodiment of the present application;
[0055] Figure 7 It is still another splicing schematic diagram provided by an embodiment of the present application;
[0056] Figure 8 It is yet another splicing schematic diagram provided by an embodiment of the present application;
[0057] Figure 9 It is a structural schematic diagram of a splicing control device provided by an embodiment of the present application;
[0058] Figure 10Schematic diagram of a structure of an electronic device provided by an embodiment of the present application. Detailed implementation manners
[0059] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present application without creative efforts shall fall within the protection scope of the present application.
[0060] In order for those skilled in the art to better understand the present application, the professional terms in the present application will now be explained.
[0061] UGC: UGC is the abbreviation of "User Generated Content", that is, user-generated content, which means that users spread the content they produce through the Internet platform and interact with other users.
[0062] Spliced body: A completed whole after splicing is called a spliced body.
[0063] Splicing element: Each object that constitutes a spliced body is called a splicing element.
[0064] Blueprint: In the object splicing gameplay, a blueprint specifically refers to a record of the splicing method of a spliced object, and the spliced body can be restored with the help of the blueprint.
[0065] Currently, some game software supports the UGC function. UGC can bring out the creativity of game players and bring more gaming fun to users. Users can create personalized game objects according to their own needs. For example, users can adjust the color and type of the character's clothes, the hairstyle of the character, etc. Or, users can configure the position and type of the decorations in the room. In the context of building a scene, as the needs of users continue to increase, some users have the need for object splicing.
[0066] When performing object splicing operations based on user needs, some games support the home gameplay. In the home gameplay, the splicing method during splicing is restricted, and it can only be spliced according to fixed rules. For example, the fixed spliceable positions are limited, and the splicing operation can only be performed according to these positions. Or the rotation direction of the object is set, and it can only be rotated according to the set direction, etc. In addition, the position of the object obtained after splicing is fixed and cannot be moved. Moreover, the spliced scene is not close to the real scene. Eventually, the flexibility and performance of UGC splicing will be somewhat lacking.
[0067] To this end, in the embodiments of 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. According to the attribute information of the first splicing point and the attribute information of the second splicing point, splicing operations are performed on the first splicing element and the second splicing element to obtain an initial spliced body, realizing the splicing operation of objects. The present application supports splicing operations for various types of splicing points, reducing the limitations of splicing methods.
[0068] For the spliced body obtained by splicing, in order to realize the authenticity of object splicing, physical attributes such as the center of gravity will be set to make the spliced body obtained by splicing more similar to the splicing of real objects.
[0069] Furthermore, motion control operations can also be performed on the target spliced body, realizing free interaction between the user and the target spliced body, meeting the user's motion requirements for the spliced body, and solving the problem that the position of the object obtained by splicing in the related art cannot be moved.
[0070] On the basis of the above content, the embodiments of the present application provide a splicing control method. The execution subject can be an electronic device, which can be a device used by a user when playing games, such as a computer, a mobile phone, etc.
[0071] Referring to Figure 1 , a splicing control method may include:
[0072] S11. Obtain a first splicing element and a second splicing element.
[0073] Among them, the first splicing element and the second splicing element refer to the splicing elements that need to perform splicing operations. The types of splicing elements include ordinary splicing elements and special splicing elements. An ordinary splicing element refers to a splicing element that does not have special physical effects, such as wooden boards, cubes, cuboids, etc. As Figure 2 shown, Figure 2 is a splicing operation on two cuboids. Figure 2 The original circles in it represent splicing points. When the two cuboids approach, the splicing points 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, new splicing points may be prompted.
[0074] Special splicing elements can be fans and drivable tires, etc. The schematic diagram of a fan can be as Figure 3 shown. The fan has two states: on and off. When the fan is on, a force field with a gradually decreasing force will be formed at the air outlet. Specifically, refer to the downward wind force in Figure 3 . The wind force is used to blow the object located below the fan. In addition, the fan will also give itself a force in the opposite direction of the wind direction. Specifically, refer toFigure 3 The upward thrust in it. Since the fan can use wind force and thrust to move the fan up and down, it is possible to splice the fans into a flying vehicle so that the flying vehicle can move in the air using the force provided by the fans.
[0075] The schematic diagram of the drivable tire can be as shown in Figure 4. Figure 4 This shows the changes before and after splicing the drivable wheels. Generally, a drivable tire normally has two axles, one on the left and one on the right. Figure 4 This is the operation of splicing the drivable tire with a cuboid. When the drivable tire finishes splicing, it will automatically hide the axle on the other side according to the position of the splicing point. As Figure 4 shown, when the drivable tire is located on the right side of the cuboid, at this time, the left axle of the drivable tire is spliced with the cuboid, and the right axle will be hidden to avoid the problem of poor display effect caused by the right axle being prominent due to not hiding the right axle.
[0076] The drivable tire can accept the input of the joystick to change the angle and rotation speed, and has the physical effects of vehicle suspension and tire friction, and can be used to splice vehicle-type carriers.
[0077] In the actual scenario, a large number of splicing elements can be stored in the splicing body library, including the above-mentioned ordinary splicing elements and special splicing elements, and users can select splicing elements by means of a mouse, etc.
[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 selection by the user. If the user first selects a splicing element, then this splicing element is called the first splicing element. If the user selects another splicing element again, then this splicing element is called the second splicing element. In the embodiments of the present application, it can be set that after the second splicing element is selected, the first splicing element is fixed, and the second splicing element is spliced onto the first splicing element. In another embodiment, it can also be that both the first splicing element and the second splicing element can move relative to each other, that is, the user can adjust the orientation and other information of any splicing element.
[0079] It should be noted that generally, the first splicing element can be a partial splicing body completed by splicing multiple splicing elements. For example, when the user wants to splice a vehicle and a large part has been spliced, and only a tire is missing, then the already spliced part can be called the first splicing element, and the tire to be spliced next can be called the second splicing element. In addition, the first splicing element can also be a single splicing element, such as a wooden block, which is specifically configured according to the user's needs.
[0080] The second splicing element is generally a single splicing element, such as a wooden block, a drivable tire, a fan, a square 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 the initial relative positions of the first splicing element and the second splicing element.
[0082] As Figure 2 shown, when the first splicing element and the second splicing element are spliced, splicing points will be selected for the splicing operation. The first splicing point is the splicing point located in the first splicing element, and the second splicing point is the splicing point located in the second splicing element. The splicing points can be determined based on the initial relative positions of the first splicing element and the second splicing element.
[0083] Specifically, determining the first splicing point in the first splicing element and the second splicing point in the second splicing element based on the initial relative positions of the first splicing element and the second splicing element includes:
[0084] 1) Obtain the initial relative positions of the first splicing element and the second splicing element when they are not spliced.
[0085] Among them, the initial relative position refers to the relative orientation, relative distance, etc. of 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 Figure 2 shown. The cuboid on the left is the first splicing element, and the cuboid on the right is the second splicing element. Their initial relative position is a left - right relationship, and the sides of the two cuboids are close to each other.
[0087] 2) Based on the initial relative position, select the splicing point in the first splicing element that is closest to the second splicing element from multiple splicing points in the first splicing element, and use it as the first splicing point.
[0088] Specifically, when the user brings the second splicing element close to the first splicing element, it indicates that the user wants to splice one side or one face of the second splicing element close to the first splicing element with the first splicing element. That is to say,
[0089] the sides and faces of the first splicing element and the second splicing element that are close to each other are the sides and faces with splicing requirements.
[0090] In the actual scenario, there are many splicing points on the sides and faces of a splicing element. For example, there are 10 splicing points on one face of a cuboid. Although it is one face of a splicing element close to the side or face of another splicing element, because there are multiple splicing points on the face of this splicing element, the optimal splicing point still needs to be selected from them. The same is true for the splicing line. 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, an embodiment of the present application can select, from multiple splicing points in the first splicing element, the splicing point closest to the second splicing element and use it as the first splicing point.
[0092] 3) Based on the initial relative position, select, from multiple splicing points in the second splicing element, the splicing point closest to the first splicing element and use it as the second splicing point.
[0093] At the same time, also based on the initial relative position, select, from multiple splicing points in the second splicing element, the splicing point closest to the first splicing element and use it as the second splicing point.
[0094] For the selected first splicing point and second splicing point, the splicing point has corresponding attribute information, which may include type, position, etc.
[0095] Among them, the type includes at least one of a surface splicing point and a line splicing point. A surface splicing point means that at the splicing point, the entire surface is spliced with another splicing element. A line splicing point means that at the splicing point, the entire line is spliced with another splicing element.
[0096] In one implementation, the surface splicing point is further specifically divided into an ordinary surface splicing point and a hinge splicing point. When specifically splicing, the ordinary surface splicing point directly splices the surface with another splicing element. A hinge splicing point is a special surface splicing point. Different from the fact that after splicing with a surface splicing point, two objects will become an inrelatively movable whole, after the hinge splicing point is spliced, the two objects can rotate freely around a straight line perpendicular to the splicing plane and passing through the splicing point. Through this characteristic, players can splice objects such as a non-powered trolley and a seesaw. Taking the non-powered trolley as an example, the splicing point on the tire is a hinge splicing point. After splicing the tire with the frame, the tire can rotate relative to the frame to realize the movement of the trolley.
[0097] The attribute information of the splicing point can be specified in the form of a configuration table. For example, during the game development process or during the game upgrade process, information such as multiple splicing points and the positions and types of the splicing points is configured in the table. Subsequently, the content in the table can also be modified through a maintenance method, such as adjusting the position of a certain splicing point, adjusting the type of a certain splicing point, increasing the number of splicing points, etc.
[0098] In addition, when two splicing elements are approaching and about to be spliced, two adsorbable splicing points will be selected in the nearest distance manner as described above, and a prompt operation for the splicing point will be performed. If the user wants to adjust the splicing point, the position of the splicing point to be spliced can be adjusted, so as to correspondingly adjust the selected splicing point.
[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 spliced body.
[0100] After determining the first splicing point and the second splicing point, as well as the corresponding attribute information, a splicing operation can be performed on the first splicing element and the second splicing element based on the attribute information of the two splicing points to obtain an initial spliced body.
[0101] In the initial spliced body, the first splicing point and the second splicing point coincide, realizing the splicing of the two splicing elements.
[0102] S14. Set the physical attributes of the initial spliced body to obtain a target spliced body.
[0103] Among them, the physical attributes at least include the center of gravity.
[0104] Specifically, after splicing the first splicing element and the second splicing element into an initial spliced body, since each splicing element will have their physical collisions and weights, and the shapes, weights, centers of gravity, etc. of the first splicing element and the second splicing element are different. When the splicing elements are spliced, the physical attributes of these splicing elements will act on the final spliced body according to the type of splicing point and the relative posture between the objects during splicing. If the center of gravity of the target spliced body is not set, it will cause the target splicing point to have a suspended effect, which does not conform to the actual object performance. Therefore, in the embodiments of the present application, it is necessary to set the physical attributes of the initial spliced body. Generally, the physical attributes at least include the center of gravity. The process of setting the center of gravity is as follows:
[0105] By means of a configuration table, weights and centers of gravity are pre-configured for each splicing element that can be spliced. Whenever a new splicing element is spliced, the center of gravity of the initial spliced body will be recalculated according to the relative positions, weights and centers of gravity of the respective splicing elements. Specifically, it can be calculated based on the center of gravity calculation formula. After calculating the center of gravity of the initial spliced body, set the center of gravity of the initial spliced body to the calculated center of gravity to obtain a target spliced body, thereby making the target spliced body closer to the actual splicing effect and improving the flexibility and performance of splicing.
[0106] S15. Perform a motion control operation on the target spliced body.
[0107] In this embodiment, after obtaining the target spliced body, the user can operate the target spliced body to move. For example, for a powerless trolley, if the trolley is located on a hillside, the trolley will move down the hillside due to its own inertia.
[0108] When the target spliced body is an aircraft, the aircraft is equipped with a fan. For the fan, the user can operate the joystick in the aircraft to control the attitude change of the fan, thereby adjusting the flight attitude of the aircraft.
[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 joystick in the aircraft.
[0110] It should be noted that for the unpowered car and the powered car, the difference between the two is that the unpowered car cannot control the movement of the car through the joystick and can only move by its own inertia. The powered car can control the movement of the car through the joystick, such as turning, accelerating and decelerating.
[0111] In this embodiment, 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. According to the attribute information of the first splicing point and the attribute information of the second splicing point, splicing operations are performed on the first splicing element and the second splicing element to obtain an initial spliced body, realizing the splicing operation of objects. In addition, in order to realize the authenticity of object splicing, physical attributes such as the center of gravity will be set to make the spliced body obtained by splicing more similar to a real object. Further, motion control operations can also be performed on the target spliced body, realizing the free interaction between the user and the target spliced body and meeting the user's motion requirements for the spliced body.
[0112] In another implementation manner 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, splicing logics between the splicing elements can be set. The splicing logic is the basis and start of the entire object splicing method. The core of the design of the splicing logic is to ensure the freedom of hardcore players so that they can exert their creativity, and at the same time ensure the ease of use during light play. Generally speaking, it can be divided into two modes, namely splicing with preset splicing points and free splicing.
[0113] For the splicing with preset splicing points, in order to allow players to easily splice out the neat spliced bodies they want, the splicing with preset splicing points can be designed. Some splicing points are pre-configured on some specific spliced bodies, and the types of the splicing points can be the above-mentioned surface-type splicing points, line-type splicing points, etc. Furthermore, according to the different types of splicing points, different splicing scenarios will be generated. The specific scenarios are divided into the splicing scenario of surface-type splicing points and surface-type splicing points, the splicing scenario of surface-type splicing points and line-type splicing points, and the splicing scenario of line-type splicing points and line-type splicing points. In different scenarios, the types and positions of the splicing points are specified by means of a configuration table. When two objects approach and are about to be spliced, two splicing points that can be adsorbed will be selected (specifically such as Figure 2As shown, splice the two splicing points according to their types and perform direction correction to make the splicing effect neat and orderly. Among them, one splicing point only supports splicing one splicing element.
[0114] Now, different splicing scenarios will be introduced separately.
[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, referring to Figure 5 , 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 spliced body, including:
[0117] S21. 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.
[0118] Specifically, as Figure 6 shown, a surface splicing point refers to a preset splicing point on a plane. When two surface splicing points are spliced, as Figure 6 shown in (1), if the second splicing element is spliced onto the first splicing element, the position of the element to be spliced later, that is, the position of the second splicing element, can be moved to make it fit the first splicing element. The fitting of the two means that the first splicing point and the second splicing point coincide and the normal vectors of the planes where the first splicing point and the second splicing point are located are parallel. In this way, it can be ensured that the two splicing elements including surface splicing points in (1) form the splicing structure as shown in (2). Figure 6 Figure 6 Figure 6 shown in (2).
[0119] It should be noted that in this embodiment, the position of the first splicing element remains unchanged and the second splicing element is moved to splice the first splicing element and the second splicing element because when splicing the second splicing element, the player has already set the position of the first splicing element, and at this time, it is not desired to adjust the position of the first splicing element. Only the second splicing element needs to be spliced into the first splicing element.
[0120] In addition, if there is no position restriction, in addition to setting the second splicing element to be moved to splice the first splicing element and the second splicing element, at least one of the first splicing element and the second splicing element can also be set to be randomly moved 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 spliced body.
[0122] In an actual scenario, when splicing the second splicing element into the first splicing element, due to the inappropriate adjustment of the position of the second splicing element by the user, the splicing angle and direction between the first splicing element and the second splicing element are not what the user desires. For example, the player hopes that after the first splicing element and the second splicing element are spliced, the first splicing element is perpendicular to the second splicing element. However, in the actually spliced body, the angle between the first splicing element and the second splicing element is 85°, which does not meet the actual needs of the player. Another example is that the player hopes that the first splicing element and the second splicing element are spliced into a regular spliced body as in Figure 6 Figure (3), but actually spliced into a spliced body with some relative directions as in Figure 6 Figure (2).
[0123] Therefore, in order to improve user satisfaction, 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 spliced body.
[0124] When specifically performing direction correction, perform direction correction 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°. Another example is that 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 shown in Figure 6 Figure.
[0126] In another embodiment of the present application, since the surface splicing points are specifically divided into ordinary surface splicing points and hinge splicing points, when specifically splicing the ordinary surface splicing points, directly splice this surface with another splicing element. The hinge splicing point is a special surface splicing point. Different from the fact that after splicing the surface splicing points, the two objects will become an inactively relative whole, after the hinge splicing points are spliced, the two objects can rotate freely around a straight line perpendicular to the splicing plane and passing through the splicing point.
[0127] To achieve free rotation at the hinge splicing point, if the type of at least one of the first splicing point and the second splicing point is a hinge splicing point among the surface-type 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 freely rotate about a line perpendicular to the splicing plane and passing through the first splicing point or the second splicing point.
[0128] It should be noted that after the first splicing point and the second splicing point are spliced, the two splicing points coincide. At this time, there is only one splicing point, that is, the first splicing point and the second splicing point are the same splicing point at this time.
[0129] In this embodiment, a hinge splicing point is specially set. Splicing other than hinge splicing will make the object a whole rigid body, and there will be no relative displacement between them. However, after splicing through the hinge splicing point, two rigid bodies connected by a hinge joint will be formed, and relative movement can be formed between the splicing elements, thereby enabling the movement of the object.
[0130] 2. The type of the first splicing point is a surface-type splicing point and the type of the second splicing point is a linear splicing point.
[0131] At this time, 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 spliced body, which may include:
[0132] 1) 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.
[0133] For some relatively thin spliced bodies (such as wooden boards), some splicing points are preset on their thin edges, and these splicing points are regarded as linear splicing points. As Figure 7 shown, the upper wooden board is a splicing element including a linear splicing point, that is, the second splicing element, and the lower wooden board is a splicing element including a surface splicing point, that is, the first splicing element.
[0134] During splicing, first adjust the position of the second splicing element so that the first splicing point and the second splicing point coincide and the normal vector of the side where the first splicing point is located is perpendicular to the plane where the second splicing point is located. At this time, the line where the linear splicing point is located will fit with the plane where the surface-type splicing point is located, realizing the splicing structure formed by the two splicing elements in Figure 7 (1) as shown in Figure 7 (2).
[0135] Among them, the specific implementation process of this step is similar to the splicing process of the above two surface splicing points.
[0136] 2) 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 spliced body.
[0137] In this embodiment, the direction correction rules for surface splicing points and linear splicing points are a bit more complex. During specific direction correction, direction correction is performed in units of 45 degrees. The process of direction correction means:
[0138] 1) If the inclination angle between the line where the linear splicing point is located and the specified side (such as Figure 7 the left side of the plane in ) of the plane where the surface splicing point is located is closer to 0°, then the position of the second splicing element can be adjusted so that the relative orientation between the line where the linear splicing point is located and the specified side of the plane where the surface splicing point is located is 0°. Similarly, if the inclination angle is closer to 45°, then the position of the second splicing element can be adjusted so that the relative orientation between the line where the linear splicing point is located and the specified side of the plane where the surface splicing point is located is 45°. For another example, if the inclination angle is closer to 90°, then the position of the second splicing element can be adjusted so that the relative orientation between the line where the linear splicing point is located and the specified side of the plane where the surface 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 line where the linear splicing point is located and the normal vector of the plane where the surface splicing point is located is closer to 0°, then the position of the second splicing element can be adjusted so that the relative angle between the line where the linear splicing point is located and the normal vector of the plane where the surface splicing point is located is 0°. If the relative angle is closer to 45°, then the position of the second splicing element can be adjusted so that the relative angle between the line where the linear splicing point is located and the normal vector of the plane where the surface splicing point is located is 45°. If the relative angle is closer to 90°, then the position of the second splicing element can be adjusted so that the relative angle between the line where the linear splicing point is located and the normal vector of the plane where the surface splicing point is located is 90°. Other angles are similar, and other angles are multiples of 45°, such as 135°, 180°, etc.
[0140] As Figure 7 shown in (2) and (3) of, the included angle between the corrected wooden 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, splicing operations are performed on the first splicing element and the second splicing element to obtain an initial spliced body, including:
[0143] 1) According to the attribute information of the first splicing point and the attribute information of the second splicing point, adjust the positions 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] Wherein, there being 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 coincide.
[0145] Specifically, an example of the splicing of a linear splicing point and a linear splicing point can be as Figure 8 shown, Figure 8 In it, the first splicing element is a partial spliced body composed of two wooden boards, the second splicing element is also a wooden board, and one side of the second splicing element is spliced with one side of the first splicing element. At this time, 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. However, as Figure 8 shown, at this time only the two linear splicing points coincide, but the line where the linear splicing point of the first splicing element is located and the side where the linear splicing point of the second splicing element is located are not completed in splicing.
[0147] 2) 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 spliced body.
[0148] When performing direction correction, the splicing between two linear splicing points is relatively arbitrary. It only requires that the components of the relative rotation of the two splicing elements on each axis (i.e., the x, y, and z axes) are multiples 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°. The same applies to other angles.
[0149] After the above direction correction, although the splicing seems arbitrary, it can ensure the relative order between the splicing elements. As Figure 8 shown, after the splicing elements are spliced, 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 surface splicing points with surface splicing points, surface splicing points with linear splicing points, and linear splicing points with linear splicing points, there is also splicing without preset splicing points, which is free splicing at this time. Free splicing means that when two splicing elements are to be spliced and no suitable splicing point is found within a certain range, the two splicing elements will be spliced with the point closest to each other as the splicing point. This splicing mode ensures the freedom of splicing.
[0151] In this embodiment, two modes of splicing with preset splicing points and free splicing are set, so that free splicing can be carried out according to user needs, ensuring the flexibility, freedom and ease of use when players perform splicing, and enabling players' creativity to be more fully exerted.
[0152] In another implementation manner of the present application, the implementation of performing motion control operations on the target splicing body is introduced.
[0153] According to the above description, there are special splicing elements, such as fans and drivable tires, etc. These special splicing elements can move relatively after being driven. Taking the drivable tire in a land vehicle as an example, different from the traditional vehicle operation method, in this embodiment, the relative position of the tire in the vehicle cannot be preset. Therefore, a set of vehicle control algorithms applicable to object splicing is developed, which can enable the vehicles assembled by players at will to be driven normally as much as possible. The vehicle control algorithms can be divided into land vehicles and flying vehicles.
[0154] Then, in the embodiment of the present application, when the target splicing body includes special splicing elements and the special splicing elements are drivable tires, performing motion control operations on the target splicing body includes:
[0155] 1) Receiving a control instruction input through an operating lever.
[0156] In practical applications, the target splicing body including drivable tires is a land vehicle. In order to drive the drivable tires, a special splicing element - an operating lever needs to be installed on the land vehicle. The operating lever can drive the tires and the fan, so that the drivable tires and the fan move, thereby realizing the movement of the land vehicle and the flying vehicle.
[0157] It should be noted that there is no limit to the time when the operating lever and the drivable tires are spliced to the land vehicle, as long as the finally spliced target splicing body includes the operating lever and the drivable tires.
[0158] In order to enable the user to control the drivable tires through a joystick, in the embodiments of the present application, since the power source of the land vehicle is the drivable tires, therefore, after the user gives an input (which can be called a control instruction) through the joystick, the control instruction input by the user through the joystick can be received, and the control instruction is a two-dimensional vector.
[0159] 2) Perform a decomposition operation on the control instruction to obtain a first direction instruction and a second direction instruction.
[0160] For a land vehicle, such as a powered cart, when the cart is traveling, it can move forward and backward, such as accelerating and decelerating, and can also move left and right, such as turning. At this time, the above two-dimensional vector can be decomposed into a first direction instruction and a second direction instruction.
[0161] Among them, 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 this output into an input in the front-back direction and an input in the left-right direction. The input in the left-right direction is the first direction instruction, and the input in the front-back direction is the second direction instruction.
[0162] 3) In the first direction, calculate the rotation angle of the drivable tire based on the relative position between the drivable tire and the target splicing body and the first direction instruction.
[0163] Specifically, a powered cart rotates in the left-right direction, such as turning left and turning right. Since there are multiple drivable tires on the powered cart, at this time, it is necessary to determine the rotation angle of each drivable tire in turn.
[0164] It should be noted that the powered cart does not necessarily have a specified number of drivable tires, such as 4, and there may be 3 or 2 or 5 etc. drivable tires.
[0165] At this time, for each drivable tire, based on the relative position between the tire and the target splicing body, such as the tire is on the left front side of the powered cart, at this time, based on the first direction instruction, calculate the rotation angle of the drivable tire, and the specific calculation process can adopt corresponding calculation formulas.
[0166] It should be noted that for the drivable tires at different positions in the same powered cart, due to their different relative positions with the powered cart, the rotation angles of 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 rotation angle of the left front wheel is smaller, and the rotation angle of the right front wheel is larger. And the tires in front of and behind the joystick will 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 the second direction, based on the relative position of the drivable tire and the target splicing body and the second direction instruction, calculate the rotational speed of the drivable tire.
[0168] In the front-rear direction, according to the input components in the front-rear direction and the relative position of the drivable tire and the target splicing body, determine the rotational speed of each drivable tire. When calculating specifically, corresponding calculation formulas are used.
[0169] When going straight, the rotational speeds of different drivable tires are the same, but when turning, the rotational speeds of different drivable tires are different, which is determined by the relative position of the drivable tire and the target splicing body.
[0170] 5) Control the movement of the drivable tire according to the rotation angle and the rotational speed.
[0171] In this embodiment, for each drivable tire, apply a driving force to the tire according to the rotation angle corresponding to the tire and the rotational speed 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 splicing body.
[0173] Since the splicing body in this application is movable, it enriches the implementation methods of the splicing body and improves the user experience.
[0174] In another implementation manner of this application, if the special splicing element is a fan, this fan can be spliced into a flying vehicle. The power source of the flying vehicle is the fan, and the operation algorithm will gradually reduce the wind force according to the height to limit the maximum flight height of the flying vehicle.
[0175] On this basis, the motion control operation on the target splicing body may include:
[0176] 1) Receive the target torque input through the joystick.
[0177] Specifically, the user can input a control instruction through the joystick. This control instruction can be a target torque value, and the flight control of the flying vehicle needs to be performed according to this target torque value.
[0178] 2) Adjust the motion posture of the target splicing body based on the target torque.
[0179] In this embodiment, during the normal driving process of the flying vehicle, the operation algorithm will also adjust the motion posture of the flying vehicle according to the target torque, making the flying vehicle tilt in the direction to travel to make the flying vehicle move forward.
[0180] Among them, when adjusting the motion attitude of the flying vehicle according to the target torque, the greater the torque, the greater the adjustment angle of the motion attitude, and the smaller the torque, the smaller the adjustment angle of the motion attitude.
[0181] 3) During the movement of the target spliced body, if the inclination angle of the target spliced body is greater than the preset angle, the motion attitude of the target spliced body is adjusted by applying a reverse torque, so that the target spliced body maintains balance.
[0182] Specifically, the wind force in the game scene is real. In the actual scene, it is unlikely that players can piece together an absolutely balanced vehicle. Therefore, during the flight of the vehicle, the operation algorithm will always maintain the detection of the inclination angle of the relative balance position of the vehicle. When the inclination angle of the flying vehicle is greater than the set preset angle, the algorithm will provide a reverse torque to adjust the motion attitude of the target spliced body, so that the vehicle maintains balance.
[0183] In this embodiment, special splicing elements are introduced, such as fans, drivable tires, joysticks, etc., making the types of splicing elements more diverse. In addition to being able to piece together conventional spliced bodies, it is also possible to piece together flying vehicles and land vehicles, making the spliced body have more realistic physical effects, and it is possible to piece together a variety of drivable vehicles and provide simple and easy-to-use control methods for the vehicles, allowing players to better explore the game world with the help of the splicing gameplay.
[0184] In another implementation manner of this application, when the player completes a relatively complex spliced body, in order to prevent cumbersome repeated operations in the future, the embodiment of this application provides a blueprint function. Players can save the spliced result to generate a blueprint, and then they can restore the spliced body with one key according to the saved blueprint, and the blueprint is also convenient for sharing among players.
[0185] Specifically, after performing a motion control operation on the target spliced body, the splicing information of the target spliced body is recorded, and this splicing information can 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 spliced body, splicing element connection information, and position information of the splicing element relative to the target spliced body.
[0187] Among them, for a spliced body, it is composed of multiple splicing elements. For each splicing element in the spliced body, the information to be recorded is as follows:
[0188] 1. Parameter information.
[0189] The parameter information specifically includes the logical ID (Identity document, a unique code, which can be specifically obtained by sorting each splicing element in the splicing body. The sorting method is not limited. For example, it can be sorted according to the splicing order) of the splicing element in the entire splicing body, the resource ID of the splicing element configuration in the table, etc. Among them, the resource ID is used to represent which specific splicing element is used. The resource IDs of different splicing elements are different. For example, wooden boards, drivable tires, squares, fans, etc. correspond to different resource IDs respectively. It should be noted that the resource IDs of the large square and the small square are different, that is, as long as two splicing elements have different sizes and shapes, they have different resource IDs.
[0190] 2. Splicing element connection information.
[0191] Among them, each splicing element may be connected to multiple splicing elements. Therefore, the splicing element connection information can be displayed in the form of an array. Each element in the array contains the following information:
[0192] The logical ID of the connected splicing element, the ID of the splicing point (if it is free splicing, it is -1).
[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 origin of the splicing body coordinates as the reference object, the rotation information of the splicing element with the splicing body as the reference object, etc.
[0195] After the splicing of the splicing body is completed, when the user logs in again after logging off, the blueprint function can be used. Select this splicing information, and then a trigger instruction for the splicing information can be received. Then, in response to the trigger instruction, each splicing element that makes up the target splicing body is spliced into the target splicing body according to the splicing information.
[0196] In this embodiment, after the splicing is completed, in order to enable players to conveniently save and reproduce their splicing bodies without having to splice them again each time, this application embodiment records the splicing information to restore the splicing method of the splicing body based on the blueprint function and the splicing information, realizing the saving and restoration of the splicing body.
[0197] It should be noted that in this application embodiment, during splicing, only the structure of the finally spliced splicing body needs to be concerned, record its splicing information, and use this splicing information to restore the splicing body. There is no need to record the splicing process. When specifically restoring, how to splice into the splicing body does not need to be concerned by the user. At this time, the splicing body can be restored according to the principle of the fastest speed or the simplest splicing method.
[0198] Based on the embodiments of the above splicing control method, another embodiment of the present application provides a splicing control device. Referring to Figure 9 , it includes:
[0199] An element acquisition module 11, configured 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 the initial relative positions 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 spliced body;
[0202] A setting module 14, configured to set the physical attributes of the initial spliced body to obtain a target spliced body; the physical attributes at least include the center of gravity;
[0203] A motion control module 15, configured to perform a motion control operation on the target spliced body.
[0204] In one implementation, the splicing point determination module 12 includes:
[0205] A position acquisition sub-module, configured to acquire the initial relative positions of the first splicing element and the second splicing element when they are not spliced;
[0206] A first splicing point determination sub-module, configured to select, based on the initial relative positions, the splicing point in the first splicing element that is closest to the second splicing element from multiple splicing points in the first splicing element as the first splicing point;
[0207] A second splicing point determination sub-module, configured to select, based on the initial relative positions, the splicing point in the second splicing element that is closest to the first splicing element from multiple splicing points in the second splicing element as the second splicing point.
[0208] In one implementation, the attribute information includes a type; the type at least includes one of a surface-type splicing point and a line-type splicing point;
[0209] The splicing module 13 includes:
[0210] A splicing sub-module, configured to adjust the positions 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;
[0211] A direction correction sub-module, configured 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 position of the first splicing element and the second splicing element, so as to obtain an initial spliced body.
[0212] In one implementation, when 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, and the normal vectors of the planes where the first splicing point and the second splicing point are 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 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 coincide, and the side where the first splicing point is located is perpendicular to the normal vector of the plane where the second splicing point is located;
[0214] In the case where 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, 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.
[0215] In one implementation, the splicing module 13 further includes:
[0216] A joint configuration sub-module, configured to, if at least one of the first splicing point and the second splicing point is a hinge splicing point among the surface splicing points, configure a hinge joint 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 perpendicular to the splicing plane and passing through the first splicing point or the second splicing point.
[0217] In one implementation, when the target spliced body includes a special splicing element, the motion control module 15 includes:
[0218] An instruction receiving sub-module, configured to receive a control instruction input through a joystick if the special splicing element is a drivable tire;
[0219] A decomposition sub-module, configured to perform a decomposition operation on the control instruction to obtain a first direction instruction and a second direction instruction;
[0220] An angle calculation sub-module, configured to calculate the rotation angle of the drivable tire in a first direction based on the relative position between the drivable tire and the target spliced body and the first direction instruction;
[0221] A speed calculation sub-module, configured to calculate the rotational speed 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;
[0222] A tire control sub-module, configured 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 sub-module, configured to receive a target torque input through an operating lever if the special splicing element is a fan;
[0225] An attitude adjustment sub-module, configured to adjust the motion attitude of the target splicing body based on the target torque;
[0226] A balance control sub-module, configured to, during the movement of the target splicing body, if the inclination angle of the target splicing body is greater than a preset angle, adjust the motion attitude of the target splicing body by applying a reverse torque to keep the target splicing body balanced.
[0227] In one implementation, it further includes:
[0228] An information recording module, configured to record the splicing information of the target splicing body, where 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] A splicing body restoration module, configured to, if a trigger instruction for the splicing information is received, respond to the trigger instruction and splice each splicing element constituting the target splicing body into the target splicing body according to the splicing information.
[0230] In this embodiment, 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. According to the attribute information of the first splicing point and the attribute information of the second splicing point, splicing operations are performed on the first splicing element and the second splicing element to obtain an initial splicing body, realizing the splicing operation of an object. Additionally, to achieve the authenticity of object splicing, physical attributes such as the center of gravity are set to make the spliced splicing body more similar to a real object. Further, motion control operations can be performed on the target splicing body, realizing free interaction between the user and the target splicing body and meeting the user's motion requirements for the splicing body.
[0231] It should be noted that for the working processes of each module and sub-module in this embodiment, please refer to the corresponding descriptions in the above embodiments and will not be elaborated here.
[0232] An embodiment of the present application further provides an electronic device, including at least one processor and a memory connected to the processor, where:
[0233] The memory is used to store a computer program;
[0234] The processor is used to execute the computer program so that the electronic device can implement the above-mentioned splicing control method.
[0235] Reference Figure 10 As shown, it shows a schematic structural diagram of an electronic device suitable for implementing the electronic device in 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, laptop computers, PDAs (Personal Digital Assistants), PADs (Tablet Computers), desktop computers, and so on. Figure 10 The electronic device shown is only an example and should not bring any limitations to the functions and usage scopes of the embodiments of the present application.
[0236] As Figure 10 shown, the electronic device may include a processing device (such as 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 into 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 through a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0237] Generally, the following devices may be connected to the I / O interface 605: an input device 606 including, for example, a touch screen, a touchpad, 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 wiredly to exchange data. Although Figure 10 the electronic device shown has various devices, it should be understood that it is not required to implement or have all the shown devices. Instead, more or fewer devices may be implemented or had.
[0238] An embodiment of the present application further provides a computer program product, including computer-readable instructions, which, when running on an electronic device, enable the electronic device to implement any one of the splicing control methods provided by the embodiments of the present application.
[0239] In an embodiment of the present application, a computer-readable storage medium is further provided. 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 one of the splicing control methods provided in the embodiments 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 obvious to those skilled in the art, and the general principles defined herein can 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 be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A splicing control method, characterized in that, Including: Obtain a first splicing element and a second splicing element; Based on the initial relative positions of the first splicing element and the second splicing element, determine a first splicing point in the first splicing element and a second splicing point in the second splicing element; According to the attribute information of the first splicing point and the attribute information of the second splicing point, perform a splicing operation on the first splicing element and the second splicing element to obtain an initial spliced body; Set the physical attributes of the initial spliced body to obtain a target spliced body; the physical attributes at least include the center of gravity; Perform a motion control operation on the target spliced body; Wherein, the attribute information includes a type; the type at least includes one of a surface splicing point and a line splicing point; According to the attribute information of the first splicing point and the attribute information of the second splicing point, performing a splicing operation on the first splicing element and the second splicing element to obtain an initial spliced body includes: According to the attribute information of the first splicing point and the attribute information of the second splicing point, adjust the positions 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, perform a direction correction operation on at least one of the first splicing element and the second splicing element to obtain an initial spliced body.
2. The splicing control method according to claim 1, wherein Based on the initial relative positions of the first splicing element and the second splicing element, determining the first splicing point in the first splicing element and the second splicing point in the second splicing element includes: Obtain the initial relative positions of the first splicing element and the second splicing element when they are not spliced; Based on the initial relative positions, select, from the multiple splicing points in the first splicing element, the splicing point closest to the second splicing element and use it as the first splicing point; Based on the initial relative positions, select, from the multiple splicing points in the second splicing element, the splicing point closest to the first splicing element and use it as the second splicing point.
3. The splicing control method according to claim 1, wherein 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, having at least one contact point between the first splicing element and the second splicing element means: the first splicing point and the second splicing point coincide and the normal vectors of the planes where the first splicing point and the second splicing point are 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, having at least one contact point between the first splicing element and the second splicing element means: the first splicing point and the second splicing point coincide and the side where the first splicing point is located is perpendicular to the normal vector of the plane where the second splicing point is located; In the case where the type of the first splicing point is a line splicing point and the type of the second splicing point is a line splicing point, having at least one contact point between the first splicing element and the second splicing element means: the first splicing point and the second splicing point coincide.
4. The splicing control method according to claim 1, wherein 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 position of the first splicing element and the second splicing element to obtain an initial spliced body, it further includes: If at least one of the first splicing point and the second splicing point is a hinge splicing point among the surface splicing points, configure a hinge joint 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.
5. The splicing control method according to claim 1, characterized in that When the target spliced body includes a special splicing element, performing a motion control operation on the target spliced body includes: If the special splicing element is a drivable tire, receive a control instruction input through an operating lever; Perform a decomposition operation on the control instruction to obtain a first direction instruction and a second direction instruction; In the first direction, calculate the rotation angle of the drivable tire based on the relative position between the drivable tire and the target spliced body and the first direction instruction; In the second direction, calculate the rotation speed of the drivable tire based on the relative position between the drivable tire and the target spliced body and the second direction instruction; Control the movement of the drivable tire according to the rotation angle and the rotation speed.
6. The splicing control method according to claim 5, wherein Performing a motion control operation on the target spliced body further includes: If the special splicing element is a fan, receive a target torque input through an operating lever; Adjust the motion posture of the target spliced body based on the target torque; During the movement of the target spliced body, if the tilt angle of the target spliced body is greater than a preset angle, adjust the motion posture of the target spliced body by applying a reverse torque so that the target spliced body maintains balance.
7. The splicing control method according to claim 1, characterized in that After performing the motion control operation on the target spliced body, it further includes: Record the splicing information of the target spliced body, where the splicing information at least includes parameter information of each splicing element constituting the target spliced body, splicing element connection information, and position information of the splicing element relative to the target spliced body; If a trigger instruction for the splicing information is received, respond to the trigger instruction and splice each splicing element constituting the target spliced body into the target spliced body according to the splicing information.
8. A splicing control device, characterized in that, It includes: An element acquisition module for acquiring a first splicing element and a second splicing element; A splicing point determination module for determining a first splicing point in the first splicing element and a second splicing point in the second splicing element based on the initial relative position of the first splicing element and the second splicing element; A splicing module for 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 spliced body; A setting module for setting the physical attributes of the initial spliced body to obtain a target spliced body; the physical attributes at least include the center of gravity; A motion control module for performing a motion control operation on the target spliced body; Among them, the attribute information includes a type; the type includes at least one of a surface splicing point and a line splicing point; 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 spliced body, including: Adjusting the positions 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; Based on the current relative positions of the first splicing element and the second splicing element, performing a direction correction operation on at least one of the first splicing element and the second splicing element to obtain an initial spliced body.
9. An electronic device, characterized in that, Comprising at least one processor and a memory connected to the processor, wherein: The memory is used for storing a computer program; The processor is used for executing the computer program, so that the electronic device can implement the splicing control method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Object creation method and device
CN114255310A
Device and method of analysing an object for 3D printing
US20190270251A1