CN102034268A - Method for constructing and storing three-dimensional virtual plant based on dynamic substructure - Google Patents

Method for constructing and storing three-dimensional virtual plant based on dynamic substructure Download PDF

Info

Publication number
CN102034268A
CN102034268A CN 201010603180 CN201010603180A CN102034268A CN 102034268 A CN102034268 A CN 102034268A CN 201010603180 CN201010603180 CN 201010603180 CN 201010603180 A CN201010603180 A CN 201010603180A CN 102034268 A CN102034268 A CN 102034268A
Authority
CN
China
Prior art keywords
substructure
plant
minor structure
dynamic
information
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.)
Granted
Application number
CN 201010603180
Other languages
Chinese (zh)
Other versions
CN102034268B (en
Inventor
康孟珍
华净
胡包钢
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Institute of Automation of Chinese Academy of Science
Original Assignee
Institute of Automation of Chinese Academy of Science
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Institute of Automation of Chinese Academy of Science filed Critical Institute of Automation of Chinese Academy of Science
Priority to CN2010106031804A priority Critical patent/CN102034268B/en
Publication of CN102034268A publication Critical patent/CN102034268A/en
Application granted granted Critical
Publication of CN102034268B publication Critical patent/CN102034268B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

本发明提出一种基于动态子结构的三维虚拟植物构建和存储方法,包括子结构参数初始化,根据动态子结构方法进行植物结构的构建,以子结构方法的数据保存,利用子结构信息进行对植物结构的交互式编辑。本发明的特征在于,对植物结构中相似的子结构定义一个子结构库,通过对其中的信息重复调用节省时间和空间。子结构库中的样本能根据需要动态产生,避免产生的子结构未被调用。能通过对重复调用的子结构只保存一个备份达到虚拟植物数据的压缩存储。能根据子结构的调用信息对构建后的植物和植物子结构进行交互式的编辑。

Figure 201010603180

The present invention proposes a three-dimensional virtual plant construction and storage method based on dynamic substructure, including substructure parameter initialization, constructing plant structure according to the dynamic substructure method, saving data of the substructure method, and using substructure information to carry out plant structure Interactive editing of structures. The present invention is characterized in that a substructure library is defined for similar substructures in the plant structure, and time and space are saved by repeatedly calling the information therein. The samples in the substructure library can be dynamically generated according to the needs, so as to avoid that the generated substructures are not called. Compressed storage of virtual plant data can be achieved by keeping only one copy of repeatedly called substructures. According to the call information of the substructure, the constructed plants and plant substructures can be interactively edited.

Figure 201010603180

Description

一种基于动态子结构的三维虚拟植物构建和存储方法 A 3D virtual plant construction and storage method based on dynamic substructure

技术领域technical field

本发明属于虚拟现实、数字农林业、数字娱乐、景观设计等技术领域,特别是涉及虚拟植物结构的造型方法与动态展示。The invention belongs to the technical fields of virtual reality, digital agriculture and forestry, digital entertainment, landscape design, etc., and in particular relates to a modeling method and dynamic display of virtual plant structures.

背景技术Background technique

随着三维显示技术的发展,对数字环境下显示内容的需求迅速增加。植物作为自然界重要的组成部分,对其造型与动画是数字场景构建必不可少的部分。构造实现虚拟植物三维结构的主要方法大致上可以分为两类。一类是手工交互方式,即通过应用专业设计软件定义虚拟植物的结构。简单的植物结构或者植物器官可以通过交互的方式进行手工建模,但对于复杂的植物结构,其中可能包含成百上千万个器官,完全用手工建模的方式是不可行的。另一类建模方式是基于算法的模拟,自动生成植物结构。常见的模拟算法有字符串替换系统、粒子系统、自动机等。With the development of three-dimensional display technology, the demand for display content in the digital environment is rapidly increasing. As an important part of nature, plants are an essential part of digital scene construction for their modeling and animation. The main methods of constructing and realizing the three-dimensional structure of virtual plants can be roughly divided into two categories. One is the manual interaction method, that is, the structure of virtual plants is defined by applying professional design software. Simple plant structures or plant organs can be modeled manually in an interactive manner, but for complex plant structures, which may contain millions of organs, it is not feasible to model them entirely by hand. Another type of modeling is algorithm-based simulation, which automatically generates plant structures. Common simulation algorithms include string replacement systems, particle systems, automata, etc.

在利用算法模拟植物结构时,共同的特点是要定义生长规则,描述不同顶芽或侧芽产生的分枝类别甚至包含的器官类别和个数。直观的模拟方法是在每次迭代中对所有植物结构以一定顺序进行遍历,逐个更新分枝的状态。如果所模拟的植物数量大,而且植物结构复杂,那么植物结构的遍历非常耗费计算时间,难以进行结果的调试和实际应用。When using algorithms to simulate plant structures, the common feature is to define growth rules, describe the types of branches produced by different terminal buds or lateral buds, and even the types and numbers of organs included. The intuitive simulation method is to traverse all plant structures in a certain order in each iteration, and update the state of branches one by one. If the number of simulated plants is large and the plant structure is complex, the traversal of the plant structure will consume a lot of computing time, making it difficult to debug and apply the results.

事实上,复杂的植物结构中通常会包含大量相似分枝,在成熟的树中更为常见。根据对植物的观察,可以将整株地植物分枝划分为有限的几类。植物植物学家认为可以将分枝类型按生理年龄进行划分。植物分枝的相似特征能用于植物结构的快速构建。每类分枝可称为一种子结构,每个子结构可分解为一个生长轴和下一层的子结构,直到不再包含下一层子结构。对单株植物来说,顶层的子结构是植物本身。子结构构建方法是,对每类子结构,定义一个子结构库;植物结构的构建过程从最简单的子结构起,通过子结构的调用和几何变换,逐层自上而下地进行。此算法中,计算时间与子结构库的大小成正比,而不是和植物结构中的器官个数成正比,这对于复杂的植物结构具有明显优势。通过试验证明,对于复杂植物结构,该算法的效率高于植物结构的遍历算法。然而,以往此类方法中子结构库是按从简单到复杂、自顶向下的顺序一次性构建,不仅不直观,而且存在部分子结构未被调用而浪费资源的情况,对于简单的植物结构,模拟时间反而高于遍历算法。In fact, complex plant structures often contain a large number of similar branches, more often in mature trees. According to the observation of the plants, the branches of the whole ground plants can be divided into a limited number of categories. Plant botanists believe that branching types can be classified by physiological age. Similar characteristics of plant branches can be used for rapid construction of plant structures. Each type of branch can be called a substructure, and each substructure can be decomposed into a growth axis and the substructure of the next layer until the substructure of the next layer is no longer included. For a single plant, the top substructure is the plant itself. The substructure construction method is to define a substructure library for each type of substructure; the plant structure construction process starts from the simplest substructure, and proceeds layer by layer from top to bottom through substructure calling and geometric transformation. In this algorithm, the calculation time is proportional to the size of the substructure library, rather than proportional to the number of organs in the plant structure, which has obvious advantages for complex plant structures. It is proved by experiments that for complex plant structures, the efficiency of this algorithm is higher than that of the traversal algorithm of plant structures. However, in the past such methods, the substructure library was constructed at one time from simple to complex, top-down order, which is not only unintuitive, but also wastes resources because some substructures are not called. For simple plant structures , the simulation time is higher than that of the traversal algorithm.

目前国际上有几款专门用于构建虚拟植物结构的商业软件,例如xfrog,Onxy tree,Speed tree,AMAP等,大多提供用于桌面设计的主流软件的插件。国内尚无此类的专业软件。本发明可以用于此类软件的算法设计。At present, there are several commercial software dedicated to building virtual plant structures in the world, such as xfrog, Onxy tree, Speed tree, AMAP, etc., most of which provide plug-ins for mainstream software for desktop design. There is no such professional software in China. The present invention can be used in the algorithm design of such software.

发明内容Contents of the invention

本发明欲解决的技术问题是如何高效灵活地利用植物分枝的相似性,同时保留植物结构遍历算法的优势,进行虚拟植物的构建、保存、调用、交互式编辑以及压缩存储。为此,提出一种基于动态子结构的三维虚拟植物构建和存储方法。The technical problem to be solved by the present invention is how to efficiently and flexibly utilize the similarity of plant branches while retaining the advantages of the plant structure traversal algorithm to construct, save, call, interactive edit and compress storage of virtual plants. To this end, a method of constructing and storing 3D virtual plants based on dynamic substructure is proposed.

为实现本发明的目的,本发明基于动态子结构的三维虚拟植物构建和存储方法的步骤如下:In order to realize the object of the present invention, the steps of the three-dimensional virtual plant construction and storage method based on the dynamic substructure of the present invention are as follows:

步骤S1:子结构参数初始化,确定虚拟植物中分枝即子结构的类型及逐层调用关系;给定每层子结构的最大个数,即子结构库大小;Step S1: Initialize the substructure parameters, determine the type of branches in the virtual plant, that is, the substructure, and the layer-by-layer calling relationship; specify the maximum number of substructures in each layer, that is, the size of the substructure library;

步骤S2:根据动态子结构方法构建植物结构,首先构建虚拟植物的生长轴,对于虚拟植物生长轴上的任意子结构位置,如果对应的子结构在子结构库中已经存在,则直接从子结构库中调用,进行几何变换后组合到当前子结构;否则,递归地逐层构建子结构,放入对应子结构库中,直到虚拟植物结构构建完毕;Step S2: Construct the plant structure according to the dynamic substructure method. First, construct the growth axis of the virtual plant. For any substructure position on the growth axis of the virtual plant, if the corresponding substructure already exists in the substructure library, directly from the substructure Called in the library, perform geometric transformation and combine into the current substructure; otherwise, recursively build the substructure layer by layer, put it into the corresponding substructure library, until the virtual plant structure is constructed;

步骤S3:以子结构方法的植物数据保存;对于每一类子结构,其中植物数据是在模拟过程中创建的植物生长轴的信息,以及子结构位置上的子结构编号和变换矩阵;Step S3: Save the plant data in the substructure method; for each type of substructure, the plant data is the information of the plant growth axis created in the simulation process, and the substructure number and transformation matrix at the position of the substructure;

步骤S4:利用子结构信息对植物结构进行交互式编辑;子结构之间的调用关系可以从步骤S3获取,也可以从步骤S2获取。Step S4: Use substructure information to interactively edit the plant structure; the calling relationship between substructures can be obtained from step S3 or step S2.

其中,对植物结构中相似的子结构定义一个子结构库,通过对其中的信息重复调用节省时间和空间。Among them, a substructure library is defined for similar substructures in the plant structure, and time and space are saved by repeatedly calling the information in it.

其中,所述子结构库中的样本根据需要能动态产生,能避免产生的子结构未被调用。Wherein, the samples in the substructure library can be dynamically generated according to needs, and the generated substructures can be prevented from being called.

其中,能通过对重复调用的子结构只保存一个备份达到虚拟植物的压缩存储,能根据子结构的调用信息对构建后的植物和植物子结构进行交互式的编辑。Among them, the compressed storage of the virtual plant can be achieved by saving only one backup of the repeatedly called substructure, and the constructed plant and the plant substructure can be interactively edited according to the calling information of the substructure.

本发明的有益效果:对于植物结构中重复出现的子结构,只需模拟有限的子结构样本,通过重用子结构样本的信息而提高模拟效率。注意子结构是个递归的概念。虚拟植物可以分解为主轴和直接长在主轴上的子结构,主轴上的子结构又可划分为生长轴和下一层的子结构。虚拟植物本身是森林场景中的子结构。由于本方法中子结构是在植物结构构建过程中根据需要动态创建,因此不存在子结构未被调用而产生的时间和空间的浪费,对不同复杂度的植物结构都能保证模拟效率高于对植物结构进行完全遍历的算法。用户可以改变子结构大小获得期望的效率和子结构多样性。植物的构建过程是从下而上进行,对动态创建的子结构进行遍历,比较直观。通常保存虚拟植物几何结构的文件所占用的空间随其中器官个数线性增加;对于应用动态子结构算法构建的植物结构,由于子结构的信息被重用,因此仅需要保存子结构的变换和调用信息,从而达到节省空间的目的。在读取这样的文件时,由于需要进行子结构的逐层解开和变化,需要花费一定时间,因此这是一种以时间换空间的方法。由于子结构的调用信息被保存,可以对植物进行交互式操作。The beneficial effects of the present invention: for the substructures that appear repeatedly in the plant structure, only limited substructure samples need to be simulated, and the simulation efficiency is improved by reusing the information of the substructure samples. Note that substructure is a recursive concept. The virtual plant can be decomposed into the main axis and the substructure directly growing on the main axis, and the substructure on the main axis can be divided into the growth axis and the substructure of the next layer. The virtual plants themselves are substructures in the forest scene. Since the substructure in this method is dynamically created according to the needs during the construction of the plant structure, there is no waste of time and space caused by the substructure not being called, and the simulation efficiency can be guaranteed to be higher than that of the plant structure of different complexity. Algorithm for complete traversal of plant structures. Users can vary the substructure size to achieve desired efficiency and substructure diversity. The plant construction process is carried out from the bottom up, and it is more intuitive to traverse the dynamically created substructure. Usually, the space occupied by the file that saves the virtual plant geometry increases linearly with the number of organs; for the plant structure constructed by applying the dynamic substructure algorithm, since the information of the substructure is reused, only the transformation and calling information of the substructure need to be saved , so as to achieve the purpose of saving space. When reading such a file, it takes a certain amount of time to unravel and change the substructure layer by layer, so this is a method of exchanging time for space. Plants can be manipulated interactively since the substructure call information is saved.

附图说明Description of drawings

图1a是基于动态子结构方法的框架图。Figure 1a is a framework diagram of the dynamic substructure-based approach.

图1b是图1a中步骤S2的子流程图。Fig. 1b is a sub-flow chart of step S2 in Fig. 1a.

图2是基于随机子结构的模拟和调用示意图。Fig. 2 is a schematic diagram of simulation and calling based on random substructure.

图3是植物结构中包含的不同类别的子结构示例。Figure 3 is an example of substructures of different categories included in the plant structure.

图4a和图4b是森林场景的子结构方法构建示意图。Figure 4a and Figure 4b are schematic diagrams of the construction of the substructure method of the forest scene.

图5是青园软件中对复杂植物结构的模拟结果。Figure 5 is the simulation result of the complex plant structure in Qingyuan software.

图6是青园软件中对随机植物结构的模拟结果。Figure 6 is the simulation result of random plant structure in Qingyuan software.

具体实施方式Detailed ways

为使本发明的目的、技术方案和优点更加清楚明白,以下结合具体实施例子,并参照附图,对本发明进一步详细说明。这里假定读者熟悉植物结构模拟算法,例如自动机、字符串替换系统等,集中介绍如何在这类算法中应用动态子结构算法。In order to make the object, technical solution and advantages of the present invention clearer, the present invention will be further described in detail below in combination with specific implementation examples and with reference to the accompanying drawings. It is assumed that the reader is familiar with plant structure simulation algorithms, such as automata, string replacement systems, etc., and focuses on how to apply dynamic substructure algorithms in such algorithms.

图1a所示为实现动态子结构方法的各个部分的关系。Figure 1a shows the relationship of the various parts implementing the dynamic substructure approach.

步骤S1对植物结构进行参数的初始化,确定虚拟植物中分枝即子结构的类型及逐层调用关系;给定每层子结构的最大个数,即子结构库大小;要实现预期的虚拟植物结构,首先对植物结构进行分解,确定其中包含的子结构类型以及逐层组合关系;子结构类型的划分可参考植物学家提出的生理年龄。每类子结构采用相同的植物结构模拟参数。Step S1 initializes the parameters of the plant structure, and determines the type of branches or substructures in the virtual plant and the layer-by-layer call relationship; the maximum number of substructures in each layer is given, that is, the size of the substructure library; to achieve the expected virtual plant Structure, first decompose the plant structure, determine the substructure types contained in it and the layer-by-layer combination relationship; the division of substructure types can refer to the physiological age proposed by botanists. Each type of substructure adopts the same plant structure simulation parameters.

步骤S2根据动态子结构方法进行植物结构的构建,具体流程如图1b所示。由于子结构为递归的概念,为描述方便,当前正在构建的子结构称为当前子结构,当前子结构的生长轴上着生的子结构称为下一层子结构。当前子结构相对于下一层的子结构称为上一层子结构。当前子结构的类别用整数p表示,p=0时表示虚拟植物本身。当前子结构中包含的下一层子结构的类别用整数q表示,一般q大于p。子结构p所对应的子结构库的大小为Tp,子结构q所对应的子结构库的大小为Tq,都在步骤S1中定义。模拟过程从植物的主轴开始(p=0)。Step S2 constructs the plant structure according to the dynamic substructure method, and the specific process is shown in Figure 1b. Since the substructure is a recursive concept, for the convenience of description, the substructure currently being constructed is called the current substructure, and the substructure on the growth axis of the current substructure is called the next substructure. The substructure of the current substructure relative to the next layer is called the previous substructure. The category of the current substructure is represented by an integer p, and p=0 represents the virtual plant itself. The category of the next substructure contained in the current substructure is represented by an integer q, and generally q is greater than p. The size of the substructure library corresponding to substructure p is T p , and the size of the substructure library corresponding to substructure q is T q , both of which are defined in step S1. The simulation process starts with the main axis of the plant (p=0).

步骤21:根据植物结构模拟算法构建编号np的当前子结构的生长轴,存入子结构p所对应的子结构库中,np∈[1,Tp];Step 21: Construct the growth axis of the current substructure numbered n p according to the plant structure simulation algorithm, and store it in the substructure library corresponding to the substructure p, n p ∈ [1, T p ];

步骤22:以一定次序遍历编号np的当前子结构的生长轴上的所有产生下一层子结构的位置。根据植物结构模拟算法获得编号np的当前子结构的生长轴上的下一层子结构的类别q、位置和方向。Step 22: In a certain order, traverse all the positions on the growth axis of the current substructure numbered np to generate the next layer of substructures. According to the plant structure simulation algorithm, the category q, position and direction of the next substructure on the growth axis of the current substructure with number n p are obtained.

步骤23:判断遍历是否已经结束,下一层的子结构的信息是否已包含到当前子结构;如果遍历没有结束,还存在空缺的下一层子结构位置,则转步骤24,如果遍历已经结束,则转步骤27。Step 23: Determine whether the traversal has ended, and whether the information of the substructure of the next level has been included in the current substructure; if the traversal has not ended, and there is still a vacant position in the next level of substructure, go to step 24, if the traversal has ended , go to step 27.

步骤24:根据编号np的当前子结构的生长轴上的下一层子结构类别q产生一个1到Tq之间的整数子结构编号mq,mq∈[1,Tq]。Step 24: Generate an integer substructure number m q between 1 and T q according to the next substructure category q on the growth axis of the current substructure with number n p , m q [1, T q ].

步骤25:判断该编号的子结构mq是否已经在之前进行构建,已经存在于对应于类别q的子结构库中。如果存在,则转入步骤21,对编号为mq的下一层子结构,以构建当前子结构np同样的过程进行递归构建;这时编号为mq的子结构成为当前子结构。如果下一层子结构mq已经存在于子结构q所对应的子结构库中,则转步骤26。Step 25: Determine whether the numbered substructure m q has been constructed before and exists in the substructure library corresponding to category q. If it exists, go to step 21, and recursively build the next substructure numbered m q in the same process as the current substructure n p ; at this time, the substructure numbered m q becomes the current substructure. If the substructure m q of the next level already exists in the substructure library corresponding to the substructure q, go to step 26 .

步骤26:根据下一层子结构mq的其位置和方向,进行几何变换后组合到当前生长轴,不再重复构建,结束后转步骤22。Step 26: According to the position and direction of the substructure m q of the next layer, perform geometric transformation and combine it into the current growth axis, do not repeat the construction, and go to step 22 after completion.

步骤27:如果当前生长轴上的子结构都已经构建完毕,则当前子结构的构建结束,转上一层子结构,直至顶层结构。Step 27: If all the substructures on the current growth axis have been constructed, the construction of the current substructure is completed, and the next layer of substructure is transferred to the top-level structure.

图2是基于随机子结构的模拟和调用示意图,表示动态子结构方法进行植物结构的构建的过程。其中,黑色的虚线箭头为子结构的模拟顺序,而绿色的弯箭头的子结构的返回顺序。S1表示要构建的虚拟植物,蓝色轴为其生长轴。各级子结构库的大小均为5。当对其中的椭圆形内的子结构进行构建时,首先判断该子结构在对应于S2的子结构库中是否存在,如果不存在则进入到S2这一层的子结构样本构建:模拟S2子结构库中的子结构样本的生长轴,遍历所有子结构位置,判断某编号的子结构是否存在。如果不存在则进入下一层进行构建。这样一直进行直到最简单的一层子结构S4。之后逐层调用返回。Fig. 2 is a schematic diagram of simulation and calling based on random substructure, showing the process of constructing plant structure by dynamic substructure method. Among them, the black dotted arrow is the simulation order of the substructure, and the green curved arrow is the return order of the substructure. S 1 represents the virtual plant to be constructed, and the blue axis is its growth axis. The size of the substructure library at all levels is 5. When constructing the substructure in the ellipse, first judge whether the substructure exists in the substructure library corresponding to S2 , if not, enter the substructure sample construction at the level of S2 : Simulation S 2 The growth axis of the substructure sample in the substructure library, traverse all the substructure positions, and judge whether a substructure with a certain number exists. If it does not exist, go to the next layer for construction. This continues until the simplest level of substructure S 4 . Then call and return layer by layer.

步骤S3表示以子结构方法的植物数据保存;对于每一类子结构,其中植物数据是在模拟过程中创建的植物生长轴的信息,以及子结构位置上的子结构编号和变换矩阵。当存在子结构大量重复调用时,对重复的子结构数据仅保存一个备份。数据保存可以与步骤S2的植物结构构建过程同步进行,也可以在步骤S2完成之后实现。植物器官可以看作子结构的一个特例,其几何结构单独定义。每种器官对应于一个器官描述文件,器官描述文件包含器官的几何模型、纹理坐标等信息,可由专业软件手工创建。以子结构方式保存的植物数据中仅保存该器官的一个标识,从而节省空间。描述一个子结构的基本数据结构如下:Step S3 represents the storage of plant data in the substructure method; for each type of substructure, the plant data is the information of the growth axis of the plant created during the simulation process, as well as the substructure number and transformation matrix at the position of the substructure. When there are a large number of repeated substructure calls, only one backup is saved for the repeated substructure data. Data saving can be carried out synchronously with the plant structure construction process of step S2, or it can be realized after step S2 is completed. Plant organs can be seen as a special case of substructures, whose geometry is defined separately. Each organ corresponds to an organ description file, which contains information such as the geometric model and texture coordinates of the organ, and can be manually created by professional software. Only one identifier of the organ is saved in the plant data saved in the substructure, thus saving space. The basic data structure describing a substructure is as follows:

SUBSTRUCTURESUBSTRUCTURE

{{

int    ID;         //子结构的标识;int ID; //Identification of the substructure;

int    length;      //所包含器官个数;int length; //Number of organs included;

ORGAN  O(length);//所包含的器官列表ORGAN O(length);//List of organs included

}}

其中,ID为子结构的特征,说明该子结构的类别。length为其生长轴中包含的器官个数,包括普通的器官,例如节间、叶子、果实等,也包括其中的下一级子结构。O(length)为对每个器官的具体描述。其数据结构ORGAN的描述如下:Among them, ID is the feature of the substructure, indicating the category of the substructure. length is the number of organs contained in the growth axis, including common organs, such as internodes, leaves, fruits, etc., as well as the substructures therein. O(length) is a specific description of each organ. The description of its data structure ORGAN is as follows:

ORGANORGAN

{{

int      symbol;    //器官类别;int symbol; //organ category;

int      ID;        //器官标识;int ID; //organ identification;

float    Mo(3,4); //几何变换矩阵;float Mo(3,4); //geometric transformation matrix;

float    So(2);    //对于器官为器官大小,对于子结构则无意义。float So(2); //Organ size for organs, meaningless for substructures.

int      num_sons;           //所指向的器官个数int num_sons; //The number of organs pointed to

int      id_sons(num_sons);    //所指向的子器官标识int id_sons(num_sons); //The sub-organ identification pointed to

int      id_parent;       //父器官标识int id_parent; //parent organ identification

}}

其中,symbol用于标识数据结构ORGAN保存的是器官或子结构,不同的器官有不同的类别,与器官描述文件相对应。ID为器官的特征。Mo包含器官或子结构的旋转和平移变换矩阵。如果symbol表示当前的子结构是器官,则So为器官的大小,否则无意义。num_sons表示当前器官的子器官个数。对于节间,其上着生的器官和子结构及其顶端的节间均视为其子器官。id_sons(num_sons)即存放了所有子器官的标识。类似地,id_parent存放了当前器官的父器官的标识。所有的器官或子结构数据以标准的方向和大小存放,在调用时给出其在生长轴上的大小、方向和位置。Among them, symbol is used to identify the organ or substructure stored in the data structure ORGAN, and different organs have different categories, corresponding to the organ description file. ID is the characteristic of the organ. Mo contains the rotation and translation transformation matrices of organs or substructures. If symbol indicates that the current substructure is an organ, So is the size of the organ, otherwise it is meaningless. num_sons indicates the number of sub-organs of the current organ. For internodes, the organs and substructures attached to them and the internodes at their tops are considered as suborgans. id_sons(num_sons) stores the identifiers of all sub-organs. Similarly, id_parent stores the identifier of the parent organ of the current organ. All organ or substructure data are stored in standard orientation and size, and its size, orientation and position on the growth axis are given when called.

对于以子结构方式保存的数据,可以递归地解析出完整的植物几何信息,进行后续的处理。以伪代码方式描述的解析过程如下:For the data saved in substructure, the complete plant geometric information can be parsed recursively for subsequent processing. The parsing process described in pseudocode is as follows:

Read_Substructure(SUBSTRUCTURE s)Read_Substructure(SUBSTRUCTURE s)

 {{

   for i=1 to s.lengthfor i=1 to s.length

    if O(i).symbol<>’子结构’if O(i).symbol<>'substructure'

         Output_Substructure(O(i));//输出器官的信息Output_Substructure(O(i));//Output organ information

 elseelse

         Read_Substructure(O(i));Read_Substructure(O(i));

endend

  endend

}}

其中,函数Read_substructure逐个读取当前子结构中包含的器官信息,如果该器官是子结构,则进一步对其中的子结构进行解析。如果该器官为普通器官(即s.symbol<>’子结构’),则直接读取器官描述文件的信息,根据变换矩阵Mo进行变换并返回。由于每个子结构的ID是唯一的,因此通过ID对子结构进行直接访问,从而可以得到任意位置的子结构信息。例如图3是植物结构中包含的不同类别的子结构示例,从左到右分别是具有包含关系的不同类别的子结构。Among them, the function Read_substructure reads the organ information contained in the current substructure one by one, and if the organ is a substructure, further parses the substructure therein. If the organ is an ordinary organ (ie s.symbol<>'substructure'), then directly read the information of the organ description file, transform it according to the transformation matrix Mo and return it. Since the ID of each substructure is unique, the substructure can be directly accessed through the ID, so that the substructure information at any position can be obtained. For example, Figure 3 is an example of substructures of different categories included in the plant structure, and from left to right are substructures of different categories with containment relationships.

步骤S4利用子结构信息对植物结构进行交互式编辑。例如用户进行枝条修剪、拖动等操作。在进行交互过程中需要子结构之间的调用关系,使得用户在屏幕上选取一个子结构的生长轴的某位置后,该位置上方的所有的植物组成部分都能被选取。子结构之间的调用关系可以从步骤S3获取,也可以从步骤S2获取,后者意味着在模拟过程中进行交互式编辑。选取以后可以进行例如剪枝、疏叶、拖动等动作等。上述操作相当于创建了一个新的子结构。这时需要修改子结构之间的连接关系,将新的子结构的编号保存在上一级子结构中,而旧子结构被调用的次数减少。修改后的信息传回步骤S2或步骤S3.Step S4 uses the substructure information to interactively edit the plant structure. For example, the user performs operations such as branch pruning and dragging. In the process of interaction, the call relationship between the substructures is required, so that after the user selects a certain position on the growth axis of a substructure on the screen, all the plant components above the position can be selected. The calling relationship between substructures can be obtained from step S3, or from step S2, the latter means interactive editing during the simulation process. After selection, actions such as pruning, leaf thinning, and dragging can be performed. The above operation is equivalent to creating a new substructure. At this time, it is necessary to modify the connection relationship between the substructures, save the number of the new substructure in the upper substructure, and reduce the number of times the old substructure is called. The modified information is sent back to step S2 or step S3.

上述基于动态子结构的植物结构构建的思想可推广到植物群落的构建,即如图4a和图4b示出森林场景的子结构方法构建示意图,当构建包含大量植物个体的场景时,仅模拟有限的几个植物样本,然后通过重用这些信息来构建群落。如图4a表示虚拟植物样本,图4b表示重复应用这几个样本而构建的植物场景。The above idea of plant structure construction based on dynamic substructure can be extended to the construction of plant communities, that is, as shown in Figure 4a and Figure 4b, a schematic diagram of the construction method of the substructure of the forest scene is shown. When constructing a scene containing a large number of plant individuals, only limited simulation several plant samples from the phylogenetic population, and then build communities by reusing this information. Fig. 4a shows a virtual plant sample, and Fig. 4b shows a plant scene constructed by repeatedly applying these several samples.

这里我们给出了在“青园”软件中的实施结果。“青园”是本课题组自行开发的一个基于GreenLab功能结构模型的植物生长和结构模拟软件,可以用于构建各种作物和植物。GreenLab模型是一个通用的数学模型,基于植物学的基本假设而建立。青园软件用c++语言实现了本发明所描述的方法,并且进行了测试。PC机的配置为Intel Core(TM)21.86G的CPU,2G的内存,操作系统为Windows XP Professional。图5为青园软件中对复杂植物结构的模拟结果,一棵基于确定性子结构的复杂的杨树的模拟,其中包含了1210.6万个器官,模型计算时间为10.2秒。图6为青园软件中对随机植物结构的模拟结果为基于随机子结构的松树的模拟,其中子结构库的大小为5。表明在这样较小的子结构大小下,可以得到很好的视觉效果。Here we give the implementation results in the "Qingyuan" software. "Green Garden" is a plant growth and structure simulation software based on the GreenLab functional structure model developed by our research group, which can be used to construct various crops and plants. The GreenLab model is a general mathematical model based on the basic assumptions of botany. Qingyuan software has realized the method described in the present invention with c++ language, and carried out the test. The configuration of the PC is Intel Core(TM) 21.86G CPU, 2G memory, and the operating system is Windows XP Professional. Figure 5 shows the simulation results of complex plant structures in Qingyuan software, a simulation of a complex poplar tree based on deterministic substructure, which contains 12.106 million organs, and the model calculation time is 10.2 seconds. Figure 6 is the simulation result of random plant structure in Qingyuan software, which is the simulation of pine trees based on random substructure, where the size of the substructure library is 5. It shows that with such a small substructure size, good visual effects can be obtained.

以上所述,仅为本发明中的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉该技术的人在本发明所揭露的技术范围内,可理解想到的变换或替换,都应涵盖在本发明的权利要求书的保护范围之内。The above is only a specific implementation mode in the present invention, but the scope of protection of the present invention is not limited thereto. Anyone familiar with the technology can understand the conceivable transformation or replacement within the technical scope disclosed in the present invention. All should be covered within the scope of protection of the claims of the present invention.

Claims (4)

1. the three-dimensional plant based on dynamic minor structure makes up and storage means, it is characterized in that described method comprises that step is as follows:
Step S1: the minor structure parameter initialization, determine that branch in the virtual plant is the type of minor structure and call relation successively; The maximum number of given every straton structure, i.e. minor structure storehouse size;
Step S2: make up plant structure according to dynamic substructure method, at first make up the growth axis of virtual plant, for the anyon locations of structures on the growth of virtual plant axle, if corresponding minor structure exists in the minor structure storehouse, then directly from the minor structure storehouse, call, carry out being combined to current minor structure after the geometric transformation; Otherwise, recursively successively make up minor structure, put into corresponding minor structure storehouse, finish up to the virtual plant structure construction;
Step S3: the plant data with substructure method are preserved; For each class minor structure, wherein the plant data are the information of the plant growth axis created in simulation process, and locational minor structure numbering of minor structure and transformation matrix;
Step S4: utilize minor structure information that plant structure is carried out interactive editing; Call relation between the minor structure can obtain from step S3, also can obtain from step S2.
2. the three-dimensional plant based on dynamic minor structure according to claim 1 makes up and storage means, it is characterized in that, to minor structure storehouse of minor structure definition similar in the plant structure, saves time and the space by wherein information is repeated to call.
3. the three-dimensional plant based on dynamic minor structure according to claim 1 makes up and storage means, it is characterized in that, the sample evidence in the described minor structure storehouse needs and can dynamically produce, and the minor structure that can avoid producing is not called.
4. the three-dimensional plant based on dynamic minor structure according to claim 1 makes up and storage means, it is characterized in that, can only preserve the compression storage that a backup reaches virtual plant by the minor structure that the counterweight polyphony is used, can carry out interactively editor to plant and plant minor structure after making up according to the recalls information of minor structure.
CN2010106031804A 2010-12-23 2010-12-23 Method for constructing and storing three-dimensional virtual plant based on dynamic substructure Active CN102034268B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2010106031804A CN102034268B (en) 2010-12-23 2010-12-23 Method for constructing and storing three-dimensional virtual plant based on dynamic substructure

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2010106031804A CN102034268B (en) 2010-12-23 2010-12-23 Method for constructing and storing three-dimensional virtual plant based on dynamic substructure

Publications (2)

Publication Number Publication Date
CN102034268A true CN102034268A (en) 2011-04-27
CN102034268B CN102034268B (en) 2012-06-27

Family

ID=43887120

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2010106031804A Active CN102034268B (en) 2010-12-23 2010-12-23 Method for constructing and storing three-dimensional virtual plant based on dynamic substructure

Country Status (1)

Country Link
CN (1) CN102034268B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102314546A (en) * 2011-06-01 2012-01-11 福州大学 Method for estimating plant growth biomass liveweight variation based on virtual plants

Non-Patent Citations (6)

* Cited by examiner, † Cited by third party
Title
《10th International Conference in Central Europe on Computer Graphics, Visualization and Computer Vision》 20020208 Hong-Ping Yan et al Fast Algorithms of Plant Computation Based on Substructure Instances 第146页左栏倒数第2段第1-12行 2 , 2 *
《11th International Conference in Central Europe on Computer Graphics, Visualization and Digital Interactive Media》 20030207 MengZhen Kang et al Fast Algorithm for Stochastic Tree Computation and Forest Simulation 全文 1-4 , 2 *
《16th International Conference on Artificial Reality and Telexistence--Workshops》 20061201 Ding Wei-long et al An Improved Algorithm Based on Sub-structures for Creating Virtual Plant 全文 1-4 , 2 *
《Plant Growth Modeling and Applications》 20031016 M.-Z. Kang et al Stochastic 3D Tree Simulation Using Substructure Instancing 全文 1-4 , 2 *
《中国图象图形学报》 20040331 康孟珍 等 快速构造植物几何结构的子结构算法 第80页左栏第2段,第80-82页2.1节,第83页第3节,第84页左栏第1段,及图1、图2 1-4 第9卷, 第3期 2 *
《安徽农业科学》 20081231 胡林 等 虚拟植物研究进展 全文 1-4 第36卷, 第25期 2 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102314546A (en) * 2011-06-01 2012-01-11 福州大学 Method for estimating plant growth biomass liveweight variation based on virtual plants
CN102314546B (en) * 2011-06-01 2014-03-12 福州大学 Method for estimating plant growth biomass liveweight variation based on virtual plants

Also Published As

Publication number Publication date
CN102034268B (en) 2012-06-27

Similar Documents

Publication Publication Date Title
US12017145B2 (en) Method and system of automatic animation generation
Kniemeyer Design and implementation of a graph grammar based language for functional-structural plant modelling
CN112199086B (en) Automatic programming control system, method, device, electronic equipment and storage medium
CN102184569B (en) Individual plant wood modeling method driven by domain ontology
CN102262534B (en) System and method for developing computer online games based on Internet browser/server (B/S) structure
CN106293761B (en) Method and apparatus for generating game editors and plug-ins
CN111708563A (en) Method and device for updating UI control in game
CN102289846A (en) Tree simulation method based on generalized parametric modeling
CN112755534B (en) Data processing method, device and storage medium
CN115794063A (en) Three-dimensional model processing method and device and electronic equipment
CN118887337A (en) A method for generating 3D models based on digital terrain maps in DWG format
CN116360766A (en) Low-code system and device based on DDD visual designer
CN102034268B (en) Method for constructing and storing three-dimensional virtual plant based on dynamic substructure
CN104794750A (en) Tree point cloud three-dimensional reconstruction method based on space colonizing algorithm
CN112579827A (en) Data-driven power system data processing method and system
Griffon et al. AMAPstudio: A software suite for plants architecture modelling
Adão Ontology-based procedural modelling of traversable buildings composed by arbitrary shapes
CN117982894A (en) Game map generation method and device, readable storage medium and electronic device
Auzmendi et al. Using L-studio to Visualize Data and Modify Plant Architecture for Agronomic Purposes: Visualization and modification of plant architecture with L-studio
Kelly Unwritten procedural modeling with the straight skeleton
Bai [Retracted] Sustainable Development Garden Landscape Design Based on Data Mining and Virtual Reality
Ambarwari et al. Conceptual Model of Graph-based Individual Tree and Its Utilization in Digital Twin and Metaverse of Urban Forest
CN118736173B (en) Three-dimensional UI production method and equipment based on Cocos game engine
CN109902387A (en) A kind of method and apparatus of cutting or isolation based on small map
Haefele et al. Euforia integrated visualization

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant