CN117853691B - Graphic processing method and system of three-dimensional model - Google Patents
Graphic processing method and system of three-dimensional model Download PDFInfo
- Publication number
- CN117853691B CN117853691B CN202311822550.7A CN202311822550A CN117853691B CN 117853691 B CN117853691 B CN 117853691B CN 202311822550 A CN202311822550 A CN 202311822550A CN 117853691 B CN117853691 B CN 117853691B
- Authority
- CN
- China
- Prior art keywords
- model
- replacement
- original
- dimensional
- calibration
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000003672 processing method Methods 0.000 title claims abstract description 13
- 238000000034 method Methods 0.000 claims abstract description 55
- 238000012545 processing Methods 0.000 claims abstract description 32
- 238000004364 calculation method Methods 0.000 claims description 9
- 239000007787 solid Substances 0.000 claims description 3
- 230000008569 process Effects 0.000 abstract description 19
- 230000007547 defect Effects 0.000 abstract description 4
- 230000008901 benefit Effects 0.000 description 12
- 230000004048 modification Effects 0.000 description 9
- 238000012986 modification Methods 0.000 description 9
- 238000005516 engineering process Methods 0.000 description 6
- 101001121408 Homo sapiens L-amino-acid oxidase Proteins 0.000 description 5
- 102100026388 L-amino-acid oxidase Human genes 0.000 description 5
- 238000010586 diagram Methods 0.000 description 5
- 239000000178 monomer Substances 0.000 description 4
- 238000004891 communication Methods 0.000 description 3
- 230000003993 interaction Effects 0.000 description 3
- 230000000717 retained effect Effects 0.000 description 3
- 101000827703 Homo sapiens Polyphosphoinositide phosphatase Proteins 0.000 description 2
- 102100023591 Polyphosphoinositide phosphatase Human genes 0.000 description 2
- 101100012902 Saccharomyces cerevisiae (strain ATCC 204508 / S288c) FIG2 gene Proteins 0.000 description 2
- 101100233916 Saccharomyces cerevisiae (strain ATCC 204508 / S288c) KAR5 gene Proteins 0.000 description 2
- 230000000712 assembly Effects 0.000 description 2
- 238000000429 assembly Methods 0.000 description 2
- 230000007812 deficiency Effects 0.000 description 2
- 238000006073 displacement reaction Methods 0.000 description 2
- 230000003631 expected effect Effects 0.000 description 2
- 230000006870 function Effects 0.000 description 2
- 230000004044 response Effects 0.000 description 2
- 238000013519 translation Methods 0.000 description 2
- 230000003044 adaptive effect Effects 0.000 description 1
- 238000004458 analytical method Methods 0.000 description 1
- 239000003086 colorant Substances 0.000 description 1
- 238000012217 deletion Methods 0.000 description 1
- 230000037430 deletion Effects 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 230000002452 interceptive effect Effects 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000012216 screening Methods 0.000 description 1
- 230000009466 transformation Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T19/00—Manipulating 3D models or images for computer graphics
- G06T19/20—Editing of 3D images, e.g. changing shapes or colours, aligning objects or positioning parts
Landscapes
- Engineering & Computer Science (AREA)
- Architecture (AREA)
- Computer Graphics (AREA)
- Computer Hardware Design (AREA)
- General Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Processing Or Creating Images (AREA)
Abstract
Description
技术领域Technical Field
本发明涉及图形处理技术领域,尤其涉及一种三维模型的图形处理方法及系统。The present invention relates to the field of graphics processing technology, and in particular to a graphics processing method and system for a three-dimensional model.
背景技术Background Art
当前对三维场景的处理包括编辑和替换。但是,编辑和替换普遍需要通过手动的方式来处理,无法由系统自动处理。例如,当前的CAD/CAM技术广泛应用于三维模型的编辑和替换处理。利用CAD/CAM技术能够实现对三维模型的参数化修改和替换操作。现有的三维建模软件还包括3ds Max、Maya等软件,通过手动方式来选择三维模型节点,对齐进行删除/隐藏的操作,然后将新三维模型插入需要的场景中。The current processing of 3D scenes includes editing and replacement. However, editing and replacement generally need to be processed manually and cannot be processed automatically by the system. For example, current CAD/CAM technology is widely used in the editing and replacement of 3D models. CAD/CAM technology can be used to implement parametric modification and replacement operations on 3D models. Existing 3D modeling software also includes 3ds Max, Maya and other software, which manually select 3D model nodes, align them for deletion/hiding operations, and then insert the new 3D model into the required scene.
上述三维模型处理系统普遍存在的缺点包括:需要以手动的方式来调整并实现三维模型的替换。例如,部分图形处理软件不支持三维模型的修改。当三维模型需要修改时,需要将三维模型先从当前的场景删除,然后导入第三方图形处理系统进行修改,通过再次缩放来调整三维模型的大小后,再导入当前场景以查看三维模型的修改结果。再例如,即使部分图形处理软件支持三维模型的修改,其调整步骤也比较繁琐。在三维模型替换后,还需要利用修改工具来对三维模型进行缩放、变换位置等调整步骤。明显地,对三维模型的手动处理步骤需要耗费大量的时间和精力。当前的针对三维模型的图像处理软件仅涉及三维模型的替换功能,忽略了用户对操作的边界和时效的要求。The common shortcomings of the above-mentioned three-dimensional model processing system include: the need to manually adjust and replace the three-dimensional model. For example, some graphics processing software does not support the modification of the three-dimensional model. When the three-dimensional model needs to be modified, the three-dimensional model needs to be deleted from the current scene first, then imported into a third-party graphics processing system for modification, and the size of the three-dimensional model is adjusted by scaling again, and then imported into the current scene to view the modification result of the three-dimensional model. For another example, even if some graphics processing software supports the modification of the three-dimensional model, its adjustment steps are relatively cumbersome. After the three-dimensional model is replaced, it is also necessary to use a modification tool to perform adjustment steps such as scaling and changing the position of the three-dimensional model. Obviously, the manual processing steps of the three-dimensional model require a lot of time and energy. The current image processing software for three-dimensional models only involves the replacement function of the three-dimensional model, ignoring the user's requirements for the boundaries and timeliness of the operation.
例如,公开号为CN115457202A的专利申请文件公开了一种三维模型更新的方法,该方法包括获取指定区域的航拍图像,基于航拍图像以及预设航拍图像确定出预设航拍图像中的待替换目标物以及航拍图像中的待更新目标物,从指定区域的三维模型中确定出待替换目标物的单体模型,基于航拍图像确定待更新目标物的三维矢量数据,基于三维矢量数据,确定待更新目标物的待更新单体模型,将待替换目标物的单体模型替换为对应的待更新单体模型,得到指定区域更新后的三维模型。该专利虽然能够对三维模型进行尺寸上的匹配,但是其只能处理拍摄角度一致的模型,对于拍摄角度不同、间距不同的三维模型,仍然需要手动处理来调整各个模型的间距。此外,该专利只能用于单一模型的逐个替换,无法用于由若干三维模型构成的三维模型组合的替换和更新。For example, a patent application document with publication number CN115457202A discloses a method for updating a three-dimensional model, which includes obtaining an aerial image of a specified area, determining a target object to be replaced in a preset aerial image and a target object to be updated in the aerial image based on the aerial image and the preset aerial image, determining a monomer model of the target object to be replaced from the three-dimensional model of the specified area, determining three-dimensional vector data of the target object to be updated based on the aerial image, determining a monomer model to be updated of the target object to be updated based on the three-dimensional vector data, replacing the monomer model of the target object to be replaced with the corresponding monomer model to be updated, and obtaining the updated three-dimensional model of the specified area. Although the patent can match the size of the three-dimensional model, it can only process models with the same shooting angle. For three-dimensional models with different shooting angles and different spacings, manual processing is still required to adjust the spacing of each model. In addition, the patent can only be used for replacing a single model one by one, and cannot be used for replacing and updating a three-dimensional model combination composed of several three-dimensional models.
再例如,公开号为CN107690673A的专利申请公开了一种图像处理方法。该方法包括:确定终端发送的目标图像中包括的目标子图像;从三维模型库中确定与目标子图像对应的目标对象相匹配的目标三维模型;基于目标三维模型,在目标图像中对目标子图像进行图像替换;向终端发送经图像替换后的目标图像。该专利也是对三维模型进行一对一替换,无法对由若干三维模型构成的整套三维模型组合进行一次性自动调整和替换。For another example, the patent application with publication number CN107690673A discloses an image processing method. The method includes: determining a target sub-image included in a target image sent by a terminal; determining a target three-dimensional model that matches a target object corresponding to the target sub-image from a three-dimensional model library; performing image replacement on the target sub-image in the target image based on the target three-dimensional model; and sending the target image after image replacement to the terminal. This patent also performs a one-to-one replacement of three-dimensional models, and cannot automatically adjust and replace a whole set of three-dimensional model combinations consisting of several three-dimensional models at one time.
因此,如何对多个三维模型进行一次性自动替换,减少手动调整的步骤,同时解决在替换的过程中各个三维模型之间的间距无法满足要求的问题,是当前的图像处理系统或者图像处理软件无法解决的。Therefore, how to automatically replace multiple 3D models at one time, reduce the steps of manual adjustment, and solve the problem that the spacing between the 3D models cannot meet the requirements during the replacement process is something that current image processing systems or image processing software cannot solve.
本发明希望改进当前三维模型的替换方法或系统,提供一种减少手动调整步骤的三维模型的图形处理系统及方法。The present invention aims to improve the current three-dimensional model replacement method or system, and provide a three-dimensional model graphics processing system and method that reduces the manual adjustment steps.
此外,一方面由于对本领域技术人员的理解存在差异;另一方面由于申请人做出本发明时研究了大量文献和专利,但篇幅所限并未详细罗列所有的细节与内容,然而这绝非本发明不具备这些现有技术的特征,相反本发明已经具备现有技术的所有特征,而且申请人保留在背景技术中增加相关现有技术之权利。In addition, on the one hand, there are differences in understanding among those skilled in the art; on the other hand, the applicant studied a large number of documents and patents when making the present invention, but due to space limitations, not all details and contents are listed in detail. However, this does not mean that the present invention does not have the characteristics of these prior arts. On the contrary, the present invention already has all the characteristics of the prior art, and the applicant reserves the right to add relevant prior art to the background technology.
发明内容Summary of the invention
当前市场上的三维模型处理系统,当需要对三维模型进行替换时,普遍需要通过手动来对替换模型进行调整,例如调整替换模型的缩放比例、大小、间距等等。大量的手动操作明显增加了处理三维图形的工作人员的工作量,并且降低了其工作效率。例如,在需要替换三维场景中的三维模型的情况下,需要将替换模型导入第三方系统进行修改,在修改完成后再导入原三维场景中。或者,手动调整替换模型的大小、间距、取向等参数,反复调整直至替换模型合适,这耗费了大量的时间和工作精力。When a 3D model needs to be replaced, the 3D model processing systems currently on the market generally need to manually adjust the replacement model, such as adjusting the scale, size, spacing, etc. of the replacement model. A large number of manual operations have significantly increased the workload of the staff who process 3D graphics and reduced their work efficiency. For example, when a 3D model in a 3D scene needs to be replaced, the replacement model needs to be imported into a third-party system for modification, and then imported into the original 3D scene after the modification is completed. Alternatively, the size, spacing, orientation and other parameters of the replacement model are manually adjusted, and the adjustments are repeated until the replacement model is suitable, which consumes a lot of time and work energy.
现有技术已经出现基于三维模型的网格划分来实现部分三维模型自动替换的技术方案。例如,公开号为CN115861549A的专利文献公开了一种自动替换实景三维数据中树木模型的方法和装置,该方法在获取待处理遥感影像对应的OSGB数据中的第一三维网格数据和相应的纹理数据后,对第一三维网格数据和相应的纹理数据进行网格划分,得到具有色值的树木网格数据和非树木网格数据;在去除当前的树木模型后,基于非树木网格数据中地面部分的第一三维网格数据和地面部分的纹理数据,对去除树木模型后的孔洞网格数据进行填充;基于树木网格数据,计算各树木模型的平移向量和缩放尺寸;根据平移向量和缩放尺寸,对相应树木模型进行三维坐标变换,以将坐标变换后的树木模型在待处理遥感影像的目标区域实景中进行替换。然而,该技术方案中以去除树木模型后的孔洞网格数据作为校准模型的生成基准,不同校准模型的模型要素都是根据不同位置处的孔洞网格数据确定的,相当于将校准模型与局部的三维空间进行匹配,无法实现本发明基于全局三维空间的校准模型替换过程。The prior art has already presented a technical solution for automatically replacing part of the three-dimensional model based on the mesh division of the three-dimensional model. For example, the patent document with the publication number CN115861549A discloses a method and device for automatically replacing the tree model in the real scene three-dimensional data. After obtaining the first three-dimensional mesh data and the corresponding texture data in the OSGB data corresponding to the remote sensing image to be processed, the method meshes the first three-dimensional mesh data and the corresponding texture data to obtain the tree mesh data and non-tree mesh data with color values; after removing the current tree model, the hole mesh data after the tree model is removed is filled based on the first three-dimensional mesh data of the ground part and the texture data of the ground part in the non-tree mesh data; based on the tree mesh data, the translation vector and scaling size of each tree model are calculated; according to the translation vector and scaling size, the corresponding tree model is transformed into three-dimensional coordinates to replace the tree model after the coordinate transformation in the real scene of the target area of the remote sensing image to be processed. However, in this technical solution, the hole grid data after removing the tree model is used as the basis for generating the calibration model. The model elements of different calibration models are determined according to the hole grid data at different positions, which is equivalent to matching the calibration model with the local three-dimensional space. It is impossible to realize the calibration model replacement process based on the global three-dimensional space of the present invention.
针对现有技术之不足,本发明从第一方面提供了一种三维模型的图形处理方法,方法包括:初始化三维场景内的三维空间;将三维空间基于替换要素进行区域划分;根据替换要素来将替换模型调整为校准模型,并且使用校准模型替换原始模型。In view of the deficiencies in the prior art, the present invention provides a three-dimensional model graphics processing method from a first aspect, the method comprising: initializing a three-dimensional space within a three-dimensional scene; dividing the three-dimensional space into regions based on replacement elements; adjusting the replacement model to a calibration model according to the replacement elements, and using the calibration model to replace the original model.
与上述现有技术相比,本发明能够将替换要素作为替换模型的调整尺度,并作为不同替换模型与三维空间的校准连接桥梁。基于上述区别技术特征,本发明要解决的问题可以包括:如何将具有不同初始模型参数的替换模型调整为便于直接进行替换的校准模型,以降低模型替换的操作步骤并提高模型替换的效率。具体地,本发明通过将三维场景内的原始模型进行区域划分,能够预先确定该区域内的原始模型的替换要素。当替换模型被选定时,能够根据替换要素自动调整替换模型,减少手动输入替换要素的步骤,实现替换模型的自动化校准。本发明的优势在于,不需要使用第三方系统,减少了手动调整的步骤,校准后的替换模型能够直接替换原始模型,能够直接融入三维场景中。Compared with the above-mentioned prior art, the present invention can use the replacement elements as the adjustment scale of the replacement model, and as a calibration connection bridge between different replacement models and the three-dimensional space. Based on the above-mentioned distinguishing technical features, the problems to be solved by the present invention may include: how to adjust the replacement model with different initial model parameters into a calibration model that is convenient for direct replacement, so as to reduce the operation steps of model replacement and improve the efficiency of model replacement. Specifically, the present invention can predetermine the replacement elements of the original model in the area by dividing the original model in the three-dimensional scene into regions. When the replacement model is selected, the replacement model can be automatically adjusted according to the replacement elements, reducing the steps of manually inputting the replacement elements, and realizing the automatic calibration of the replacement model. The advantage of the present invention is that there is no need to use a third-party system, reducing the steps of manual adjustment, and the calibrated replacement model can directly replace the original model and can be directly integrated into the three-dimensional scene.
根据一个优选实施方式,替换要素包括:中心位置、相互间距、绝对间距及其彼此之间的组合。与上述现有技术相比,本发明能够通过不同的替换要素来联合计算并调整替换模型。基于上述区别技术特征,本发明要解决的问题可以包括:如何提高三维模型的替换效率。针对现有技术中无目标的手动调整的方式,本发明基于原始模型的中心位置、相互间距、绝对间距等替换要素来自动调整替换模型,使得校准后的校准模型能够直接融入三维场景中,不需要调整校准模型与三维场景中周围原始模型的间距。According to a preferred embodiment, the replacement elements include: center position, mutual spacing, absolute spacing and combinations thereof. Compared with the above-mentioned prior art, the present invention can jointly calculate and adjust the replacement model through different replacement elements. Based on the above-mentioned distinguishing technical features, the problems to be solved by the present invention may include: how to improve the replacement efficiency of the three-dimensional model. In response to the targetless manual adjustment method in the prior art, the present invention automatically adjusts the replacement model based on the replacement elements such as the center position, mutual spacing, absolute spacing and the like of the original model, so that the calibrated calibration model can be directly integrated into the three-dimensional scene without adjusting the spacing between the calibration model and the surrounding original models in the three-dimensional scene.
根据一个优选实施方式,将替换模型调整为校准模型的方式包括:基于原始模型的中心位置和取向特征来将替换模型调整为校准模型;和/或基于三维空间内的原始模型的相对几何位置关系来将替换模型调整为校准模型。与上述现有技术相比,本发明能够基于原始模型的不同替换要素来调整替换模型。基于上述区别技术特征,本发明要解决的问题可以包括:如何提高替换模型调整的效率以及准确性。具体地,针对不同的替换要素,替换模型的调整方式和计算步骤也是不同的。通过中心位置和取向特征调整替换模型的优势在于,能够避免替换模型偏移,也能够减少替换模型的取向的手动操作步骤。通过相对几何位置关系调整替换模型的优势在于,能够使得替换模型与周围原始模型的间距与原三维场景一致或者等比例变化,避免替换模型与周围原始模型的间距不恰当且反复调整的情况发生。According to a preferred embodiment, the method of adjusting the replacement model to the calibration model includes: adjusting the replacement model to the calibration model based on the center position and orientation characteristics of the original model; and/or adjusting the replacement model to the calibration model based on the relative geometric position relationship of the original model in the three-dimensional space. Compared with the above-mentioned prior art, the present invention can adjust the replacement model based on different replacement elements of the original model. Based on the above-mentioned distinguishing technical features, the problems to be solved by the present invention may include: how to improve the efficiency and accuracy of the replacement model adjustment. Specifically, for different replacement elements, the adjustment method and calculation steps of the replacement model are also different. The advantage of adjusting the replacement model by the center position and orientation characteristics is that the displacement of the replacement model can be avoided, and the manual operation steps of the orientation of the replacement model can also be reduced. The advantage of adjusting the replacement model by the relative geometric position relationship is that the distance between the replacement model and the surrounding original models can be made consistent with the original three-dimensional scene or proportionally changed, avoiding the situation where the distance between the replacement model and the surrounding original models is inappropriate and repeatedly adjusted.
根据一个优选实施方式,将替换模型调整为校准模型的方式包括:基于原始模型的中心位置和取向特征来确定被选定的替换模型的中心位置和取向特征;基于原始模型与替换模型的比例关系来调整替换模型,使得替换模型调整为校准模型。通过比例关系调整替换模型,使得替换模型与原始模型的大小一致,同时替换模型的几何中心与原始模型一致,避免替换模型出现分布不均匀,三维形状偏移等情况。According to a preferred embodiment, the method of adjusting the replacement model to the calibration model includes: determining the center position and orientation characteristics of the selected replacement model based on the center position and orientation characteristics of the original model; adjusting the replacement model based on the proportional relationship between the original model and the replacement model, so that the replacement model is adjusted to the calibration model. The replacement model is adjusted by the proportional relationship so that the size of the replacement model is consistent with that of the original model, and the geometric center of the replacement model is consistent with that of the original model, so as to avoid uneven distribution of the replacement model, three-dimensional shape deviation, etc.
根据一个优选实施方式,将替换模型调整为校准模型的方式还包括:计算原始模型之间的第一相互间距比例;基于第一相互间距比例来调整替换模型之间的第二相互间距比例,形成校准模型;在将校准模型替换原始模型的过程中,基于第二相互间距比例来确定校准模型的位置,其中,校准模型的取向特征与原始模型的取向特征一致。与上述现有技术相比,本发明能够根据原始模型之间的间距比例关系来调整替换模型之间的间距比例关系,并将其用于形成校准模型。基于上述区别技术特征,本发明要解决的问题可以包括:如何防止替换后的模型与原始模型产生干涉或者替换后的模型比例关系与原始模型不协调。具体地,在较多的情况下,替换模型与周围原始模型之间的间距与原三维场景不一致,这样导致的缺陷包括:替换模型与周围的原始模型产生碰撞或者不和谐;替换模型内的若干子三维模型彼此之间的间距不协调。本发明通过预先设置的相互间距来调整替换模型,使得调整后的校准模型能够直接与周围的原始模型协调设置,或者使得校准模型内的若干子三维模型内部的间距能够等比例变化,避免部分替换模型挤在一起。According to a preferred embodiment, the method of adjusting the replacement model to the calibration model also includes: calculating a first mutual spacing ratio between the original models; adjusting a second mutual spacing ratio between the replacement models based on the first mutual spacing ratio to form a calibration model; in the process of replacing the calibration model with the original model, determining the position of the calibration model based on the second mutual spacing ratio, wherein the orientation feature of the calibration model is consistent with the orientation feature of the original model. Compared with the above-mentioned prior art, the present invention can adjust the spacing ratio relationship between the replacement models according to the spacing ratio relationship between the original models, and use it to form the calibration model. Based on the above-mentioned distinguishing technical features, the problems to be solved by the present invention may include: how to prevent the replaced model from interfering with the original model or the replacement model ratio relationship from being inconsistent with the original model. Specifically, in many cases, the spacing between the replacement model and the surrounding original models is inconsistent with the original three-dimensional scene, and the defects caused by this include: the replacement model collides or is not harmonious with the surrounding original models; the spacing between several sub-three-dimensional models in the replacement model is not coordinated. The present invention adjusts the replacement model by pre-setting the mutual spacing, so that the adjusted calibration model can be directly coordinated with the surrounding original models, or the spacing inside several sub-three-dimensional models in the calibration model can be changed in proportion to avoid some replacement models from being crowded together.
根据一个优选实施方式,方法还包括:计算位于三维场景外的固定三维模型与原始模型之间的绝对间距,基于绝对间距、原始模型之间的第一相互间距比例来将替换模型调整为校准模型,并且确定校准模型的位置。基于三维场景内的情况不同,原始模型需要与指定的固定三维模型维持绝对间距,因此替换模型也需要与固定三维模型维持绝对间距,这样才能够在替换后避免手动调节间距,使得校准模型能够一次性调节至恰当的尺寸和缩放比例,减少手动操作的次数。According to a preferred embodiment, the method further includes: calculating the absolute distance between the fixed three-dimensional model outside the three-dimensional scene and the original model, adjusting the replacement model to the calibration model based on the absolute distance and the first mutual distance ratio between the original models, and determining the position of the calibration model. Based on different situations in the three-dimensional scene, the original model needs to maintain an absolute distance with the specified fixed three-dimensional model, so the replacement model also needs to maintain an absolute distance with the fixed three-dimensional model, so that manual adjustment of the distance can be avoided after replacement, so that the calibration model can be adjusted to the appropriate size and scaling ratio at one time, reducing the number of manual operations.
根据一个优选实施方式,方法还包括:在两个原始模型之间的绝对间距需要以不变的方式设置的情况下,以保留绝对间距的方式调整至少两个替换模型之间和/或替换模型与固定模型之间的相互间距。这样设置,能够使校准模型在被放入三维场景后也自动保持绝对间距,减少替换模型与原始模型在布置时的差异性。According to a preferred embodiment, the method further comprises: when the absolute spacing between the two original models needs to be set in an unchanged manner, adjusting the mutual spacing between at least two replacement models and/or between the replacement model and the fixed model in a manner that retains the absolute spacing. This arrangement enables the calibration model to automatically maintain the absolute spacing after being placed in the three-dimensional scene, thereby reducing the difference between the replacement model and the original model in arrangement.
本发明从第二方面还提供一种三维模型的图形处理系统,包括处理器。处理器被配置为:初始化三维场景内的三维空间;将三维空间基于替换要素进行区域划分;根据替换要素来将替换模型调整为校准模型,并且使用校准模型替换原始模型。本发明的图形处理系统的优势在于,能够在将原始模型替换的过程中,自动计算并调整替换模型至恰当尺寸、分布的校准模型,使得校准模型能够直接替换原始模型且不需要再次手动操作,减少三维模型的手动操作次数,提高三维模型替换的效率。The present invention also provides a three-dimensional model graphics processing system from a second aspect, including a processor. The processor is configured to: initialize a three-dimensional space within a three-dimensional scene; divide the three-dimensional space into regions based on replacement elements; adjust the replacement model to a calibration model based on the replacement elements, and use the calibration model to replace the original model. The advantage of the graphics processing system of the present invention is that it can automatically calculate and adjust the replacement model to a calibration model of appropriate size and distribution during the process of replacing the original model, so that the calibration model can directly replace the original model without manual operation again, thereby reducing the number of manual operations of the three-dimensional model and improving the efficiency of three-dimensional model replacement.
根据一个优选实施方式,处理器还被配置为:基于原始模型的中心位置和取向特征来将替换模型调整为校准模型;和/或基于三维空间内的原始模型的相对几何位置关系来将替换模型调整为校准模型。本发明的系统的优势还包括:通过中心位置和相对几何位置关系来调整替换模型,能够避免替换模型整体上的结构偏移,也能够使得替换模型的取向自动与原始模型一致,不需要人工手动操作调整。According to a preferred embodiment, the processor is further configured to: adjust the replacement model to the calibration model based on the center position and orientation characteristics of the original model; and/or adjust the replacement model to the calibration model based on the relative geometric position relationship of the original model in three-dimensional space. The advantages of the system of the present invention also include: adjusting the replacement model through the center position and the relative geometric position relationship can avoid the structural deviation of the replacement model as a whole, and can also make the orientation of the replacement model automatically consistent with the original model without manual adjustment.
根据一个优选实施方式,处理器还被配置为:计算位于三维场景外的固定三维模型与原始模型之间的绝对间距,基于绝对间距、原始模型之间的第一相互间距比例来将替换模型调整为校准模型,并且确定校准模型的位置。这样调整的优势还包括:避免替换模型与三维场景内周围其他原始模型的不合理间距的出现,减少替换模型被调整的次数。According to a preferred embodiment, the processor is further configured to: calculate the absolute distance between the fixed three-dimensional model outside the three-dimensional scene and the original model, adjust the replacement model to the calibration model based on the absolute distance and the first mutual distance ratio between the original models, and determine the position of the calibration model. Such adjustment also has the advantages of: avoiding the occurrence of unreasonable distances between the replacement model and other surrounding original models in the three-dimensional scene, and reducing the number of times the replacement model is adjusted.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
图1是本发明提供的三维模型替换过程的逻辑示意图;FIG1 is a logical schematic diagram of a three-dimensional model replacement process provided by the present invention;
图2是本发明提供的三维模型的图形处理方法的步骤示意图;FIG2 is a schematic diagram of the steps of the graphics processing method of a three-dimensional model provided by the present invention;
图3是本发明提供的三维模型的图形处理系统的结构示意图;FIG3 is a schematic diagram of the structure of a graphics processing system for a three-dimensional model provided by the present invention;
图4是本发明提供的其中实施方式的图形处理方法的步骤示意图;FIG4 is a schematic diagram of steps of a graphics processing method according to an embodiment of the present invention;
图5是本发明提供的显示界面的结构示意图。FIG. 5 is a schematic diagram of the structure of the display interface provided by the present invention.
附图标记列表Reference numerals list
100:原始模型;200:替换模型;300:校准模型;400:三维场景;500:图形处理系统;501:显示界面;502:显示组件;503:交互组件;504:存储组件;505:处理器;506:通讯组件;507:第三方数据库。100: original model; 200: replacement model; 300: calibration model; 400: three-dimensional scene; 500: graphics processing system; 501: display interface; 502: display component; 503: interaction component; 504: storage component; 505: processor; 506: communication component; 507: third-party database.
具体实施方式DETAILED DESCRIPTION
下面结合附图进行详细说明。The following is a detailed description with reference to the accompanying drawings.
原始模型100:在三维场景400中存在且需要被替换的三维模型。原始模型100不限于单一的三维模型,还可以指由若干子三维模型按照一定的分布特征组合形成的成套的三维模型组合件。在三维模型组合件中,可以存在多重套装组合模式。Original model 100: a 3D model that exists in the 3D scene 400 and needs to be replaced. The original model 100 is not limited to a single 3D model, but can also refer to a set of 3D model assemblies formed by combining several sub-3D models according to certain distribution characteristics. In the 3D model assembly, there can be multiple set combination modes.
替换模型200:用来替换原始模型100的三维模型。替换模型200可以存储于数据库或者本地存储装置中。替换模型200不限于单一的三维模型,还可以指由若干子三维模型按照一定的分布特征组合形成的成套的三维模型组合件。在三维模型组合件中,也可以存在多重套装组合模式。替换模型200与被替换的原始模型100内的若干子三维模型的布局特征可以相同,也可以不相同。Replacement model 200: A three-dimensional model used to replace the original model 100. The replacement model 200 can be stored in a database or a local storage device. The replacement model 200 is not limited to a single three-dimensional model, but can also refer to a set of three-dimensional model assemblies formed by combining several sub-three-dimensional models according to certain distribution characteristics. In the three-dimensional model assembly, there can also be multiple set combination modes. The layout features of the replacement model 200 and the several sub-three-dimensional models in the replaced original model 100 can be the same or different.
校准模型300:是替换模型200经过调整系数、修改、缩放等过程后形成的三维模型。校准模型300能够直接替换原始模型100。The calibration model 300 is a three-dimensional model formed after the replacement model 200 has been subjected to processes such as coefficient adjustment, modification, and scaling. The calibration model 300 can directly replace the original model 100 .
三维场景400:指包括所有的对象的三维空间。在处于未替换状态时,三维场景400内也包括原始模型100。The three-dimensional scene 400 refers to a three-dimensional space including all objects. When in an unreplaced state, the three-dimensional scene 400 also includes the original model 100 .
中心位置:在三维模型为单个立体模型的情况下,中心位置是指三维模型的几何中心位置。在三维模型为组合件模型的情况下,中心位置是指组合模型的整体结构的几何中心位置。Center position: When the 3D model is a single solid model, the center position refers to the geometric center position of the 3D model. When the 3D model is an assembly model, the center position refers to the geometric center position of the overall structure of the assembly model.
取向特征:是指三维模型的方向特征。方向特征可以包括三维模型的三维大小、主要方向等特征。Orientation features: refers to the directional features of a 3D model. Direction features can include the 3D size, main direction, and other features of the 3D model.
当进行三维模型的替换操作时,现有技术中的图形处理系统总是出现不满足预期效果的情况。在三维模型替换后,替换模型200和周围的三维模型会发生干涉的情况(例如发生碰撞,或者三维模型之间的间距不符合预期),这时需要通过大量的手动操作来对替换模型200进行调整才能够达到预期的效果。When performing a replacement operation of a 3D model, the graphics processing system in the prior art always fails to meet the expected effect. After the 3D model is replaced, the replacement model 200 and the surrounding 3D models may interfere with each other (for example, a collision occurs, or the spacing between the 3D models does not meet the expectations). In this case, a large number of manual operations are required to adjust the replacement model 200 to achieve the expected effect.
针对现有技术的不足,本发明希望提供一种三维模型的图形处理方法及系统。本发明还可以是一种三维模型替换方法及系统。本发明还可以是一种三维场景自动调整系统及方法。当应用于游戏技术领域时,本发明还可以是一种游戏场景处理装置及方法。当应用于数字孪生技术领域时,本发明还可以是一种数字孪生系统,或者一种数字孪生场景的自适应调整系统及方法。In view of the deficiencies of the prior art, the present invention hopes to provide a three-dimensional model graphics processing method and system. The present invention can also be a three-dimensional model replacement method and system. The present invention can also be a three-dimensional scene automatic adjustment system and method. When applied to the field of game technology, the present invention can also be a game scene processing device and method. When applied to the field of digital twin technology, the present invention can also be a digital twin system, or a digital twin scene adaptive adjustment system and method.
本发明希望通过三维模型的替换方式的改进,使得在替换前和替换后的三维模型与周围场景之间的间距能够自适应调整,以减少人工处理的工作量。The present invention hopes to improve the replacement method of the three-dimensional model so that the distance between the three-dimensional model and the surrounding scene before and after the replacement can be adaptively adjusted to reduce the workload of manual processing.
实施例1Example 1
当前市场上的三维模型处理系统,当需要对三维模型进行替换时,普遍需要通过手动来对替换模型200进行调整,例如调整替换模型200的缩放比例、大小、间距等等。大量的手动操作明显增加了处理三维图形的工作人员的工作量,并且降低了其工作效率。In the current 3D model processing systems on the market, when a 3D model needs to be replaced, it is generally necessary to manually adjust the replacement model 200, such as adjusting the scale, size, spacing, etc. of the replacement model 200. A large number of manual operations significantly increase the workload of the staff who process the 3D graphics and reduce their work efficiency.
例如,现有的三维模型的替换步骤包括:For example, the steps for replacing an existing 3D model include:
S101:手动选择原始模型100的节点并删除。在此过程中,需要选择原始模型100的顶点、线条等特征。在选择过程中,原始模型100的数据量大,可能部分顶点、线条被遗漏,导致原始模型100的部分结构未被删除完全。S101: Manually select and delete nodes of the original model 100. In this process, it is necessary to select features such as vertices and lines of the original model 100. In the selection process, the data volume of the original model 100 is large, and some vertices and lines may be omitted, resulting in partial structures of the original model 100 not being completely deleted.
S102:将替换模型200导入原始模型100的位置。S102: Importing the replacement model 200 into the position of the original model 100.
S103:根据原始模型100的位置,手动调整替换模型200的位置、大小以及缩放比例。在调整替换模型200的过程中,还需人工过滤目录树中所需要的模型节点。由于在同一区域内的替换模型200在目录树中的结构不集中,需要手动多选或者使用工具筛选需要的结构。大部分三维模型处理系统无法支持替换模型200的结构的筛选,导致替换模型200的调整效率较低。S103: Manually adjust the position, size and scaling of the replacement model 200 according to the position of the original model 100. In the process of adjusting the replacement model 200, it is also necessary to manually filter the required model nodes in the directory tree. Since the replacement models 200 in the same area are not structured in the directory tree, it is necessary to manually select multiple structures or use tools to filter the required structures. Most three-dimensional model processing systems cannot support the screening of the structure of the replacement model 200, resulting in low adjustment efficiency of the replacement model 200.
不仅如此,上述三维模型处理系统仅允许原始模型100与替换模型200的一对一替换,无法实现组合模型的替换。例如,将含有若干家具的客厅模型一次性替换为含有若干餐具的厨房模型,现有的三维模型处理系统是无法做到的。Moreover, the above three-dimensional model processing system only allows one-to-one replacement of the original model 100 and the replacement model 200, and cannot realize the replacement of combined models. For example, the existing three-dimensional model processing system cannot replace a living room model containing several furniture with a kitchen model containing several tablewares at one time.
针对现有技术之不足,本发明从第一方面提供了一种三维模型的图形处理方法,如图2所示,方法包括:In view of the shortcomings of the prior art, the present invention provides a three-dimensional model graphics processing method from a first aspect, as shown in FIG2 , the method comprises:
S210:初始化三维场景400内的三维空间。S210: Initialize the three-dimensional space in the three-dimensional scene 400.
将三维场景400内的三维空间初始化,能够消除原始模型100的修改数据,减少数据处理量。Initializing the three-dimensional space within the three-dimensional scene 400 can eliminate the modified data of the original model 100 and reduce the amount of data processing.
S220:将三维空间基于替换要素进行区域划分。S220: Divide the three-dimensional space into regions based on the replacement elements.
具体地,替换要素包括:中心位置、相互间距、绝对间距及其彼此之间的组合。原始模型100与周边的原始模型100之间存在相互间距或者不可变化的绝对间距。Specifically, the replacement elements include: center position, mutual spacing, absolute spacing and combinations thereof. There is a mutual spacing or an unchangeable absolute spacing between the original model 100 and the surrounding original models 100 .
在三维场景400中,部分原始模型100是能够全部替换的。部分原始模型100中含有不可替换的子模型。部分原始模型100与其周围的原始模型100的布置存在一定的分布规律或者绝对间距。因此,不同类别的原始模型100,其替换模型200调整的方式是不同的。若三维场景400的三维空间不被划分,那么各类原始模型100就会混淆在一起。在进行三维模型替换的过程中,替换模型200的调整就容易出错。In the three-dimensional scene 400, some original models 100 can be completely replaced. Some original models 100 contain irreplaceable sub-models. There is a certain distribution pattern or absolute spacing between some original models 100 and the original models 100 around them. Therefore, the adjustment methods of the replacement models 200 of different categories of original models 100 are different. If the three-dimensional space of the three-dimensional scene 400 is not divided, then the various types of original models 100 will be mixed together. In the process of replacing the three-dimensional model, the adjustment of the replacement model 200 is prone to errors.
针对此缺陷,本发明根据设置的替换要素来对三维场景400进行区域划分,能够预先确定无法变更的参数,使得对应区域内的原始模型100被替换时,与其对应的替换模型200能够基于原始模型100的不可变化的因素和自身的结构特征来快速计算和调整,减少后期调整的计算量,也减少替换模型200被反复调整的次数。To address this defect, the present invention divides the three-dimensional scene 400 into areas according to the set replacement elements, and can predetermine the parameters that cannot be changed. Therefore, when the original model 100 in the corresponding area is replaced, the corresponding replacement model 200 can be quickly calculated and adjusted based on the unchangeable factors of the original model 100 and its own structural characteristics, thereby reducing the amount of calculation for subsequent adjustments and reducing the number of times the replacement model 200 is repeatedly adjusted.
优选地,本发明能够基于线条、颜色、阴影、标识、图案、文字信息及其组合等若干种类型来表示不同的三维空间区域。这样,当该区域内的原始模型100被选定时,工作人员无需再依次手动输入原始模型100的替换调整方式,仅需要按照该区域的类型来调整替换模型200即可。Preferably, the present invention can represent different three-dimensional space areas based on lines, colors, shadows, logos, patterns, text information and combinations thereof. Thus, when the original model 100 in the area is selected, the staff does not need to manually input the replacement adjustment method of the original model 100 one by one, but only needs to adjust the replacement model 200 according to the type of the area.
S230:根据替换要素来将替换模型200调整为校准模型300,并且使用校准模型300替换原始模型100。S230 : adjusting the replacement model 200 to the calibration model 300 according to the replacement elements, and replacing the original model 100 with the calibration model 300 .
具体地,选中原始模型100的步骤包括:设置原始模型100的所有顶点和线条的一个平面投影。沿该平面投影的法向设置平面投影的延伸长度。在延伸长度确定后,基于平面投影和延伸长度形成的立体空间为被选择的替换空间,位于替换空间内的、完整的可替换的三维模型为原始模型100。优选地,部分不可替换的三维模型可以全部或者部分位于替换空间内。或者,部分不可替换的三维模型位于替换空间之外。优选地,在原始模型100与三维场景400内或者在可视范围外的其他原始模型100存在不可变更的绝对间距的情况下,替换模型200在调整时也需要依据该绝对间距来调整。Specifically, the step of selecting the original model 100 includes: setting a plane projection of all vertices and lines of the original model 100. Setting the extension length of the plane projection along the normal of the plane projection. After the extension length is determined, the three-dimensional space formed based on the plane projection and the extension length is the selected replacement space, and the complete replaceable three-dimensional model located in the replacement space is the original model 100. Preferably, some irreplaceable three-dimensional models can be located in the replacement space in whole or in part. Alternatively, some irreplaceable three-dimensional models are located outside the replacement space. Preferably, in the case where there is an unchangeable absolute spacing between the original model 100 and other original models 100 in the three-dimensional scene 400 or outside the visible range, the replacement model 200 also needs to be adjusted according to the absolute spacing when adjusting.
优选地,在选择替换模型200时,可以根据用于替换的替换列表来选择。替换列表用于手动确定替换模型200和原始模型100的对应关系。响应于替换指令,处理器505进行替换。Preferably, when selecting the replacement model 200, the replacement model 200 may be selected according to a replacement list for replacement. The replacement list is used to manually determine the correspondence between the replacement model 200 and the original model 100. In response to the replacement instruction, the processor 505 performs the replacement.
针对不同的替换要素,替换模型200的调整方式和计算步骤也是不同的。本发明通过将三维场景400内的原始模型100进行区域划分,能够预先确定该区域内的原始模型100的替换要素。当替换模型200被选定时,能够根据替换要素自动调整替换模型200,减少手动输入替换要素的步骤,实现替换模型200的自动化校准。本发明的优势在于,不需要使用第三方系统,减少了手动调整的步骤,校准后的替换模型200能够直接替换原始模型100,能够直接融入三维场景400中。For different replacement elements, the adjustment method and calculation steps of the replacement model 200 are also different. The present invention can predetermine the replacement elements of the original model 100 in the area by dividing the original model 100 in the three-dimensional scene 400 into regions. When the replacement model 200 is selected, the replacement model 200 can be automatically adjusted according to the replacement elements, reducing the steps of manually inputting the replacement elements and realizing automatic calibration of the replacement model 200. The advantage of the present invention is that there is no need to use a third-party system, reducing the steps of manual adjustment, and the calibrated replacement model 200 can directly replace the original model 100 and can be directly integrated into the three-dimensional scene 400.
优选地,将替换模型200调整为校准模型300的方式包括:基于原始模型100的中心位置和取向特征来将替换模型200调整为校准模型300。基于三维空间内的原始模型100的相对几何位置关系来将替换模型200调整为校准模型300。这两种方式可以分别用于调整替换模型200,也可以同时用于调整同一替换模型200。Preferably, the manner of adjusting the replacement model 200 to the calibration model 300 includes: adjusting the replacement model 200 to the calibration model 300 based on the center position and orientation features of the original model 100. Adjusting the replacement model 200 to the calibration model 300 based on the relative geometric position relationship of the original model 100 in three-dimensional space. These two manners can be used to adjust the replacement model 200 separately, or can be used to adjust the same replacement model 200 at the same time.
具体地,基于原始模型100的中心位置和取向特征来确定被选定的替换模型200的中心位置和取向特征。基于原始模型100与替换模型200的比例关系来调整替换模型,使得替换模型200调整为校准模型300。通过比例关系调整替换模型200,使得替换模型与原始模型100的大小一致,同时替换模型200的几何中心与原始模型100一致,避免替换模型200出现分布均匀,三维形状偏移等情况。Specifically, the center position and orientation features of the selected replacement model 200 are determined based on the center position and orientation features of the original model 100. The replacement model is adjusted based on the proportional relationship between the original model 100 and the replacement model 200, so that the replacement model 200 is adjusted to the calibration model 300. The replacement model 200 is adjusted by the proportional relationship so that the size of the replacement model is consistent with that of the original model 100, and the geometric center of the replacement model 200 is consistent with that of the original model 100, so as to avoid the replacement model 200 from being evenly distributed, shifted in three-dimensional shape, etc.
例如:图1和图4示出了其中一种根据中心位置和取向特征实施的替换过程。For example, FIG. 1 and FIG. 4 illustrate one replacement process implemented based on the center position and orientation features.
S301:如图1所示,选择要替换的原始模型100,一般对模型进行选择有以下几种方式:第一,从三维场景400树节点中获取:通过选择节点确定需要被替换的原始模型100。第二,直接在三维场景400中选择:可以通过选择三维空间中的模型来确定被替换的原始模型100。S301: As shown in FIG1 , the original model 100 to be replaced is selected. Generally, there are several ways to select the model: First, obtain from the tree node of the three-dimensional scene 400: determine the original model 100 to be replaced by selecting the node. Second, select directly in the three-dimensional scene 400: the original model 100 to be replaced can be determined by selecting a model in the three-dimensional space.
S302:如图1所示,以当前三维场景400内选择的所有模型即全部原始模型100为对象进行联合计算,形成一个原始模型100包围盒整体,识别出此包围盒的长宽高三个方向的尺寸。长宽高分别记为x1、y1、z1。S302: As shown in FIG1 , all the models selected in the current 3D scene 400, that is, all the original models 100, are jointly calculated to form a bounding box of the original model 100, and the dimensions of the length, width and height of the bounding box are identified. The length, width and height are recorded as x 1 , y 1 , and z 1 respectively.
S303:如图1所示,选择数据库中的或本地的模型文件,作为替换模型200,并执行替换操作。计算替换模型200的包围盒长宽高三个方向的尺寸。替换模型200的包围盒长宽高分别记为x2、y2、z2。S303: As shown in FIG1 , select a model file in the database or locally as the replacement model 200 and perform a replacement operation. Calculate the dimensions of the length, width and height of the bounding box of the replacement model 200. The length, width and height of the bounding box of the replacement model 200 are recorded as x 2 , y 2 , and z 2 , respectively.
S304:以对应x、y、z方向为参考,默认将替换模型200按照与原始模型100相同方向进行布置。以三个方向差值的绝对值中最大的绝对值为参考,然后取得比值,如差值最大为丨x1-x2丨,比值则为x1/x2。替换模型200的尺寸自动调整,将替换模型200按比例缩放调整为校准模型300,调整系数即为比值。最终比值都相继乘以调整系数,得到校准模型300的尺寸x3、y3、z3,如图1所示。S304: With the corresponding x, y, and z directions as references, the replacement model 200 is arranged in the same direction as the original model 100 by default. The largest absolute value of the absolute values of the differences in the three directions is used as a reference, and then the ratio is obtained. For example, if the maximum difference is 丨x 1 -x 2丨, the ratio is x 1 /x 2 . The size of the replacement model 200 is automatically adjusted, and the replacement model 200 is scaled to the calibration model 300, and the adjustment coefficient is the ratio. The final ratios are successively multiplied by the adjustment coefficients to obtain the dimensions x 3 , y 3 , and z 3 of the calibration model 300, as shown in FIG1 .
S305:若校准模型300依然存在偏差,可对校准模型300进行手动微调,调整校准模型300的大小或者位置。S305: If the calibration model 300 still has deviations, the calibration model 300 may be manually fine-tuned to adjust the size or position of the calibration model 300.
通过中心位置和取向特征调整替换模型200的优势在于,能够避免替换模型200偏移,也能够减少替换模型200的取向的手动操作步骤。通过相对几何位置关系调整替换模型200的优势在于,能够使得替换模型200与周围原始模型100的间距与原三维场景400一致或者等比例变化,避免替换模型200与周围原始模型100的间距不恰当且反复调整的情况发生。The advantage of adjusting the replacement model 200 by the center position and orientation features is that the displacement of the replacement model 200 can be avoided and the manual operation steps of the orientation of the replacement model 200 can be reduced. The advantage of adjusting the replacement model 200 by the relative geometric position relationship is that the distance between the replacement model 200 and the surrounding original models 100 can be made consistent with the original three-dimensional scene 400 or proportionally changed, avoiding the situation where the distance between the replacement model 200 and the surrounding original models 100 is inappropriate and repeatedly adjusted.
优选地,在分析确定替换模型200和原始模型100的中心位置和取向时,可以通过确定替换模型200和原始模型100的包围盒的中心位置和取向来代之。相比于各个模型,由于包围盒是更为规则的几何体,其中心位置坐标和取向向量计算所需运算量更小,可以实现一次性快速粘贴替换明显更为大量的三维模型。Preferably, when analyzing and determining the center position and orientation of the replacement model 200 and the original model 100, the center position and orientation of the bounding box of the replacement model 200 and the original model 100 can be determined to replace them. Compared with each model, since the bounding box is a more regular geometric body, the amount of calculation required for calculating the center position coordinates and orientation vector is smaller, and a significantly larger number of three-dimensional models can be quickly pasted and replaced at one time.
优选地,如图4所示,本发明还能够根据三维场景400内的原始模型100之间的相对几何位置关系来调整替换模型200。Preferably, as shown in FIG. 4 , the present invention can also adjust the replacement model 200 according to the relative geometric position relationship between the original models 100 in the three-dimensional scene 400 .
S231:计算原始模型100之间的第一相互间距比例。S231 : Calculate a first mutual distance ratio between the original models 100 .
S232:基于第一相互间距比例来调整替换模型200之间的第二相互间距比例,形成校准模型300。在将校准模型300替换原始模型100的过程中,计算替换模型200之间的第二相互间距比例。按照第一相互间距比例调整第二相互间距比例。S232: adjusting the second mutual spacing ratio between the replacement models 200 based on the first mutual spacing ratio to form the calibration model 300. In the process of replacing the original model 100 with the calibration model 300, the second mutual spacing ratio between the replacement models 200 is calculated. The second mutual spacing ratio is adjusted according to the first mutual spacing ratio.
例如,三个原始模型100之间的第一间距比例为1:2。三个替换模型200之间的第二间距比例为2:3。那么将第二间距比例按照第一间距比例调整为1:2。再例如,在同一三维空间内同比缩小或同比放大第二相互间距,以满足替换模型200所带来的尺寸差异。For example, the first spacing ratio between the three original models 100 is 1:2. The second spacing ratio between the three replacement models 200 is 2:3. Then the second spacing ratio is adjusted to 1:2 according to the first spacing ratio. For another example, the second mutual spacing is reduced or enlarged year by year in the same three-dimensional space to meet the size difference brought by the replacement models 200.
由于同比缩放的所需计算量是以三维空间内的全部替换模型200为对象进行联合计算的,其并非需要对各个顶点和线条进行单独分析(其中可能包含遍历大量节点的计算而蕴含了大量内存消耗),因此本发明的这种替换方式不需要遍历各个节点,能够满足一次性替换较多数量的三维模型。同比缩放所带来的替换方式需要后期手动调整的工作量也非常少。Since the amount of calculation required for the same-year scaling is calculated jointly with all the replacement models 200 in the three-dimensional space, it does not need to analyze each vertex and line separately (which may include the calculation of traversing a large number of nodes and contain a large amount of memory consumption), so the replacement method of the present invention does not need to traverse each node, and can meet the needs of replacing a large number of three-dimensional models at one time. The replacement method brought by the same-year scaling also requires very little work for later manual adjustment.
S233:基于第二相互间距比例来确定校准模型300的位置。校准模型300的取向特征与原始模型100的取向特征一致。S233 : Determine the position of the calibration model 300 based on the second mutual spacing ratio. The orientation feature of the calibration model 300 is consistent with the orientation feature of the original model 100 .
在较多的情况下,替换模型200与周围原始模型100之间的间距与原三维场景400内的不一致,这样导致的缺陷包括:替换模型200与周围的原始模型100产生碰撞或者不和谐;替换模型200内的若干子三维模型彼此之间的间距不协调。本发明通过预先设置的相互间距来调整替换模型200,使得调整后的校准模型300能够直接与周围的原始模型100协调设置,或者使得校准模型300内的若干子三维模型内部的间距能够等比例变化,避免部分替换模型200挤在一起。In most cases, the spacing between the replacement model 200 and the surrounding original models 100 is inconsistent with that in the original three-dimensional scene 400, which causes defects including: the replacement model 200 collides or is not harmonious with the surrounding original models 100; the spacing between several sub-three-dimensional models in the replacement model 200 is not coordinated. The present invention adjusts the replacement model 200 by pre-setting the mutual spacing, so that the adjusted calibration model 300 can be directly coordinated with the surrounding original models 100, or the spacing within several sub-three-dimensional models in the calibration model 300 can be changed in proportion, so as to avoid some replacement models 200 from being crowded together.
优选地,在设置替换空间之后,还存在贯穿或部分嵌入替换空间中且也应当予以替换的三维模型部段,简称为替换性三维模型部段。Preferably, after the replacement space is set, there is a three-dimensional model segment that runs through or is partially embedded in the replacement space and should also be replaced, which is referred to as a replacement three-dimensional model segment for short.
当选中替换空间内的原始模型100时,在替换性三维模型部段存在的情况下,将替换性三维模型部段与替换空间的包络线相交的点或线确定为替换性三维模型部段的顶点和/或最外侧线条。此时,替换空间内的完整的原始模型100为第一原始模型100。替换性三维模型部段为第二原始模型100。When the original model 100 in the replacement space is selected, if the replacement 3D model segment exists, the point or line where the replacement 3D model segment intersects with the envelope of the replacement space is determined as the vertex and/or the outermost line of the replacement 3D model segment. At this time, the complete original model 100 in the replacement space is the first original model 100. The replacement 3D model segment is the second original model 100.
优选地,在设置替换空间之后,还存在贯穿或部分嵌入替换空间中且不应当予以替换(即应当予以保留)的三维模型部段,简称为固定三维模型。固定三维模型的至少一个顶点或者线条位于替换空间之外。Preferably, after setting the replacement space, there is still a 3D model segment that runs through or is partially embedded in the replacement space and should not be replaced (ie should be retained), referred to as a fixed 3D model. At least one vertex or line of the fixed 3D model is located outside the replacement space.
在进行替换时,固定三维模型的中心位置和取向是不加以分析确定的,或者分析确定的结果是不予以保留的。固定三维模型不存在与之对应并用以取代的替换模型200。When replacing, the center position and orientation of the fixed three-dimensional model are not analyzed and determined, or the results of the analysis and determination are not retained. There is no replacement model 200 corresponding to the fixed three-dimensional model and used to replace it.
在固定三维模型与原始模型100因法规或客观条件而存在固定的间距要求的情况下,固定三维模型与原始模型100之间的相互间距为绝对间距。In the case where there is a fixed distance requirement between the fixed three-dimensional model and the original model 100 due to regulations or objective conditions, the distance between the fixed three-dimensional model and the original model 100 is an absolute distance.
优选地,如图4所示,本发明的方法还包括:Preferably, as shown in FIG4 , the method of the present invention further comprises:
S241:计算位于三维场景400外或替换空间外的固定三维模型与原始模型100之间的绝对间距。此处,三维场景400外是指可视场景范围之外。S241: Calculate the absolute distance between the fixed 3D model outside the 3D scene 400 or outside the replacement space and the original model 100. Here, outside the 3D scene 400 refers to outside the visible scene range.
S242:基于绝对间距、原始模型100之间的第一相互间距比例来将替换模型200调整为校准模型300,并且确定校准模型300的位置。优选地,在进行第二相互间距的调整时,替换模型200与固定三维模型之间的绝对间距的计算需要保留。S242: Adjust the replacement model 200 to the calibration model 300 based on the absolute distance and the first mutual distance ratio between the original models 100, and determine the position of the calibration model 300. Preferably, when adjusting the second mutual distance, the calculation of the absolute distance between the replacement model 200 and the fixed 3D model needs to be retained.
基于三维场景400内的情况不同,原始模型100需要与指定的固定三维模型维持绝对间距,因此替换模型200也需要与固定三维模型维持绝对间距,这样才能够在替换后避免手动调节间距,使得校准模型300能够一次性调节至恰当的尺寸和缩放比例,减少手动操作的次数。这样替换后的三维模型也能够符合法规或客观条件。Based on the different situations in the three-dimensional scene 400, the original model 100 needs to maintain an absolute distance from the specified fixed three-dimensional model, so the replacement model 200 also needs to maintain an absolute distance from the fixed three-dimensional model, so that manual adjustment of the distance can be avoided after replacement, so that the calibration model 300 can be adjusted to the appropriate size and scaling at one time, reducing the number of manual operations. In this way, the replaced three-dimensional model can also meet regulations or objective conditions.
优选地,本发明的方法还包括:在两个原始模型100之间的绝对间距需要以不变的方式设置的情况下,以保留绝对间距的方式调整至少两个替换模型200之间和/或替换模型200与固定模型之间的相互间距。这样设置,能够在校准模型300在放入三维场景400后也自动保持绝对间距,减少替换模型200与原始模型100在布置时的差异性。Preferably, the method of the present invention further comprises: when the absolute spacing between the two original models 100 needs to be set in an unchanged manner, adjusting the mutual spacing between at least two replacement models 200 and/or between the replacement model 200 and the fixed model in a manner of retaining the absolute spacing. In this way, the calibration model 300 can automatically maintain the absolute spacing after being placed in the three-dimensional scene 400, thereby reducing the difference between the replacement model 200 and the original model 100 in arrangement.
优选地,在替换模型200为组合模型,即替换模型200内包括若干子模型的情况下,首先根据被选定的原始模型100来计算中心位置、取向特征、其与周边的原始模型100的第一相互间距和绝对间距。Preferably, when the replacement model 200 is a combined model, that is, the replacement model 200 includes several sub-models, the center position, orientation characteristics, first mutual distance and absolute distance between the selected original model 100 and the surrounding original models 100 are calculated first.
其次,根据人工选择的替换模型200来确定替换模型200的整体的中心位置和取向特征。采集替换模型200内的若干子三维模型之间的第二相互间距比例。在根据第一相互间距比例调整替换模型200的过程中,第二相互间距比例同比放大或者缩小,以实现替换模型200内的若干子三维模型之间的相互间距大小可变但比例不变的效果。在计算替换模型200的过程中,同时基于绝对间距来计算替换模型200的整体的边缘线条的位置,以使得形成的校准模型300替换原始模型100后也能符合设定的法规或者客观条件。Secondly, the overall center position and orientation characteristics of the replacement model 200 are determined based on the manually selected replacement model 200. The second mutual spacing ratio between the plurality of sub-three-dimensional models in the replacement model 200 is collected. In the process of adjusting the replacement model 200 according to the first mutual spacing ratio, the second mutual spacing ratio is enlarged or reduced year-on-year to achieve the effect that the mutual spacing between the plurality of sub-three-dimensional models in the replacement model 200 is variable in size but unchanged in ratio. In the process of calculating the replacement model 200, the position of the overall edge line of the replacement model 200 is calculated based on the absolute spacing at the same time, so that the formed calibration model 300 can also meet the set regulations or objective conditions after replacing the original model 100.
本发明通过将例如中心位置、相互间距和绝对间距等替换要素联合计算来调整替换模型200,能够使得调整后形成的校准模型300直接替换原始模型100且不需要反复调整,实现三维模型的高效替换。The present invention adjusts the replacement model 200 by jointly calculating replacement elements such as center position, mutual spacing and absolute spacing, so that the adjusted calibration model 300 can directly replace the original model 100 without repeated adjustment, thereby achieving efficient replacement of the three-dimensional model.
实施例2Example 2
本实施例是对实施例1的进一步改进,重复的内容不再赘述。This embodiment is a further improvement on Embodiment 1, and the repeated contents will not be repeated here.
本发明从第二方面还提供一种三维模型的图形处理系统,包括处理器505。处理器505为能够执行本发明的三维模型的图形处理的编码程序的专用集成芯片、服务器或服务器群组。The present invention further provides a three-dimensional model graphics processing system from a second aspect, comprising a processor 505. The processor 505 is a dedicated integrated chip, server or server group capable of executing the coding program of the three-dimensional model graphics processing of the present invention.
如图3所示,处理器505能够被设置在用于进行三维模型的图形处理系统500中。As shown in FIG. 3 , a processor 505 can be provided in a graphics processing system 500 for performing three-dimensional modeling.
如图3所示,用于三维模型的图形处理系统500包括显示界面501、存储组件504和处理器505。显示界面501与处理器505连接。处理器505与存储组件504连接。显示界面501用于显示三维场景400。如图5所示,显示界面501包括显示组件502和交互组件503。显示组件502例如是液晶显示屏幕。交互组件503例如是鼠标、键盘、可触摸控制的显示屏、触屏笔等等。As shown in FIG3 , a graphics processing system 500 for a three-dimensional model includes a display interface 501, a storage component 504, and a processor 505. The display interface 501 is connected to the processor 505. The processor 505 is connected to the storage component 504. The display interface 501 is used to display the three-dimensional scene 400. As shown in FIG5 , the display interface 501 includes a display component 502 and an interaction component 503. The display component 502 is, for example, a liquid crystal display screen. The interaction component 503 is, for example, a mouse, a keyboard, a touch-controllable display screen, a stylus pen, and the like.
优选地,在处理器505需要从第三方数据库507调取替换模型200的情况下,图形处理系统500还包括通讯组件506。处理器505通过通讯组件506与第三方数据库507连接以传输指令或信息。存储组件504例如是存储芯片、微型处理器、磁盘介质等具有存储功能的硬件。Preferably, when the processor 505 needs to retrieve the replacement model 200 from the third-party database 507, the graphics processing system 500 further includes a communication component 506. The processor 505 is connected to the third-party database 507 via the communication component 506 to transmit instructions or information. The storage component 504 is, for example, hardware with storage function such as a storage chip, a microprocessor, a disk medium, etc.
处理器505被配置为:初始化三维场景400内的三维空间;将三维空间基于替换要素进行区域划分;根据替换要素来将替换模型200调整为校准模型300,并且使用校准模型300替换原始模型100。The processor 505 is configured to: initialize the three-dimensional space within the three-dimensional scene 400 ; divide the three-dimensional space into regions based on the replacement elements; adjust the replacement model 200 to the calibration model 300 according to the replacement elements, and replace the original model 100 with the calibration model 300 .
本发明的图形处理系统的优势在于,能够在将原始模型100替换的过程中,自动计算并调整替换模型200至恰当尺寸、分布的校准模型300,使得校准模型300能够直接替换原始模型100且不需要再次手动操作,减少三维模型的手动操作次数,提高三维模型替换的效率。The advantage of the graphics processing system of the present invention is that it can automatically calculate and adjust the replacement model 200 to a calibration model 300 of appropriate size and distribution during the process of replacing the original model 100, so that the calibration model 300 can directly replace the original model 100 without the need for manual operation again, thereby reducing the number of manual operations on the three-dimensional model and improving the efficiency of three-dimensional model replacement.
根据一个优选实施方式,处理器505还被配置为:基于原始模型100的中心位置和取向特征来将替换模型200调整为校准模型300;和/或基于三维空间内的原始模型100的相对几何位置关系来将替换模型200调整为校准模型300。本发明的系统的优势还包括:通过中心位置和相对几何位置关系来调整替换模型200,能够避免替换模型200整体上的结构偏移,也能够使得替换模型200的取向自动与原始模型100一致,不需要人工手动操作调整。According to a preferred embodiment, the processor 505 is further configured to: adjust the replacement model 200 to the calibration model 300 based on the center position and orientation characteristics of the original model 100; and/or adjust the replacement model 200 to the calibration model 300 based on the relative geometric position relationship of the original model 100 in the three-dimensional space. The advantages of the system of the present invention also include: adjusting the replacement model 200 through the center position and the relative geometric position relationship can avoid the overall structural deviation of the replacement model 200, and can also make the orientation of the replacement model 200 automatically consistent with the original model 100, without the need for manual adjustment.
根据一个优选实施方式,处理器505还被配置为:计算位于三维场景400外的固定三维模型与原始模型100之间的绝对间距,基于绝对间距、原始模型100之间的第一相互间距比例来将替换模型200调整为校准模型300,并且确定校准模型300的位置。这样调整的优势还包括:避免替换模型200与三维场景400内周围其他原始模型100的不合理间距的出现,减少替换模型200被调整的次数。According to a preferred embodiment, the processor 505 is further configured to: calculate the absolute distance between the fixed three-dimensional model located outside the three-dimensional scene 400 and the original model 100, adjust the replacement model 200 to the calibration model 300 based on the absolute distance and the first mutual distance ratio between the original models 100, and determine the position of the calibration model 300. The advantages of such adjustment also include: avoiding the occurrence of unreasonable distances between the replacement model 200 and other surrounding original models 100 in the three-dimensional scene 400, and reducing the number of times the replacement model 200 is adjusted.
以上步骤的具体实施例如实施例1所述,不重复说明。The specific implementation examples of the above steps are as described in Example 1 and will not be repeated here.
需要注意的是,上述具体实施例是示例性的,本领域技术人员可以在本发明公开内容的启发下想出各种解决方案,而这些解决方案也都属于本发明的公开范围并落入本发明的保护范围之内。本领域技术人员应该明白,本发明说明书及其附图均为说明性而并非构成对权利要求的限制。本发明的保护范围由权利要求及其等同物限定。本发明说明书包含多项发明构思,诸如“优选地”“根据一个优选实施方式”或“可选地”均表示相应段落公开了一个独立的构思,申请人保留根据每项发明构思提出分案申请的权利。It should be noted that the above-mentioned specific embodiments are exemplary, and those skilled in the art can come up with various solutions inspired by the disclosure of the present invention, and these solutions also belong to the disclosure scope of the present invention and fall within the protection scope of the present invention. Those skilled in the art should understand that the present invention specification and its drawings are illustrative and do not constitute limitations on the claims. The scope of protection of the present invention is defined by the claims and their equivalents. The present invention specification contains multiple inventive concepts, such as "preferably", "according to a preferred embodiment" or "optionally", all of which indicate that the corresponding paragraph discloses an independent concept, and the applicant reserves the right to file a divisional application based on each inventive concept.
Claims (7)
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311822550.7A CN117853691B (en) | 2023-12-27 | 2023-12-27 | Graphic processing method and system of three-dimensional model |
CN202411461287.8A CN119625233A (en) | 2023-12-27 | 2023-12-27 | A three-dimensional model processor and processing device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311822550.7A CN117853691B (en) | 2023-12-27 | 2023-12-27 | Graphic processing method and system of three-dimensional model |
Related Child Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202411461287.8A Division CN119625233A (en) | 2023-12-27 | 2023-12-27 | A three-dimensional model processor and processing device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN117853691A CN117853691A (en) | 2024-04-09 |
CN117853691B true CN117853691B (en) | 2024-10-29 |
Family
ID=90542913
Family Applications (2)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202411461287.8A Pending CN119625233A (en) | 2023-12-27 | 2023-12-27 | A three-dimensional model processor and processing device |
CN202311822550.7A Active CN117853691B (en) | 2023-12-27 | 2023-12-27 | Graphic processing method and system of three-dimensional model |
Family Applications Before (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202411461287.8A Pending CN119625233A (en) | 2023-12-27 | 2023-12-27 | A three-dimensional model processor and processing device |
Country Status (1)
Country | Link |
---|---|
CN (2) | CN119625233A (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN118470172B (en) * | 2024-06-05 | 2025-03-07 | 山东天昀和信息科技有限公司 | Data processing method and system for rendering live-action three-dimensional model |
CN119784849B (en) * | 2025-03-07 | 2025-05-27 | 哪吒智慧科技(上海)股份有限公司 | Container damage quantification method, system, device and medium based on geometric calibration |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115861549A (en) * | 2023-02-27 | 2023-03-28 | 航天宏图信息技术股份有限公司 | Method and device for automatically replacing tree model in live-action three-dimensional data |
Family Cites Families (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US10789784B2 (en) * | 2018-05-23 | 2020-09-29 | Asustek Computer Inc. | Image display method, electronic device, and non-transitory computer readable recording medium for quickly providing simulated two-dimensional head portrait as reference after plastic operation |
CN110533761B (en) * | 2018-05-23 | 2024-01-12 | 华硕电脑股份有限公司 | Image display method, electronic device and non-transient computer readable recording medium |
CN113538698A (en) * | 2020-04-16 | 2021-10-22 | 同济大学 | Model display device and model display method |
CN116071529A (en) * | 2023-02-08 | 2023-05-05 | 珠海金山数字网络科技有限公司 | Three-dimensional model processing method and device |
CN116091570B (en) * | 2023-04-07 | 2023-07-07 | 腾讯科技(深圳)有限公司 | Three-dimensional model processing method, device, electronic device, and storage medium |
CN116958474A (en) * | 2023-07-14 | 2023-10-27 | 中水北方勘测设计研究有限责任公司 | Method, system and terminal for three-dimensional modeling and model local splicing optimization of drainage pipe network |
-
2023
- 2023-12-27 CN CN202411461287.8A patent/CN119625233A/en active Pending
- 2023-12-27 CN CN202311822550.7A patent/CN117853691B/en active Active
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115861549A (en) * | 2023-02-27 | 2023-03-28 | 航天宏图信息技术股份有限公司 | Method and device for automatically replacing tree model in live-action three-dimensional data |
Also Published As
Publication number | Publication date |
---|---|
CN117853691A (en) | 2024-04-09 |
CN119625233A (en) | 2025-03-14 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN117853691B (en) | Graphic processing method and system of three-dimensional model | |
EP2833326B1 (en) | Lossless compression of a 3D mesh including transforming of the mesh to a image | |
US10204446B2 (en) | Adaptively zippering meshes | |
JP6721332B2 (en) | Generating a bounding box on a 3D modeled assembly | |
US10108750B2 (en) | Method for designing a geometrical three-dimensional modeled object | |
US6806874B2 (en) | Method and apparatus for providing sharp features on multiresolution subdivision surfaces | |
CN110675508B (en) | A method for simplification of BIM model geometry | |
CN109472870B (en) | A Model Matching Method Based on Mesh Reconstruction and Multi-influence Domain Modification | |
JP2013507679A (en) | Method and system capable of 3D printing of 3D object model | |
JP6721333B2 (en) | Selecting a perspective for a set of objects | |
CN115937434A (en) | Three-dimensional model cutting device based on texture | |
WO2023144676A1 (en) | Computer-implemented method for the simplification of a mesh of a three-dimensional graphical object | |
JP2022113122A (en) | Varying Density Support Structures for 3D Printed Objects | |
US10636210B2 (en) | Dynamic contour volume deformation | |
CN113781642A (en) | Three-dimensional model multi-level LOD generation method based on face reduction algorithm | |
CN119579751B (en) | A model display control method, device and medium based on digital twin system | |
US7733338B2 (en) | Reduction of a mesh with preservation of flow lines | |
CN109509249B (en) | Virtual scene light source intelligent generation method based on components | |
CN113888701A (en) | Method and system for converting curved surface 3D model into mesh 3D model in Obj format | |
CN108038900A (en) | Oblique photograph model monomerization approach, system and computer-readable recording medium | |
JPH0636013A (en) | Topographic data creation method and device | |
CN111583410A (en) | A method for automatic generation of mesh model of clothing pieces | |
CN112530015B (en) | Point cloud data compression storage method and system based on spatial structure characteristics | |
US20070216713A1 (en) | Controlled topology tweaking in solid models | |
US20040164982A1 (en) | Method and apparatus for editing three-dimensional model, and computer readable medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |