A method and system for dynamically generating and destroying object models based on three-dimensional scenes
By introducing source objects and object properties to set the lead-out items in the three-dimensional scene, dynamically generating and destroying objects, the problem of fixed number of objects and poor expansion in the existing technology is solved, and flexible increase and destruction of objects in three-dimensional scenes is achieved, and the three-dimensional scenes is improved Performance of the model production platform.
Patent Information
- Application Number
- CN202410085290.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-21
- Publication Date
- 2025-02-14
- Estimated Expiration
- 2044-01-21
AI Technical Summary
In the prior art, the number of objects in the three-dimensional scene is fixed, the expansion ability is poor, and the objects cannot be dynamically increased or destroyed, resulting in the design solidification and unable to meet the needs of flexible art display.
By introducing source objects and object properties in a three-dimensional scene, the object is dynamically generated and destroyed according to the number of objects and attribute changes, and the object type and attributes are updated.
It realizes the flexibility of increasing and destroying objects in three-dimensional scenes, improves the performance of the three-dimensional model object production platform, and solves the problem of fixed number of objects and poor expansion.
Smart Images

Figure CN118196278B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of three-dimensional model production and presentation, and more specifically, to a method and system for dynamically generating and destroying object models based on three-dimensional scenes. Background Art
[0002] With the rapid development of radio and television, the requirements for objects in three-dimensional scenes are getting higher and higher. In certain specific cases, it is necessary to dynamically add and destroy objects in the scene to achieve the desired artistic display effect. The current solution to the above problem is: prepare a certain number of objects in advance, and set their visible properties to invisible, and realize the addition and destruction of objects in the rendering window by modifying the visible properties of the objects.
[0003] In the prior art, since objects need to be stored in advance, only a given number of object changes can be coped with. When the number of objects that need to be changed is too large, the only option is to adjust the design and increase the number of stored objects. The scalability is poor, and the types of objects added or deleted cannot be adjusted in real time according to demand. The only option is to complete corresponding adjustments and changes based on the existing design.
[0004] Therefore, it is necessary to introduce a new method and system, which can determine the source objects in the three-dimensional scene and set the derived items of the object properties of the source objects, increase or decrease the number of objects as needed according to the number of objects and changes in object properties, and update the type and properties of the objects as needed to solve the technical problems existing in the prior art, such as the fixed number of objects, poor expandability, inability to dynamically add or destroy objects, and rigid design, thereby enhancing the flexibility of adding and destroying objects in the three-dimensional scene and improving the performance of the three-dimensional model object production platform. Summary of the invention
[0005] In response to the technical problems mentioned above, the present invention provides a method and system for dynamically generating and destroying object models based on three-dimensional scenes. By setting derived items through source objects and object properties of source objects, the number of objects can be increased or decreased as needed according to the number of objects and changes in object properties, and the type and properties of objects can be updated as needed, so as to solve the technical problems existing in the prior art such as the fixed number of objects, poor expandability, inability to dynamically add or destroy objects, and rigid design, thereby enhancing the flexibility of adding and destroying objects in three-dimensional scenes and improving the performance of the three-dimensional model object production platform.
[0006] The present invention provides a method for dynamically generating and destroying an object model based on a three-dimensional scene, the method comprising:
[0007] S1, based on the three-dimensional scene, according to the object model grouping structure, the internal elements and internal element structures of the object model grouping are checked for consistency, and an object model clone group is established according to the check result and the object model grouping; S2, the objects within the object model clone group are classified, and the source object and other sub-objects within the object model clone group are determined and established; S3, based on the source object, the other sub-objects are dynamically updated according to the object model grouping structure, and other sub-objects within the object model clone group that are inconsistent with the source object are destroyed to obtain an updated object model clone group; S4, according to the preset derived items, the driving data is received, and based on the updated object model clone group, a new object is dynamically cloned using the driving data.
[0008] As described above, in S1, based on the three-dimensional scene and according to the object model grouping structure, the step of performing consistency check processing on the internal elements and internal element structures of the object model grouping includes:
[0009] S11, according to the clone group construction requirement, select a first object model grouping, determine the number of internal elements of the first object model grouping, if the number of internal elements of the object model grouping is zero, reselect a new first object model grouping, if the number of internal elements of the object model grouping is an integer greater than zero, determine that the first object model grouping is a second object model grouping, and jump to step S12;
[0010] S12, performing consistency check on the object types, organizational hierarchies and object properties of all sub-objects in the second object model grouping according to the object model grouping structure; if the object types, organizational hierarchies and object properties of all sub-objects in the second object model grouping are consistent, jump to step S13; otherwise, jump to step S11;
[0011] S13, traversing and analyzing all attribute nodes of each child object in the second object model group, if the node connection relationships between all attribute nodes of all child objects in the second object model group and other objects belonging to other model groups are relatively closed, then determining that the second object model group is the object model group, and establishing the object model clone group, otherwise, jumping to step S11;
[0012] in,
[0013] The object model grouping structure includes object number, object, object type, organizational hierarchy and object attributes;
[0014] The objects include source objects, sub-objects and other sub-objects;
[0015] The other objects are not in the same model group as the object, but are in other model groups.
[0016] As described above, the step of S12 further includes:
[0017] S12-1, object type check: determine the object types of all sub-objects in the second object model group one by one, if there is a sub-object whose object type is inconsistent with the object type of other sub-objects, return to S11, otherwise, jump to step S12-2;
[0018] S12-2, object organization hierarchy check: compare and analyze the organization hierarchy of all sub-objects in the second object model group one by one. If there is a sub-object containing sub-objects in the second object model group, and other sub-objects also contain sub-objects of the same object type, jump to step S12-3; otherwise, return to S11;
[0019] S12-3, object attribute check: compare and analyze the object attributes of all objects in the second object model group one by one. If the object attributes of all objects in the second object model group are the same, jump to S13; otherwise, return to S11.
[0020] As described above, in step S13, before traversing and analyzing all the attribute nodes of each sub-object in the second object model group, the step of establishing the object node relationship is also included, which is specifically:
[0021] Determine nodes: according to the object attributes of the object, determine the attribute nodes corresponding to the object attributes of the object one by one;
[0022] Establishing a node connection relationship: establishing a node connection relationship between the objects based on the control relationship between the attribute nodes;
[0023] in,
[0024] The node connection relationship can be dynamically constructed according to the control relationship between nodes set by the user, and is used to determine the controlling and controlled subordinate relationship between the object attributes of different objects.
[0025] As mentioned above, the step of S13 further includes:
[0026] S13-1, obtaining all attribute nodes of the child object and other objects, generating a node queue, and traversing the node queue based on the attribute nodes and the node connection relationship between each of the attribute nodes;
[0027] S13-2, determining the closed relationship between all attribute nodes of the child object and other objects according to the traversal result; if any attribute node of the child object has a connection relationship with any attribute node of other objects, returning to step S11; if the child object does not have an attribute node that has a connection relationship with any attribute node of other objects, the node connection relationship between all attribute nodes of the child object and attribute nodes of other objects is relatively closed, and determining that the second object model grouping is the object model grouping.
[0028] As mentioned above, the step of S2 further includes:
[0029] S21, obtaining all objects in the object model clone group and the sub-objects corresponding to each object, and counting the number of all objects;
[0030] S22, classifying all objects in the object model clone group according to the number of all objects, if the value of the number of objects is equal to 1, determining the object as a source object, if the value of the number of objects is equal to or greater than 2, determining the first object in the objects as a source object, and the remaining objects are other child objects;
[0031] in,
[0032] After the source object is determined, sub-objects may be added to the source object as required.
[0033] As described above, in step S3, based on the source object, the step of dynamically updating the other sub-objects according to the object model grouping structure further includes:
[0034] Based on the object type, organizational hierarchy and object attributes of the source object, and the node connection relationship of each attribute node, all other child objects in the object model clone group are updated one by one;
[0035] S3-1, if the object type, organizational hierarchy and object properties of the other child objects are completely consistent with the object type, organizational hierarchy and object properties of the source object, jump to step S3-2, otherwise, delete the other child objects from the object model clone group;
[0036] S3-2, if the node connection relationship of each attribute node corresponding to the other child object is the same as the node connection relationship of each attribute node corresponding to the source object, then retain the other child object, otherwise, delete the other child object from the object model clone group,
[0037] S3-3, repeating step S3-1 and step S3-1 until all other sub-objects in the object model clone group that are inconsistent with the source object are destroyed to obtain an updated object model clone group.
[0038] As described above, in step S3, the step of dynamically updating the other sub-objects based on the source object and the object model grouping structure further includes the steps of static cloning of the objects in the clone group and dynamic cloning of the objects in the clone group;
[0039] in,
[0040] The steps of static cloning of objects in the clone group are:
[0041] Get the number of fixed objects GL num , and the current number of objects KL in the updated object model clone group num , calculate and according to (GL num -KL num ) to update the objects in the updated object model clone group;
[0042] If (GL num -KL num ) is greater than or equal to zero, the value of the object attribute of the newly added object is obtained, and (GL num -KL num ) new other child objects;
[0043] If (GL num -KL num ) is less than zero, then delete (KL num -GL num ) other child objects;
[0044] The steps of dynamically cloning objects in the clone group are:
[0045] Receive in real time and obtain table data according to the object dynamic clone request, and obtain the dynamic object quantity DL from the table data num and the value of the object attribute, and at the same time obtain the current number of objects KL in the updated object model clone group num , real-time calculation and according to (DL num -KL num ) value dynamically updates the objects in the updated object model clone group;
[0046] If (DL num -KL num) is greater than or equal to zero, then according to the value of the object attribute corresponding to the object dynamic clone request, and the object type, organizational hierarchy and object attribute of the source object, (DL num -KL num ) new other child objects;
[0047] If (DL num -KL num ) is less than zero, then delete (KL num -DL num ) other child objects;
[0048] in,
[0049] While generating new other sub-objects in the updated object model clone group, module instances corresponding to the new other sub-objects are created according to the module instances of the source object, and a synchronous connection relationship is determined; when the organizational hierarchy, object properties and sub-objects of the source object are updated, the organizational hierarchy, object properties and sub-objects of all other sub-objects in the updated object model clone group are also synchronously updated.
[0050] As described above, in step S4, the step of receiving the driving data according to the preset derived items, and dynamically cloning and generating a new object using the driving data based on the updated object model clone group further includes:
[0051] Determining a preset derived item according to the object attribute of the source object, and a corresponding relationship between the preset derived item and the object attribute of the source object;
[0052] According to the designated element adjustment trigger event, receiving the designated element adjustment request in real time, parsing and determining the value of the derived item and the object numbers of other sub-objects in the updated object model clone group according to the designated element adjustment request;
[0053] If the value of the derived item is not a null value, the value of the object property of the other child object is updated according to the object number of the other child object and the corresponding relationship between the preset derived item and the object property of the source object.
[0054] Accordingly, the present invention also provides a system for dynamically generating and destroying object models based on three-dimensional scenes, the system comprising a clone group establishment module, an object classification processing module, an object update processing module and a data-driven processing module;
[0055] in,
[0056] The clone group establishment module is used to perform consistency check processing on the internal elements and internal element structures of the object model grouping based on the three-dimensional scene and the object model grouping structure, and establish the object model clone group according to the check processing result and the object model grouping;
[0057] The object classification processing module is used to classify the objects within the object model clone group, determine and establish the source object and other sub-objects within the object model clone group;
[0058] The object update processing module is used to perform object dynamic update processing on the other sub-objects based on the source object and according to the object model grouping structure, and destroy the other sub-objects in the object model clone group that are inconsistent with the source object to obtain an updated object model clone group;
[0059] The data driven processing module is used to receive driving data according to preset derived items, and dynamically clone and generate new objects using the driving data based on the updated object model clone group.
[0060] The present invention applies the above technical scheme, sets the derived items through the source objects in the three-dimensional scene and the object attributes of the source objects, copies the control objects or the grouping of objects, drives them with data, and the copied objects contain all the attributes of the copied source and automatically match the node logic relationship; only the node logic relationship of the copied source object is edited, and the logic of the corresponding node is automatically matched in the copied object. When the copy source changes, all the copied objects are automatically updated to change the corresponding objects and nodes, and the number of objects is increased or decreased as needed according to the number of objects and the change of object attributes, and the logical structure replication and synchronous update of the object structure and the internal nodes of the object are completed synchronously, that is, the type and attribute of the object are updated and synchronized as needed, and the technical problems of the fixed number of objects, poor expansibility, inability to dynamically add or destroy objects, and design solidification existing in the prior art are solved, thereby enhancing the flexibility of adding and destroying objects in the three-dimensional scene and improving the performance of the three-dimensional model object production platform. BRIEF DESCRIPTION OF THE DRAWINGS
[0061] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0062] Figure 1 A schematic flow chart of a method for dynamically generating and destroying an object model based on a three-dimensional scene according to an embodiment of the present invention is shown;
[0063] Figure 2 A schematic diagram of a clone group inspection process of a method for dynamically generating and destroying object models based on a three-dimensional scene according to an embodiment of the present invention is shown;
[0064] Figure 3 A schematic diagram of a relative closure judgment process of a method for dynamically generating and destroying an object model based on a three-dimensional scene according to an embodiment of the present invention is shown;
[0065] Figure 4 A schematic diagram of updating internal elements of a clone group in a method for dynamically generating and destroying object models based on a three-dimensional scene according to an embodiment of the present invention is shown;
[0066] Figure 5 A schematic diagram of other sub-object update flow of a method for dynamically generating and destroying an object model based on a three-dimensional scene proposed in an embodiment of the present invention is shown;
[0067] Figure 6 A schematic diagram of other sub-object adjustment flow of a method for dynamically generating and destroying an object model based on a three-dimensional scene proposed in an embodiment of the present invention is shown;
[0068] Figure 7 A schematic diagram of the structure of a three-dimensional scene-based object model dynamic generation and destruction system proposed in an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0069] 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.
[0070] The present invention provides a method for dynamically generating and destroying object models based on a three-dimensional scene, such as Figure 1 As shown, the method comprises the following steps:
[0071] S1, based on the three-dimensional scene and according to the object model grouping structure, a consistency check is performed on the internal elements and the internal element structure of the object model grouping, and an object model clone group is established according to the check result and the object model grouping.
[0072] In this embodiment, in S1, based on the three-dimensional scene and according to the object model grouping structure, the step of performing consistency check on the internal elements and internal element structures of the object model grouping includes:
[0073] S11, according to the clone group construction requirement, select a first object model grouping, determine the number of internal elements of the first object model grouping, if the number of internal elements of the object model grouping is zero, reselect a new first object model grouping, if the number of internal elements of the object model grouping is an integer greater than zero, determine that the first object model grouping is a second object model grouping, and jump to step S12;
[0074] S12, performing consistency check on the object types, organizational hierarchies and object properties of all sub-objects in the second object model grouping according to the object model grouping structure; if the object types, organizational hierarchies and object properties of all sub-objects in the second object model grouping are consistent, jump to step S13; otherwise, jump to step S11;
[0075] S13, traversing and analyzing all attribute nodes of each child object in the second object model group, if the node connection relationships between all attribute nodes of all child objects in the second object model group and other objects belonging to other model groups are relatively closed, then determining that the second object model group is the object model group, and establishing the object model clone group, otherwise, jumping to step S11;
[0076] in,
[0077] The object model grouping structure includes object number, object, object type, organizational hierarchy and object attributes;
[0078] The objects include source objects, sub-objects and other sub-objects;
[0079] The other objects are not in the same model group as the object, but are in other model groups.
[0080] In this embodiment, the step S12 further includes:
[0081] S12-1, object type check: determine the object types of all sub-objects in the second object model group one by one, if there is a sub-object whose object type is inconsistent with the object type of other sub-objects, return to S11, otherwise, jump to step S12-2;
[0082] S12-2, object organization hierarchy check: compare and analyze the organization hierarchy of all sub-objects in the second object model group one by one. If there is a sub-object containing sub-objects in the second object model group, and other sub-objects also contain sub-objects of the same object type, jump to step S12-3; otherwise, return to S11;
[0083] S12-3, object attribute check: compare and analyze the object attributes of all objects in the second object model group one by one. If the object attributes of all objects in the second object model group are the same, jump to S13; otherwise, return to S11.
[0084] In this embodiment, in step S13, before traversing and analyzing all attribute nodes of each sub-object in the second object model group, a step of establishing object node relationships is also included, specifically:
[0085] Determine nodes: according to the object attributes of the object, determine the attribute nodes corresponding to the object attributes of the object one by one;
[0086] Establishing a node connection relationship: establishing a node connection relationship between the objects based on the control relationship between the attribute nodes;
[0087] in,
[0088] The node connection relationship can be dynamically constructed according to the control relationship between nodes set by the user, and is used to determine the controlling and controlled subordinate relationship between the object attributes of different objects.
[0089] In this embodiment, the step S13 further includes:
[0090] S13-1, obtaining all attribute nodes of the child object and other objects, generating a node queue, and traversing the node queue based on the attribute nodes and the node connection relationship between each of the attribute nodes;
[0091] S13-2, determining the closed relationship between all attribute nodes of the child object and other objects according to the traversal result; if any attribute node of the child object has a connection relationship with any attribute node of other objects, returning to step S11; if the child object does not have an attribute node that has a connection relationship with any attribute node of other objects, the node connection relationship between all attribute nodes of the child object and attribute nodes of other objects is relatively closed, and determining that the second object model grouping is the object model grouping.
[0092] In order to facilitate those skilled in the art to better understand the method provided by the present invention, this step is now further supplemented.
[0093] In actual operation, the object model group is selected and checked. For an object model group to become an object model clone group, two conditions must be met: the internal elements are not empty and the internal element structure is consistent.
[0094] like Figure 2 As shown in FIG. 1 , the process of checking whether the selected group can establish an object model clone group is described.
[0095] The consistency of the internal element structure of the object model group includes the object types contained in the object model group (i.e. what kind of objects are contained in the group, different object types such as rectangles, circles or cubes, etc.), the object organization hierarchy (i.e. the subordinate relationship of objects in the group, if a sub-object in the group also contains sub-objects, then each sub-object in the group should contain sub-objects of the same type), and object properties (i.e. whether each sub-object in the group contains the same material properties, texture properties, and position properties, etc.) are all kept completely consistent.
[0096] The object types include rectangle, circle, cube, etc.; the object attributes include material attributes, texture attributes, position attributes, etc.
[0097] The consistency of the internal element structure of the object model group also includes whether the node connection relationship between each attribute of each sub-object in the group and each attribute of other objects is relatively closed. Figure 3 As shown, the process of determining whether there is a relatively closed node connection relationship between the attribute nodes of each child object in the group and other child objects is described.
[0098] It should be noted that the consistency of the internal element structure of the object model group includes the relatively closed node connection relationship between each attribute node of each sub-object in the group and each attribute node of other objects, that is, there is consistency between each object model group, and the node connection relationship within each object model group is relatively closed, and cannot have a connection relationship with the attributes of other objects unless the object comes from this object model group. Among them, the other objects come from other object model groups.
[0099] A node connection relationship refers to converting the properties of an object (including but not limited to position, material, texture, etc.) into nodes, establishing a connection relationship based on these nodes, and making the attribute value of the controlled end change according to the change of the attribute value of the controlling end.
[0100] During operation, just drag the parameter value on a property node to the parameter value of another property node to establish a control connection relationship between the latter and the former.
[0101] For example, dragging the width parameter value of the object rectangle A attribute node to the height parameter value of the object rectangle B attribute node will make the width value of rectangle A controlled by the height value of rectangle B and always consistent with the height value of rectangle B. When the height value of rectangle B changes, the width value of rectangle A will also change to the same data.
[0102] A relatively closed connection relationship means that all attribute nodes of each child object in the group do not have a connection relationship with the attribute nodes of other objects. Under the premise of ensuring that the first child object in the group is not modified, such a connection relationship will not be affected by changes in the number of other objects in the group and is stable.
[0103] In the process of converting attributes to nodes, we can easily establish the correspondence between the object attributes and nodes. Using this correspondence, when we retrieve all the object attributes of the first child object, we can get all the nodes corresponding to these attributes.
[0104] Using the connection relationship of nodes, we can find other nodes that control the current node, or other nodes controlled by the current node. These two types of nodes are called nodes connected to the current node.
[0105] We start from any attribute node of the first child object, and use the connection relationship to continuously obtain other nodes connected to the node, and then determine whether these nodes come from other object attributes. When all the attribute nodes of the first child object are finally retrieved, we can confirm whether the connection relationship of the attribute nodes of the first child object is closed.
[0106] S2, classifying the objects in the object model clone group, determining and establishing the source object and other sub-objects in the object model clone group.
[0107] In this embodiment, the step S2 further includes:
[0108] S21, obtaining all objects in the object model clone group and the sub-objects corresponding to each object, and counting the number of all objects;
[0109] S22, classifying all objects in the object model clone group according to the number of all objects, if the value of the number of objects is equal to 1, determining the object as a source object, if the value of the number of objects is equal to or greater than 2, determining the first object in the objects as a source object, and the remaining objects are other child objects;
[0110] in,
[0111] After the source object is determined, sub-objects may be added to the source object as required.
[0112] In order to facilitate those skilled in the art to better understand the method provided by the present invention, further supplementary explanation is now given to this step. After the object model clone group is established, the objects within the object model clone group are classified and judged. Generally speaking, when a clone group is established, the internal objects are divided into two categories: 1) the source object of the clone group consisting of the first object and all the child objects of the object, and 2) other child objects.
[0113] In practical applications, it is allowed to set the group as an object model clone group when there is only one object in the group.
[0114] The source object and its other child objects together constitute the elements of the object model clone group. When counting the number of elements in the object model clone group, the source object and its other child objects are recorded.
[0115] The source object is the basis for the clone group to perform cloning operations. Once an object is confirmed as the source object of the object model clone group, its related content cannot be adjusted at will (the adjustment method must also meet the judgment of the closed connection relationship of the object attribute node mentioned above).
[0116] For example, under a group, there are four child objects ABCD of the object type, each of which is a rectangle. At this time, an object model clone group is constructed for the group, and rectangle A becomes the source object of the object model clone group, and rectangles BCD become other child objects of the object model clone group. The clone group is an object model clone group with four elements (i.e., child objects).
[0117] When adjusting the source object of the clone group, you can adjust the width and height parameter values of rectangle A, add a sub-object circle A' to rectangle A, and even change the position attribute of the newly added circle A' into a node. These operations will not destroy the closure of the attribute node connection relationship of the source object of the clone group of the object model.
[0118] However, if we want to establish a connection between the position attribute parameter Y of A' and the position attribute parameter Y of rectangle B, that is, drag the parameter Y of the position attribute node of circle A' to the parameter Y of the position attribute node of rectangle B, so that the position attribute parameter value Y position of the two objects remains consistent, such an operation will cause the attribute node from the non-clone group source object (other child object rectangle B) to appear in the attribute node connection relationship of the source object of the object model clone group, resulting in the destruction of the closed relationship, which is an operation type that cannot be performed.
[0119] If the connection relationship is established between the position attribute parameter Y of A' and the position attribute parameter Y of rectangle A, it falls within the scope of permitted operations because this operation will not destroy the closed attribute node connection relationship of the source object in the object model clone group.
[0120] Other child objects of the object model clone group are not allowed to adjust any of their internal contents, including adding or reducing child objects, adjusting the value of a certain attribute parameter, establishing a node for a certain attribute, or constructing a node connection relationship.
[0121] It should be noted that the prerequisite for establishing an object model clone group is that the attribute nodes of all child objects of the object model group and the node connections of other objects from other object model groups are relatively closed. Therefore, there will never be a situation where the attribute node connection relationship of the source object is not closed. In the existing system, a non-empty object group can also constitute the source object of an object model clone group.
[0122] S3, based on the source object, dynamically update the other sub-objects according to the object model grouping structure, destroy the other sub-objects in the object model clone group that are inconsistent with the source object, and obtain an updated object model clone group.
[0123] In this embodiment, in step S3, the step of performing object dynamic update processing on the other sub-objects based on the source object and according to the object model grouping structure further includes:
[0124] Based on the object type, organizational hierarchy and object attributes of the source object, and the node connection relationship of each attribute node, all other child objects in the object model clone group are updated one by one;
[0125] S3-1, if the object type, organizational hierarchy and object properties of the other child objects are completely consistent with the object type, organizational hierarchy and object properties of the source object, jump to step S3-2, otherwise, delete the other child objects from the object model clone group;
[0126] S3-2, if the node connection relationship of each attribute node corresponding to the other child object is the same as the node connection relationship of each attribute node corresponding to the source object, then retain the other child object, otherwise, delete the other child object from the object model clone group,
[0127] S3-3, repeating step S3-1 and step S3-1 until all other sub-objects in the object model clone group that are inconsistent with the source object are destroyed to obtain an updated object model clone group.
[0128] In this embodiment, in step S3, the step of dynamically updating the other sub-objects based on the source object and according to the object model grouping structure further includes the step of statically cloning the objects in the clone group and the step of dynamically cloning the objects in the clone group;
[0129] in,
[0130] The steps of static cloning of objects in the clone group are:
[0131] Get the number of fixed objects GL num , and the current number of objects KL in the updated object model clone group num , calculate and according to (GL num -KL num ) to update the objects in the updated object model clone group;
[0132] If (GL num -KL num ) is greater than or equal to zero, the value of the object attribute of the newly added object is obtained, and (GL num -KL num ) new other child objects;
[0133] If (GL num -KL num ) is less than zero, then delete (KL num -GL num ) other child objects;
[0134] The steps of dynamically cloning objects in the clone group are:
[0135] Receive in real time and obtain table data according to the object dynamic clone request, and obtain the dynamic object quantity DL from the table data num and the value of the object attribute, and at the same time obtain the current number of objects KL in the updated object model clone group num , real-time calculation and according to (DL num -KL num ) value dynamically updates the objects in the updated object model clone group;
[0136] If (DL num -KL num ) is greater than or equal to zero, then according to the value of the object attribute corresponding to the object dynamic clone request, and the object type, organizational hierarchy and object attribute of the source object, (DL num -KL num ) new other child objects;
[0137] If (DL num -KL num ) is less than zero, then delete (KL num -DLnum ) other child objects;
[0138] in,
[0139] While generating new other sub-objects in the updated object model clone group, module instances corresponding to the new other sub-objects are created according to the module instances of the source object, and a synchronous connection relationship is determined; when the organizational hierarchy, object properties and sub-objects of the source object are updated, the organizational hierarchy, object properties and sub-objects of all other sub-objects in the updated object model clone group are also synchronously updated.
[0140] It should be noted that when other child objects need to be deleted due to updating, the deletion operation will be performed in reverse order starting from the end.
[0141] In order to facilitate those skilled in the art to better understand the method provided by the present invention, further explanation is now given to this step. For example, in the property menu of the existing object model clone group (such as Figure 4 As shown), there is an update button. Clicking this button will cause changes to the internal elements of the object model clone group.
[0142] When an object model clone group is updated, it is necessary to determine whether there is a difference between the source object and other child objects, and extend this difference to other child objects of the object model clone group through the update operation. This is the first manifestation of the update operation of the object model clone group.
[0143] like Figure 5 As shown in the figure, the update process of other sub-objects in the object model clone group is demonstrated.
[0144] The updates of other sub-objects in the object model clone group are divided into several levels:
[0145] Object Check: Traverse and check each other child object under the object model clone group, verify the object type, organizational hierarchy, and object properties of the object to make them consistent with the source object.
[0146] Node connection relationship check: traverse each other child object in the object model clone group, and check whether there is a node in the corresponding child object attribute according to the node connection relationship of the source object, and whether the node connection relationship is consistent with the node connection relationship of the source object.
[0147] If the object check and node connection relationship check of other child objects are consistent with the source object, the child object is considered to be consistent with the source object format.
[0148] Other child objects with the same format will be kept in the clone group, and other child objects with inconsistent formats will be deleted.
[0149] Adjust the number of other sub-objects, such as Figure 6 As shown, the adjustment process of other sub-objects in the object model clone group is shown.
[0150] After the update operation of other sub-objects, only other sub-objects with the same format as the source object are left in the object model clone group. At this time, we can adjust the number of other sub-objects according to the given data (the number of objects in the object model clone group property menu, or the overall clone data table). This is the second manifestation of the clone group update operation.
[0151] There are two ways to adjust other child objects: static cloning and dynamic cloning. The main difference between the two is the determination of the number of clones. Static cloning will give the number of elements to be cloned, and use the table data to drive the relevant information of each element to be constructed. Once constructed, it will not change. The number of construction elements of dynamic cloning is completely provided by the table data. The cloned elements (i.e. objects) will change with the changes in the table data. This change includes changes in related quantities and related parameters.
[0152] By means of node connection, specific table data is connected with the parameter overall clone data and the additional data table in the object model clone group properties, thereby realizing the setting and modification of the object model clone group.
[0153] Whether it is static cloning or dynamic cloning, the creation of cloned objects is performed through clone update actions.
[0154] In the previous process of updating other sub-objects, only a few other sub-objects with the same format as the source object were retained in the object model clone group, and other sub-objects with inconsistent formats were deleted. At this time, if the number of remaining other sub-objects is greater than the number that needs to be updated, you only need to delete a few other sub-objects to meet the final demand. If the number of remaining other sub-objects is insufficient, you need to copy and paste the source object, and add the pasted result to the other sub-objects of the object model clone group to meet the relevant needs.
[0155] Because the object is copied, the resulting object must meet the object check of the source object. After copying and pasting, the node connection relationship of the source object needs to be referred to for node-related processing of the pasted object to meet the requirements of node connection check. At the same time, when the object is copied and pasted, the nodes and connection relationships corresponding to the object attributes are also copied and pasted, so that the copy of the source object can definitely get a new object with the same format as the source object.
[0156] S4, receiving driving data according to the preset derived items, and dynamically cloning and generating new objects using the driving data based on the updated object model clone group.
[0157] In this embodiment, in step S4, the step of receiving the driving data according to the preset derived items, and dynamically cloning and generating a new object using the driving data based on the updated object model clone group further includes:
[0158] Determining a preset derived item according to the object attribute of the source object, and a corresponding relationship between the preset derived item and the object attribute of the source object;
[0159] According to the designated element adjustment trigger event, receiving the designated element adjustment request in real time, parsing and determining the value of the derived item and the object numbers of other sub-objects in the updated object model clone group according to the designated element adjustment request;
[0160] If the value of the derived item is not a null value, the value of the object property of the other child object is updated according to the object number of the other child object and the corresponding relationship between the preset derived item and the object property of the source object.
[0161] In order to facilitate those skilled in the art to better understand the method provided by the present invention, this step is now further supplemented.
[0162] Adjust the specified elements according to the data: clone different objects
[0163] Although constructing new objects based on the values of cloned source objects can meet some design requirements, in actual production, it is not necessary to construct objects that are completely identical to the source objects. This requires us to dynamically adjust the parameter values of the cloned objects based on the input data after constructing the source objects.
[0164] It should be noted that the inconsistency mentioned here refers to the inconsistency of the object attribute parameter values, while the object type, organizational hierarchy, object attribute status, and node connection status of the object remain consistent.
[0165] For example, a source object of a clone group is a source object rectangle A with position, material, and texture attributes, and other sub-objects are rectangles BCD with position, material, and texture attributes. Through cloning, the color of rectangle A can be completely different from the color of rectangle BCD, and the colors of rectangles BCD are also different. Even the added rectangle E has a different color. However, rectangle F without material attributes will not be cloned, nor will rectangle G with a certain reflection attribute or attribute H containing sub-objects be cloned.
[0166] That is, the change only applies to a given specific attribute parameter value.
[0167] The method used is to modify the derived item parameter value - when constructing the source object, the parameters that need to be adjusted are set as derived items. Therefore, a source object can provide multiple derived items to modify multiple different parameter values. We write the corresponding derived item data into a table so that the table data is different cloned objects horizontally and different derived item values vertically.
[0168] After completing the operation of constructing the object, data can be read from the corresponding data table to adjust the value of the given cloned object, so that the final cloned elements show different differences.
[0169] It should be noted here that if the derived item is simply a placeholder without a specific value, the value of the corresponding parameter of the source object will be used.
[0170] Because the node connection method is used to handle the transmission of related data, when the table data transmitted by the current node changes, the corresponding parameter value of the cloned object will change accordingly. This feature can be used to handle real-time changes of cloned objects.
[0171] Process the node connection relationship of the cloned element:
[0172] In the cloning process, in addition to the object and its corresponding attributes, the nodes and connection relationships related to the object attributes are also copied accordingly. Because the source object maintains a relatively closed node connection relationship inside, the node connection relationship obtained through replication also tends to be relatively closed.
[0173] In this regard, node module instances are introduced, so that the related nodes of the source object constitute a module instance, and the related nodes of each new object obtained in the cloning process constitute a module instance of the same source. According to the mutual functions between node module instances, when the position, connection relationship, number of nodes, etc. of the nodes inside a module instance change, all module instances of the same source will synchronously update this change, so that the internal structure of the module instances of the same source will always tend to be consistent.
[0174] In actual use, each cloned module instance is hidden, and the corresponding modification operation is completed only by operating the module instance corresponding to the source object.
[0175] By applying the above technical solution, the source object in the three-dimensional scene and the object attribute of the source object are used to set the derived items, the control object or the grouping of the object is copied, and the data is used to drive it. The copied object contains all the attributes of the copied source and automatically matches the node logic relationship; only the node logic relationship of the copied source object is edited, and the logic of the corresponding node is automatically matched in the copied object. When the copy source changes, all the copied objects are automatically updated to change the corresponding objects and nodes, and the number of objects is increased or decreased as needed according to the number of objects and the change of object attributes, and the logical structure replication and synchronous update of the object structure and the internal nodes of the object are completed synchronously, that is, the on-demand update and synchronization of the type and attribute of the object are completed, and the technical problems existing in the prior art such as the fixed number of objects, poor scalability, inability to dynamically add or destroy objects, and design solidification are solved, thereby enhancing the flexibility of adding and destroying objects in the three-dimensional scene and improving the performance of the three-dimensional model object production platform.
[0176] At the same time, it also realizes the operation of constructing or destroying other sub-objects based on the input driver data and using the compared clone source object. In actual application, users can achieve variable and general change effects by customizing the clone source object and the driver data itself.
[0177] Corresponding to the method for dynamically generating and destroying object models based on a three-dimensional scene in one embodiment of the present invention, the present invention also discloses a system for dynamically generating and destroying object models based on a three-dimensional scene, such as Figure 7 As shown, the system includes a clone group establishment module, an object classification processing module, an object update processing module and a data drive processing module;
[0178] in,
[0179] The clone group establishment module is used to perform consistency check processing on the internal elements and internal element structures of the object model grouping based on the three-dimensional scene and the object model grouping structure, and establish the object model clone group according to the check processing result and the object model grouping;
[0180] The object classification processing module is used to classify the objects within the object model clone group, determine and establish the source object and other sub-objects within the object model clone group;
[0181] The object update processing module is used to perform object dynamic update processing on the other sub-objects based on the source object and according to the object model grouping structure, and destroy the other sub-objects in the object model clone group that are inconsistent with the source object to obtain an updated object model clone group;
[0182] The data driven processing module is used to receive driving data according to preset derived items, and dynamically clone and generate new objects using the driving data based on the updated object model clone group.
[0183] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referenced to each other, and each embodiment focuses on the differences from other embodiments.
[0184] The above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.
Claims
1. A method for dynamically generating and destroying object models based on a three-dimensional scene, characterized in that: The method comprises: S1, based on the three-dimensional scene and according to the object model grouping structure, performing consistency check processing on the internal elements and internal element structures of the object model grouping, and establishing an object model clone group according to the check processing result and the object model grouping; S2, classifying the objects within the object model clone group, determining and establishing the source object and other sub-objects within the object model clone group; S3, based on the source object, dynamically update the other sub-objects according to the object model grouping structure, and destroy the other sub-objects in the object model clone group that are inconsistent with the source object to obtain an updated object model clone group; S4, receiving driving data according to the preset derived items, and dynamically cloning and generating new objects using the driving data based on the updated object model clone group; In S1, based on the three-dimensional scene and according to the object model grouping structure, the step of performing consistency check on the internal elements and internal element structures of the object model grouping includes: S11, according to the clone group construction requirement, select a first object model grouping, determine the number of internal elements of the first object model grouping, if the number of internal elements of the object model grouping is equal to zero, reselect a new first object model grouping, if the number of internal elements of the object model grouping is an integer greater than zero, determine that the first object model grouping is a second object model grouping, and jump to step S12; S12, performing consistency check on the object types, organizational hierarchies and object properties of all sub-objects in the second object model grouping according to the object model grouping structure; if the object types, organizational hierarchies and object properties of all sub-objects in the second object model grouping are consistent, jump to step S13; otherwise, jump to step S11; S13, traversing and analyzing all attribute nodes of each child object in the second object model group, if the node connection relationships between all attribute nodes of all child objects in the second object model group and other objects belonging to other model groups are relatively closed, then determining that the second object model group is the object model group, and establishing the object model clone group, otherwise, jumping to step S11; in, The object model grouping structure includes object number, object, object type, organizational hierarchy and object attributes; The object includes a source object, a sub-object, and other sub-objects; The other objects are not in the same model group as the object, but are in other model groups; In step S4, the step of receiving the driving data according to the preset derived items and dynamically cloning and generating a new object using the driving data based on the updated object model clone group further includes: Determining a preset derived item according to the object attribute of the source object, and a corresponding relationship between the preset derived item and the object attribute of the source object; According to the designated element adjustment trigger event, receiving the designated element adjustment request in real time, parsing and determining the value of the derived item and the object numbers of other sub-objects in the updated object model clone group according to the designated element adjustment request; If the value of the derived item is not a null value, the value of the object property of the other child object is updated according to the object number of the other child object and the corresponding relationship between the preset derived item and the object property of the source object.
2. The method according to claim 1, characterized in that The step of S12 further comprises: S12-1, object type check: determine the object types of all sub-objects in the second object model group one by one, if there is a sub-object whose object type is inconsistent with the object type of other sub-objects, return to S11, otherwise, jump to step S12-2; S12-2, object organization hierarchy check: compare and analyze the organization hierarchy of all sub-objects in the second object model group one by one. If there is a sub-object containing sub-objects in the second object model group, and other sub-objects also contain sub-objects of the same object type, jump to step S12-3; otherwise, return to S11; S12-3, object attribute check: compare and analyze the object attributes of all sub-objects in the second object model group one by one. If the object attributes of all sub-objects in the second object model group are the same, jump to S13; otherwise, return to S11.
3. The method according to claim 1, characterized in that In step S13, before traversing and analyzing all the attribute nodes of each sub-object in the second object model group, the step of establishing the object node relationship is also included, which is specifically: Determine nodes: according to the object attributes of the object, determine the attribute nodes corresponding to the object attributes of the object one by one; Establishing a node connection relationship: establishing a node connection relationship between the objects based on the control relationship between the attribute nodes; in, The node connection relationship is dynamically constructed according to the control relationship between nodes set by the user, and is used to determine the controlling and controlled subordinate relationship between the object attributes of different objects.
4. The method according to claim 1, characterized in that The step of S13 further comprises: S13-1, obtaining all attribute nodes of the child object and other objects, generating a node queue, and traversing the node queue based on the attribute nodes and the node connection relationship between each of the attribute nodes; S13-2, determining the closed relationship between all attribute nodes of the child object and other objects based on the traversal result; if any attribute node of the child object has a connection relationship with any attribute node of other objects, returning to step S11; if the child object does not have an attribute node that has a connection relationship with any attribute node of other objects, the node connection relationship between all attribute nodes of the child object and attribute nodes of other objects is relatively closed, and determining that the second object model grouping is the object model grouping.
5. The method according to claim 1, characterized in that The step of S2 further comprises: S21, obtaining all objects in the object model clone group and the sub-objects corresponding to each object, and counting the number of all objects; S22, classifying all objects in the object model clone group according to the number of all objects, if the value of the number of objects is equal to 1, then determining the object as a source object, if the value of the number of objects is equal to or greater than 2, then determining that the objects are source objects, and the remaining objects are other sub-objects; in, After the source object is determined, sub-objects may be added to the source object as required.
6. The method according to claim 1, characterized in that In step S3, based on the source object, the step of dynamically updating the other sub-objects according to the object model grouping structure further includes: Based on the object type, organizational hierarchy and object attributes of the source object, and the node connection relationship of each attribute node, all other child objects in the object model clone group are updated one by one; S3-1, if the object type, organizational hierarchy and object properties of the other child objects are completely consistent with the object type, organizational hierarchy and object properties of the source object, jump to step S3-2, otherwise, delete the other child objects from the object model clone group; S3-2, if the node connection relationship of each attribute node corresponding to the other child object is the same as the node connection relationship of each attribute node corresponding to the source object, then retain the other child object, otherwise, delete the other child object from the object model clone group, S3-3, repeating step S3-1 and step S3-1 until all other sub-objects in the object model clone group that are inconsistent with the source object are destroyed to obtain an updated object model clone group.
7. The method according to claim 1, characterized in that In step S3, the step of dynamically updating the other sub-objects based on the source object and according to the object model grouping structure also includes the steps of static cloning of the objects in the clone group and dynamic cloning of the objects in the clone group; in, The steps of static cloning of objects in the clone group are: Get the number of fixed objects GL num , and the current number of objects KL in the updated object model clone group num , calculate and according to (GL num -KL num ) to update the objects in the updated object model clone group; If (GL num -KL num ) is greater than or equal to zero, then the value of the object attribute of the newly added object is obtained, and according to the object type, organizational hierarchy and object attribute of the source object, (GL num -KL num ) new other child objects; If (GL num -KL num ) is less than zero, then delete (KL num -GL num ) other child objects; The steps of dynamically cloning objects in the clone group are: Receive in real time and obtain table data according to the object dynamic clone request, and obtain the dynamic object quantity DL from the table data num and the value of the object attribute, and at the same time obtain the current number of objects KL in the updated object model clone group num , real-time calculation and according to (DL num -KL num ) value dynamically updates the objects in the updated object model clone group; If (DL num -KL num ) is greater than or equal to zero, then according to the value of the object attribute corresponding to the object dynamic clone request, and the object type, organizational hierarchy and object attribute of the source object, (DL num -KL num ) new other child objects; If (DL num -KL num ) is less than zero, then delete (KL num -DL num ) other child objects; in, While generating new other sub-objects in the updated object model clone group, module instances corresponding to the new other sub-objects are created according to the module instances of the source object, and a synchronous connection relationship is determined; when the organizational hierarchy, object properties and sub-objects of the source object are updated, the organizational hierarchy, object properties and sub-objects of all other sub-objects in the updated object model clone group are also synchronously updated.
8. A system for implementing the method for dynamically generating and destroying object models based on three-dimensional scenes as claimed in claim 1, characterized in that: The system includes a clone group establishment module, an object classification processing module, an object update processing module and a data drive processing module; in, The clone group establishment module is used to perform consistency check processing on the internal elements and internal element structures of the object model grouping based on the three-dimensional scene and the object model grouping structure, and establish the object model clone group according to the check processing result and the object model grouping; The object classification processing module is used to classify the objects within the object model clone group, determine and establish the source object and other sub-objects within the object model clone group; The object update processing module is used to perform object dynamic update processing on the other sub-objects based on the source object and according to the object model grouping structure, and destroy the other sub-objects in the object model clone group that are inconsistent with the source object to obtain an updated object model clone group; The data driven processing module is used to receive driving data according to preset derived items, and dynamically clone and generate new objects using the driving data based on the updated object model clone group.