CN114972609A - Method and device for generating ice crack style image - Google Patents
Method and device for generating ice crack style image Download PDFInfo
- Publication number
- CN114972609A CN114972609A CN202210651176.8A CN202210651176A CN114972609A CN 114972609 A CN114972609 A CN 114972609A CN 202210651176 A CN202210651176 A CN 202210651176A CN 114972609 A CN114972609 A CN 114972609A
- Authority
- CN
- China
- Prior art keywords
- particles
- particle system
- particle
- generating
- style image
- 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.)
- Pending
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T15/00—3D [Three Dimensional] image rendering
- G06T15/02—Non-photorealistic rendering
Landscapes
- Engineering & Computer Science (AREA)
- Computer Graphics (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Processing Or Creating Images (AREA)
Abstract
Description
技术领域technical field
本发明涉及计算机图形学领域,尤其涉及一种冰裂纹风格图像的生成方法及装置。需要说明的是,本发明冰裂纹风格图像的生成方法及装置可用于计算机图形学领域,也可用于除计算机图形学领域之外的任意领域,本发明冰裂纹风格图像的生成方法及装置的应用领域不做限定。The invention relates to the field of computer graphics, in particular to a method and device for generating an ice crack style image. It should be noted that the method and device for generating an ice crack style image of the present invention can be used in the field of computer graphics, and can also be used in any field other than the field of computer graphics. The application of the method and device for generating an ice crack style image of the present invention The field is not limited.
背景技术Background technique
本部分旨在为权利要求书中陈述的本发明实施例提供背景或上下文。此处的描述不因为包括在本部分中就承认是现有技术。This section is intended to provide a background or context to the embodiments of the invention recited in the claims. The descriptions herein are not admitted to be prior art by inclusion in this section.
冰裂纹是一种古老的中国瓷器烧制工艺,因其纹片如冰破裂,裂片层叠,具有典型的化腐朽为神奇的残缺之美,即使到了现代仍然大放光彩,一些餐桌、茶几桌面、香水瓶,甚至花丛中的石板路都有冰裂纹的身影。但是冰裂纹风格图像的生成大多依赖于传统手工工艺流程,很少有其他方式可以生成冰裂纹风格图像,人们不能很便捷的获取冰裂纹风格图像,冰裂纹风格图像在互联网、工业、艺术等领域的传播、应用和创新受到了很大限制。Ice crack is an ancient Chinese porcelain firing process. Because of the cracked pieces like ice and the overlapping slivers, it has the typical beauty of turning decay into magic. Even in modern times, it still shines brightly. Some dining tables, coffee table table tops, perfumes There are ice cracks in the bottle, and even the stone road among the flowers. However, the generation of ice crack style images mostly relies on traditional manual processes. There are few other ways to generate ice crack style images. People cannot easily obtain ice crack style images. Ice crack style images are used in the Internet, industry, art and other fields. The dissemination, application and innovation have been greatly restricted.
因此,亟需一种可以克服上述问题的冰裂纹风格图像的生成方法和装置。Therefore, there is an urgent need for a method and apparatus for generating an ice crack style image that can overcome the above problems.
发明内容SUMMARY OF THE INVENTION
本发明实施例提供一种冰裂纹风格图像的生成方法,用以简单快速的生成冰裂纹风格图像,便于扩大冰裂纹风格图像的的传播、应用和创新,该方法包括:An embodiment of the present invention provides a method for generating an ice crack style image, which is used to generate an ice crack style image simply and quickly, so as to facilitate the expansion, application and innovation of the ice crack style image. The method includes:
初始化粒子系统和粒子系统的受力场;Initialize the particle system and the force field of the particle system;
根据粒子系统的受力场,指导粒子系统中的粒子受力运动;According to the force field of the particle system, guide the force movement of the particles in the particle system;
根据粒子系统中粒子的运动状态,更新粒子系统中粒子的轨迹;According to the motion state of the particles in the particle system, update the trajectory of the particles in the particle system;
在粒子系统中所有粒子结束运动后,根据粒子系统中所有粒子的轨迹,生成冰裂纹风格图像。After all particles in the particle system have finished moving, an ice crack style image is generated according to the trajectories of all particles in the particle system.
本发明实施例还提供一种冰裂纹风格图像的生成装置,用以简单快速的生成冰裂纹风格图像,便于扩大冰裂纹风格图像的的传播、应用和创新,该装置包括:The embodiment of the present invention also provides a device for generating an ice crack style image, which is used to generate an ice crack style image simply and quickly, so as to facilitate the expansion, application and innovation of the ice crack style image. The device includes:
初始化模块,用于初始化粒子系统和粒子系统的受力场;The initialization module is used to initialize the particle system and the force field of the particle system;
粒子受力运动模块,用于根据粒子系统的受力场,指导粒子系统中的粒子受力运动;The particle force movement module is used to guide the force movement of particles in the particle system according to the force field of the particle system;
轨迹更新模块,用于根据粒子系统中粒子的运动状态,更新粒子系统中粒子的轨迹;The trajectory update module is used to update the trajectory of the particles in the particle system according to the motion state of the particles in the particle system;
冰裂纹风格图像生成模块,用于在粒子系统中所有粒子结束运动后,根据粒子系统中所有粒子的轨迹,生成冰裂纹风格图像。The ice crack style image generation module is used to generate ice crack style images according to the trajectories of all particles in the particle system after all particles in the particle system have finished moving.
本发明实施例还提供一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现上述冰裂纹风格图像的生成方法。An embodiment of the present invention further provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, the processor implements the generation of the ice crack style image when the processor executes the computer program method.
本发明实施例还提供一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时实现上述冰裂纹风格图像的生成方法。An embodiment of the present invention further provides a computer-readable storage medium, where the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, implements the above-mentioned method for generating an ice crack style image.
本发明实施例还提供一种计算机程序产品,所述计算机程序产品包括计算机程序,所述计算机程序被处理器执行时实现上述冰裂纹风格图像的生成方法。An embodiment of the present invention further provides a computer program product, where the computer program product includes a computer program, and when the computer program is executed by a processor, implements the above-mentioned method for generating an ice crack style image.
本发明实施例中,初始化粒子系统和粒子系统的受力场;根据粒子系统的受力场,指导粒子系统中的粒子受力运动;根据粒子系统中粒子的运动状态,更新粒子系统中粒子的轨迹;在粒子系统中所有粒子结束运动后,根据粒子系统中所有粒子的轨迹,生成冰裂纹风格图像。本发明实施例通过粒子系统生成冰裂纹风格图像,方法简单且效果显著,使冰裂纹风格图像的生成不再依赖于传统手工工艺,人们可以更加便捷的获取冰裂纹风格图像,专业人士可以使用冰裂纹风格图像进行二次创作,非专业人士可以使用冰裂纹风格图像进行社交娱乐,从而便于冰裂纹风格图像在工业制造、艺术创作、互联网产业等领域得以传播、应用和创新。In the embodiment of the present invention, the particle system and the force field of the particle system are initialized; according to the force field of the particle system, the force movement of the particles in the particle system is guided; Trajectory: After all particles in the particle system have finished moving, generate an ice crack style image based on the trajectory of all particles in the particle system. The embodiment of the present invention generates an ice crack style image through a particle system, the method is simple and the effect is remarkable, so that the generation of the ice crack style image no longer depends on the traditional manual process, people can obtain the ice crack style image more conveniently, and professionals can use the ice crack style image. Crack-style images are used for secondary creation, and non-professionals can use ice-crack-style images for social entertainment, which facilitates the dissemination, application and innovation of ice-crack-style images in industrial manufacturing, artistic creation, and the Internet industry.
附图说明Description of drawings
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。在附图中:In order to explain the embodiments of the present invention or the technical solutions in the prior art more clearly, the following briefly introduces the accompanying drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only These are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can also be obtained according to these drawings without creative efforts. In the attached image:
图1为本发明实施例中冰裂纹风格图像的生成方法的流程示意图;1 is a schematic flowchart of a method for generating an ice crack style image according to an embodiment of the present invention;
图2为本发明实施例中冰裂纹风格图像的生成方法的一具体实例图;2 is a specific example diagram of a method for generating an ice crack style image in an embodiment of the present invention;
图3为本发明实施例中冰裂纹风格图像的生成方法的一具体实例图;3 is a diagram of a specific example of a method for generating an ice crack style image according to an embodiment of the present invention;
图4为本发明实施例中冰裂纹风格图像的生成方法的一具体实例图;4 is a diagram of a specific example of a method for generating an ice crack style image according to an embodiment of the present invention;
图5为本发明实施例中冰裂纹风格图像的生成方法的一具体实例图;5 is a diagram of a specific example of a method for generating an ice crack style image according to an embodiment of the present invention;
图6为本发明实施例中冰裂纹风格图像的生成方法的一具体实例图;6 is a diagram of a specific example of a method for generating an ice crack style image according to an embodiment of the present invention;
图7为本发明实施例中冰裂纹风格图像的生成方法的一具体实例图;7 is a diagram of a specific example of a method for generating an ice crack style image according to an embodiment of the present invention;
图8为本发明实施例中冰裂纹风格图像的生成装置的示意图;8 is a schematic diagram of an apparatus for generating an ice crack style image according to an embodiment of the present invention;
图9为本发明实施例中冰裂纹风格图像的生成装置的一具体实例图。FIG. 9 is a diagram of a specific example of an apparatus for generating an ice crack style image according to an embodiment of the present invention.
具体实施方式Detailed ways
为使本发明实施例的目的、技术方案和优点更加清楚明白,下面结合附图对本发明实施例做进一步详细说明。在此,本发明的示意性实施例及其说明用于解释本发明,但并不作为对本发明的限定。In order to make the purposes, technical solutions and advantages of the embodiments of the present invention more clearly understood, the embodiments of the present invention will be further described in detail below with reference to the accompanying drawings. Here, the exemplary embodiments of the present invention and their descriptions are used to explain the present invention, but not to limit the present invention.
首先,对本发明实施例中的技术名词进行介绍:First, the technical terms in the embodiments of the present invention are introduced:
粒子系统:粒子系统是计算机图形学中的一种技术,用来模拟常见的物理现象。一个粒子系统由许多的粒子组成,通过对每一个粒子的属性、状态进行控制,最终可以构成粒子系统的宏观现象。Particle System: Particle system is a technique in computer graphics used to simulate common physical phenomena. A particle system is composed of many particles. By controlling the properties and states of each particle, the macroscopic phenomenon of the particle system can finally be formed.
冰裂纹风格图像:冰裂纹是一种古老的中国瓷器烧制工艺,因其纹片如冰破裂,裂片层叠,有立体感而称之,具有典型的化腐朽为神奇的残缺之美。冰裂纹风格图像指具有冰裂纹纹理的图像。Ice crack style image: Ice crack is an ancient Chinese porcelain firing process. It is called because of the cracked pattern of ice, the layered slivers, and the three-dimensional effect. It has a typical beauty of turning decay into magical incompleteness. An ice crack style image refers to an image with an ice crack texture.
发明人发现,冰裂纹风格图像的生成大多依赖于传统手工工艺流程,很少有其他方式可以生成冰裂纹风格图像,人们不能很便捷的获取冰裂纹风格图像,冰裂纹风格图像在互联网、工业、艺术等领域的传播、应用和创新受到了很大限制。为解决此问题,发明人提出一种冰裂纹风格图像的生成方法,图1为本发明实施例中冰裂纹风格图像的生成方法的流程示意图,如图1所示,该方法包括如下步骤:The inventor found that the generation of ice crack style images mostly relies on traditional manual processes, and there are few other ways to generate ice crack style images. People cannot easily obtain ice crack style images. Dissemination, application and innovation in fields such as art have been greatly restricted. To solve this problem, the inventor proposes a method for generating an ice crack style image. FIG. 1 is a schematic flowchart of a method for generating an ice crack style image in an embodiment of the present invention. As shown in FIG. 1 , the method includes the following steps:
步骤101、初始化粒子系统和粒子系统的受力场;
步骤102、根据粒子系统的受力场,指导粒子系统中的粒子受力运动;
步骤103、根据粒子系统中粒子的运动状态,更新粒子系统中粒子的轨迹;Step 103: Update the trajectory of the particle in the particle system according to the motion state of the particle in the particle system;
步骤104、在粒子系统中所有粒子结束运动后,根据粒子系统中所有粒子的轨迹,生成冰裂纹风格图像。
由图1所示的流程可以得知,本发明实施例中,初始化粒子系统和粒子系统的受力场;根据粒子系统的受力场,指导粒子系统中的粒子受力运动;根据粒子系统中粒子的运动状态,更新粒子系统中粒子的轨迹;在粒子系统中所有粒子结束运动后,根据粒子系统中所有粒子的轨迹,生成冰裂纹风格图像。本发明实施例通过粒子系统生成冰裂纹风格图像,方法简单且效果显著,使冰裂纹风格图像的生成不再依赖于传统手工工艺,人们可以更加便捷的获取冰裂纹风格图像,专业人士可以使用冰裂纹风格图像进行二次创作,非专业人士可以使用冰裂纹风格图像进行社交娱乐,从而便于冰裂纹风格图像在工业制造、艺术创作、互联网产业等领域得以传播、应用和创新。It can be known from the process shown in FIG. 1 that in the embodiment of the present invention, the particle system and the force field of the particle system are initialized; according to the force field of the particle system, the force movement of the particles in the particle system is guided; The motion state of the particle, and the trajectory of the particle in the particle system is updated; after all the particles in the particle system have finished moving, the ice crack style image is generated according to the trajectory of all the particles in the particle system. The embodiment of the present invention generates an ice crack style image through a particle system, the method is simple and the effect is remarkable, so that the generation of the ice crack style image no longer depends on the traditional manual process, people can obtain the ice crack style image more conveniently, and professionals can use the ice crack style image. Crack-style images are used for secondary creation, and non-professionals can use ice-crack-style images for social entertainment, which facilitates the dissemination, application and innovation of ice-crack-style images in industrial manufacturing, artistic creation, and the Internet industry.
具体实施时,首先,初始化粒子系统和粒子系统的受力场。例如,使用编程语言初始化粒子系统和粒子系统的受力场,所述编程语言可以包括C语言、C++语言、JAVA语言等编程语言,本说明书中不做具体限制。During specific implementation, first, initialize the particle system and the force field of the particle system. For example, use a programming language to initialize the particle system and the force field of the particle system. The programming language may include programming languages such as C language, C++ language, and JAVA language, which are not specifically limited in this specification.
在一个实施例中,初始化粒子系统,包括:初始化粒子系统中粒子的位置、速度、电荷量和正负电性。粒子具有的属性有位置、速度、加速度、电荷量和正负电性。粒子具有的行为有:在受力场的作用下运动,即移动位置。每个粒子在生成时,会初始化好位置、速度、电荷量及正负电性(电荷量及正负电性根据程序运行时间随机生成,且在随后的每次更新中持续随机变化)。粒子的加速度受受力场的作用产生。In one embodiment, initializing the particle system includes: initializing the position, velocity, charge amount, and positive and negative charge of particles in the particle system. Particles have properties such as position, velocity, acceleration, charge, and electropositivity. The behaviors of particles are: moving under the action of a force field, that is, moving positions. When each particle is generated, its position, velocity, charge, and positive and negative properties are initialized (the charge and positive and negative properties are randomly generated according to the program running time, and continue to change randomly in each subsequent update). The acceleration of particles is produced by the action of the force field.
图2为本发明实施例中冰裂纹风格图像的生成方法的一具体实例图,如图2所示,本例中初始化粒子系统时具有4个初代粒子,指定这4个粒子的速度方向分别为沿x轴、y轴正负四个方向,这4个粒子的位置均在受力场正中,速度大小、电荷量和正负电性均随机生成。FIG. 2 is a diagram of a specific example of a method for generating an ice crack style image in an embodiment of the present invention. As shown in FIG. 2 , in this example, there are four primary particles when initializing the particle system, and the speed directions of the four particles are specified as Along the positive and negative directions of the x-axis and the y-axis, the positions of the four particles are all in the middle of the force field, and the velocity, charge, and positive and negative electrical properties are randomly generated.
需要说明的是,在一个实施例中,粒子系统中的粒子受粒子系统的受力场的影响,在其它的实施例中,粒子系统中的粒子除受粒子系统的受力场的影响外,粒子和粒子之间的作用也需考虑,例如同性相斥,异性相吸等,在后面的实施例中,以粒子系统中的粒子受粒子系统的受力场的影响为例进行说明。It should be noted that, in one embodiment, the particles in the particle system are affected by the force field of the particle system. In other embodiments, the particles in the particle system are not only affected by the force field of the particle system, The interaction between particles also needs to be considered, such as same-sex repulsion, opposite-sex attraction, etc. In the following embodiments, the particles in the particle system are affected by the force field of the particle system as an example for description.
在一个实施例中,初始化粒子系统的受力场,包括:初始化粒子系统的受力场的磁感应强度。例如,初始化粒子系统的受力场时,配置受力场的磁感应强度。例如可以给定磁感应强度恒为(0,0,-1)的磁场。In one embodiment, initializing the force field of the particle system includes: initializing the magnetic induction intensity of the force field of the particle system. For example, when initializing the force field of a particle system, configure the magnetic induction of the force field. For example, a magnetic field with a constant magnetic induction intensity of (0,0,-1) can be given.
在一个实施例中,按如下公式,根据粒子系统的受力场,指导粒子系统中的粒子受力运动,包括:In one embodiment, according to the following formula, according to the force field of the particle system, the force movement of the particles in the particle system is guided, including:
F=qV×B;F=qV×B;
其中,F为粒子系统中粒子受力;q为粒子系统中粒子的电荷量;V为粒子系统中粒子的速度;B为粒子系统的受力场的磁感应强度。Among them, F is the force on the particle in the particle system; q is the charge of the particle in the particle system; V is the velocity of the particle in the particle system; B is the magnetic induction intensity of the force field of the particle system.
在初始化粒子系统和粒子系统的受力场之后,根据粒子系统的受力场,指导粒子系统中的粒子受力运动;根据粒子系统中粒子的运动状态,更新粒子系统中粒子的轨迹。After initializing the particle system and the force field of the particle system, the force movement of the particles in the particle system is guided according to the force field of the particle system; the trajectory of the particles in the particle system is updated according to the motion state of the particles in the particle system.
例如,在初始化粒子系统和粒子系统的受力场之后,所有粒子受到受力场的作用产生加速度而开始运动,实时更新粒子系统中所有粒子的位置、速度、电荷量、正负电性以及轨迹。For example, after initializing the particle system and the force field of the particle system, all particles are accelerated by the force field and start to move, and the position, velocity, charge, positive and negative charge, and trajectory of all particles in the particle system are updated in real time. .
在一个实施例中,根据粒子系统的受力场,指导粒子系统中的粒子受力运动,根据粒子系统中粒子的运动状态,更新粒子系统中粒子的轨迹,可以包括:In one embodiment, the force movement of the particles in the particle system is guided according to the force field of the particle system, and the trajectory of the particles in the particle system is updated according to the motion state of the particles in the particle system, which may include:
根据粒子系统的受力场,指导粒子系统中的初代粒子受力运动,根据粒子系统中初代粒子的运动状态,更新粒子系统中初代粒子的轨迹;According to the force field of the particle system, guide the force movement of the first-generation particles in the particle system, and update the trajectory of the first-generation particles in the particle system according to the motion state of the first-generation particles in the particle system;
在粒子系统中初代粒子结束运动后,在初代粒子的轨迹上生成子代粒子;After the primary particle in the particle system finishes moving, the child particle is generated on the trajectory of the primary particle;
根据粒子系统的受力场,指导粒子系统中的子代粒子受力运动,根据粒子系统中子代粒子的运动状态,更新粒子系统中子代粒子的轨迹;According to the force field of the particle system, guide the force movement of the child particles in the particle system, and update the trajectory of the child particles in the particle system according to the motion state of the child particles in the particle system;
在粒子系统中子代粒子结束运动后,在子代粒子的轨迹上生成孙代粒子;After the child particles in the particle system end their motion, the grandchild particles are generated on the trajectory of the child particles;
根据粒子系统的受力场,指导粒子系统中的孙代粒子受力运动,根据粒子系统中孙代粒子的运动状态,更新粒子系统中孙代粒子的轨迹;According to the force field of the particle system, guide the force movement of the grandchild particles in the particle system, and update the trajectory of the grandchild particles in the particle system according to the motion state of the grandchild particles in the particle system;
以此类推,直至粒子系统中所有粒子结束运动。And so on, until all particles in the particle system stop moving.
在一个实施例中,在初代粒子的轨迹上生成子代粒子,可以包括:In one embodiment, generating child particles on the trajectory of the first generation particle may include:
在初代粒子的轨迹两侧间隔设定的长度阈值交替生成子代粒子,其中子代粒子的初速度方向垂直于生成子代粒子的初代粒子的轨迹的切线方向;Daughter particles are alternately generated by the set length thresholds on both sides of the trajectory of the primary particle, wherein the initial velocity direction of the child particle is perpendicular to the tangent direction of the trajectory of the primary particle that generates the child particle;
在子代粒子的轨迹上生成孙代粒子,可以包括:Spawns grandchild particles on their trajectories, which can include:
在子代粒子的轨迹两侧间隔设定的长度阈值交替生成孙代粒子,其中孙代粒子的初速度方向垂直于生成孙代粒子的子代粒子的轨迹的切线方向。The length thresholds set on both sides of the descendant particle's trajectory alternately generate grandchildren particles, wherein the initial velocity direction of the grandchildren particles is perpendicular to the tangent direction of the trajectory of the descendant particles that generate the grandchildren particles.
例如,在初代粒子运动结束后,在初代粒子的轨迹两侧间隔设定的长度阈值交替生成子代粒子,其中子代粒子的初速度方向垂直于生成子代粒子的初代粒子的轨迹的切线方向。子代粒子继续运动,直至结束运动。本领域技术人员应当知晓,可以根据实际需求预先设定长度阈值,本说明书中不做限定。图3为本发明实施例中冰裂纹风格图像的生成方法的一具体实例图,如图3所示,本例中在结束运动的粒子的轨迹两侧间隔设定的长度阈值交替生成下一代粒子。For example, after the motion of the primary particle ends, the length thresholds set on both sides of the trajectory of the primary particle are alternately generated to generate child particles, wherein the initial velocity direction of the child particle is perpendicular to the tangent direction of the trajectory of the primary particle that generates the child particle. . The child particles continue to move until the movement ends. Those skilled in the art should know that the length threshold can be preset according to actual requirements, which is not limited in this specification. FIG. 3 is a diagram of a specific example of a method for generating an ice crack style image according to an embodiment of the present invention. As shown in FIG. 3 , in this example, the next-generation particles are alternately generated by the length thresholds set at intervals on both sides of the trajectory of the particle that has ended motion. .
然后在这些子代粒子的轨迹上又产生孙代粒子,如此往复,直至所有的粒子结束运动。粒子系统的生长过程结束。图4为本发明实施例中冰裂纹风格图像的生成方法的一具体实例图,图4中示出了本例中粒子系统的生长过程结束后全部粒子的轨迹。Then, grandchild particles are generated on the trajectory of these child particles, and so on and so forth, until all the particles stop moving. The growth process of the particle system ends. FIG. 4 is a diagram of a specific example of a method for generating an ice crack style image according to an embodiment of the present invention, and FIG. 4 shows the trajectories of all particles after the growth process of the particle system in this example ends.
在一个实施例中,在粒子系统中粒子运动至生成冰裂纹风格图像的画布边界,或运动至其它粒子的轨迹时,确定粒子结束运动。In one embodiment, when the particle in the particle system moves to the boundary of the canvas that generates the ice crack style image, or moves to the trajectory of other particles, it is determined that the particle ends the movement.
例如,粒子系统中的某个粒子运动至生成冰裂纹风格图像的画布边界时,则确定该粒子结束运动,从粒子系统中删除该粒子。For example, when a particle in the particle system moves to the border of the canvas where the ice crack style image is generated, it is determined that the particle ends its movement, and the particle is deleted from the particle system.
又如,粒子系统中的某个粒子运动至其它粒子的轨迹时,则确定该粒子结束运动,从粒子系统中删除该粒子。For another example, when a certain particle in the particle system moves to the trajectory of other particles, it is determined that the particle ends the movement, and the particle is deleted from the particle system.
在一个实施例中,根据粒子系统中所有粒子的轨迹,生成冰裂纹风格图像之前,还包括:In one embodiment, before generating the ice crack style image according to the trajectories of all particles in the particle system, the method further includes:
将生成冰裂纹风格图像的画布背景设置为预设的颜色,或设置为用户输入的图像。Sets the background of the canvas that generates the ice crack style image to a preset color, or to an image entered by the user.
在粒子系统中所有粒子结束运动后,根据粒子系统中所有粒子的轨迹,生成冰裂纹风格图像。After all particles in the particle system have finished moving, an ice crack style image is generated according to the trajectories of all particles in the particle system.
例如,将生成冰裂纹风格图像的画布背景设置为白色,在粒子系统中所有粒子结束运动后,根据粒子系统中所有粒子的轨迹,生成冰裂纹风格图像。图5为本发明实施例中冰裂纹风格图像的生成方法的一具体实例图,图5示出了将生成冰裂纹风格图像的画布背景设置为白色时生成的一种冰裂纹风格图像。For example, set the background of the canvas for generating the ice crack style image to white, and after all particles in the particle system have finished moving, generate the ice crack style image according to the trajectories of all particles in the particle system. FIG. 5 is a diagram of a specific example of a method for generating an ice crack style image according to an embodiment of the present invention. FIG. 5 shows an ice crack style image generated when the background of the canvas for generating the ice crack style image is set to white.
又如,将生成冰裂纹风格图像的画布背景设置为用户输入的图像,在粒子系统中所有粒子结束运动后,根据粒子系统中所有粒子的轨迹,生成冰裂纹风格图像。图6为本发明实施例中冰裂纹风格图像的生成方法的一具体实例图,图6示出了将生成冰裂纹风格图像的画布背景设置为用户输入的图像时生成的一种冰裂纹风格图像。For another example, the background of the canvas for generating the ice crack style image is set as the image input by the user, and after all particles in the particle system finish moving, the ice crack style image is generated according to the trajectory of all particles in the particle system. FIG. 6 is a diagram of a specific example of a method for generating an ice crack style image in an embodiment of the present invention. FIG. 6 shows an ice crack style image generated when the background of the canvas for generating the ice crack style image is set as an image input by a user .
图7为本发明实施例中冰裂纹风格图像的生成方法的一具体实例图,如图7所示,在初始化粒子系统和粒子系统的受力场之后,可以包括:FIG. 7 is a diagram of a specific example of a method for generating an ice crack style image according to an embodiment of the present invention. As shown in FIG. 7 , after initializing the particle system and the force field of the particle system, it may include:
步骤701、首先判断粒子系统粒子的数量是否大于零,如果是,进入循环;如果否,结束循环,进入步骤708;
步骤702、受粒子系统的受力场作用,粒子产生加速度,开始运动;Step 702: Under the action of the force field of the particle system, the particles generate acceleration and start to move;
步骤703、更新粒子的位置、速度、电荷量和正负电性;
步骤704、更新粒子的轨迹;
步骤705、判断粒子是否结束运动,即判断粒子是否运动至生成冰裂纹风格图像的画布边界,或运动至其它粒子的轨迹,如果是,确定粒子结束运动;如果否,回到步骤701继续循环;
步骤706、如果粒子结束运动,从粒子系统中删除该粒子;
步骤707、在该被删除的粒子的轨迹两侧间隔设定的长度阈值交替生成下一代粒子,回到步骤701继续循环,直至粒子系统中所有粒子结束运动;Step 707: Alternately generate next-generation particles with the set length thresholds on both sides of the track of the deleted particle, and return to step 701 to continue the cycle until all particles in the particle system end their motion;
步骤708、在粒子系统中所有粒子结束运动后,根据粒子系统中所有粒子的轨迹,生成冰裂纹风格图像。
本发明实施例中还提供了一种冰裂纹风格图像的生成装置,如下面的实施例所述。由于该装置解决问题的原理与冰裂纹风格图像的生成方法相似,因此该装置的实施可以参见冰裂纹风格图像的生成方法的实施,重复之处不再赘述。An embodiment of the present invention also provides an apparatus for generating an ice crack style image, as described in the following embodiments. Since the principle of the device for solving the problem is similar to the method for generating an ice crack style image, the implementation of the device may refer to the implementation of the method for generating an ice crack style image, and the repetition will not be repeated.
图8为本发明实施例中冰裂纹风格图像的生成装置的流程示意图,如图8所示,该装置可以包括:FIG. 8 is a schematic flowchart of an apparatus for generating an ice crack style image according to an embodiment of the present invention. As shown in FIG. 8 , the apparatus may include:
初始化模块801,用于初始化粒子系统和粒子系统的受力场;The
粒子受力运动模块802,用于根据粒子系统的受力场,指导粒子系统中的粒子受力运动;The particle
轨迹更新模块803,用于根据粒子系统中粒子的运动状态,更新粒子系统中粒子的轨迹;The
冰裂纹风格图像生成模块804,用于在粒子系统中所有粒子结束运动后,根据按粒子系统中所有粒子的轨迹,生成冰裂纹风格图像。The ice crack style
在一个实施例中,初始化模块801,具体用于:In one embodiment, the
初始化粒子系统中粒子的位置、速度、电荷量和正负电性。Initializes the position, velocity, charge, and positive and negative charge of the particles in the particle system.
在一个实施例中,初始化模块801,具体用于:In one embodiment, the
初始化粒子系统的受力场的磁感应强度。Initializes the magnetic induction of the force field of the particle system.
在一个实施例中,粒子受力运动模块802,具体用于:In one embodiment, the particle
按如下公式,根据粒子系统的受力场,指导粒子系统中的粒子受力运动:According to the following formula, according to the force field of the particle system, the force movement of the particles in the particle system is guided:
F=qV×B;F=qV×B;
其中,F为粒子系统中粒子受力;q为粒子系统中粒子的电荷量;V为粒子系统中粒子的速度;B为粒子系统的受力场的磁感应强度。Among them, F is the force on the particle in the particle system; q is the charge of the particle in the particle system; V is the velocity of the particle in the particle system; B is the magnetic induction intensity of the force field of the particle system.
在一个实施例中,粒子受力运动模块802,具体用于:In one embodiment, the particle
根据粒子系统的受力场,指导粒子系统中的初代粒子受力运动;According to the force field of the particle system, guide the force movement of the primary particles in the particle system;
在粒子系统中初代粒子结束运动后,在初代粒子的轨迹上生成子代粒子;After the primary particle in the particle system finishes moving, the child particle is generated on the trajectory of the primary particle;
根据粒子系统的受力场,指导粒子系统中的子代粒子受力运动;According to the force field of the particle system, guide the force movement of the child particles in the particle system;
在粒子系统中子代粒子结束运动后,在子代粒子的轨迹上生成孙代粒子;After the child particles in the particle system end their motion, the grandchild particles are generated on the trajectory of the child particles;
根据粒子系统的受力场,指导粒子系统中的孙代粒子受力运动;According to the force field of the particle system, guide the force movement of the grandchild particles in the particle system;
以此类推,直至粒子系统中所有粒子结束运动。And so on, until all particles in the particle system stop moving.
轨迹更新模块803,具体用于:The
根据粒子系统中初代粒子的运动状态,更新粒子系统中初代粒子的轨迹;According to the motion state of the primary particle in the particle system, update the trajectory of the primary particle in the particle system;
根据粒子系统中子代粒子的运动状态,更新粒子系统中子代粒子的轨迹;According to the motion state of the child particles in the particle system, update the trajectory of the child particles in the particle system;
根据粒子系统中孙代粒子的运动状态,更新粒子系统中孙代粒子的轨迹;According to the motion state of the grandchild particles in the particle system, update the trajectory of the grandchild particles in the particle system;
以此类推,直至粒子系统中所有粒子结束运动。And so on, until all particles in the particle system stop moving.
在一个实施例中,粒子受力运动模块802,具体用于:In one embodiment, the particle
在初代粒子的轨迹两侧间隔设定的长度阈值交替生成子代粒子,其中子代粒子的初速度方向垂直于生成子代粒子的初代粒子的轨迹的切线方向;Daughter particles are alternately generated by the set length thresholds on both sides of the trajectory of the primary particle, wherein the initial velocity direction of the child particle is perpendicular to the tangent direction of the trajectory of the primary particle that generates the child particle;
在子代粒子的轨迹两侧间隔设定的长度阈值交替生成孙代粒子,其中孙代粒子的初速度方向垂直于生成孙代粒子的子代粒子的轨迹的切线方向。The length thresholds set on both sides of the descendant particle's trajectory alternately generate grandchildren particles, wherein the initial velocity direction of the grandchildren particles is perpendicular to the tangent direction of the trajectory of the descendant particles that generate the grandchildren particles.
图9为本发明实施例中冰裂纹风格图像的生成装置的一具体实例图,如图9所示,本实施例中图8所示装置还可以包括:FIG. 9 is a diagram of a specific example of an apparatus for generating an ice crack style image in an embodiment of the present invention. As shown in FIG. 9 , the apparatus shown in FIG. 8 in this embodiment may further include:
粒子运动状态确定模块901,用于在粒子系统中粒子运动至生成冰裂纹风格图像的画布边界,或运动至其它粒子的轨迹时,确定粒子结束运动。The particle motion
在一个实施例中,冰裂纹风格图像生成模块804还用于:In one embodiment, the ice crack style
根据粒子系统中所有粒子的轨迹,生成冰裂纹风格图像之前,将生成冰裂纹风格图像的画布背景设置为预设的颜色,或设置为用户输入的图像。According to the trajectories of all particles in the particle system, before generating the ice crack style image, set the background of the canvas for generating the ice crack style image to a preset color, or to the image input by the user.
本发明实施例还提供一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现上述冰裂纹风格图像的生成方法。An embodiment of the present invention further provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, the processor implements the generation of the ice crack style image when the processor executes the computer program method.
本发明实施例还提供一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时实现上述冰裂纹风格图像的生成方法。An embodiment of the present invention further provides a computer-readable storage medium, where the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, implements the above-mentioned method for generating an ice crack style image.
本发明实施例还提供一种计算机程序产品,所述计算机程序产品包括计算机程序,所述计算机程序被处理器执行时实现上述冰裂纹风格图像的生成方法。An embodiment of the present invention further provides a computer program product, where the computer program product includes a computer program, and when the computer program is executed by a processor, implements the above-mentioned method for generating an ice crack style image.
本发明实施例中,初始化粒子系统和粒子系统的受力场;根据粒子系统的受力场,指导粒子系统中的粒子受力运动;根据粒子系统中粒子的运动状态,更新粒子系统中粒子的轨迹;在粒子系统中所有粒子结束运动后,根据粒子系统中所有粒子的轨迹,生成冰裂纹风格图像。本发明实施例通过粒子系统生成冰裂纹风格图像,方法简单且效果显著,使冰裂纹风格图像的生成不再依赖于传统手工工艺,人们可以更加便捷的获取冰裂纹风格图像,专业人士可以使用冰裂纹风格图像进行二次创作,非专业人士可以使用冰裂纹风格图像进行社交娱乐,从而便于冰裂纹风格图像在工业制造、艺术创作、互联网产业等领域得以传播、应用和创新。In the embodiment of the present invention, the particle system and the force field of the particle system are initialized; according to the force field of the particle system, the force movement of the particles in the particle system is guided; Trajectory: After all particles in the particle system have finished moving, generate an ice crack style image based on the trajectory of all particles in the particle system. The embodiment of the present invention generates an ice crack style image through a particle system, the method is simple and the effect is remarkable, so that the generation of the ice crack style image no longer depends on the traditional manual process, people can obtain the ice crack style image more conveniently, and professionals can use the ice crack style image. Crack-style images are used for secondary creation, and non-professionals can use ice-crack-style images for social entertainment, which facilitates the dissemination, application and innovation of ice-crack-style images in industrial manufacturing, artistic creation, and the Internet industry.
本领域内的技术人员应明白,本发明的实施例可提供为方法、系统、或计算机程序产品。因此,本发明可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
本发明是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block in the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to the processor of a general purpose computer, special purpose computer, embedded processor or other programmable data processing device to produce a machine such that the instructions executed by the processor of the computer or other programmable data processing device produce Means for implementing the functions specified in a flow or flow of a flowchart and/or a block or blocks of a block diagram.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory result in an article of manufacture comprising instruction means, the instructions The apparatus implements the functions specified in the flow or flow of the flowcharts and/or the block or blocks of the block diagrams.
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded on a computer or other programmable data processing device to cause a series of operational steps to be performed on the computer or other programmable device to produce a computer-implemented process such that The instructions provide steps for implementing the functions specified in the flow or blocks of the flowcharts and/or the block or blocks of the block diagrams.
以上所述的具体实施例,对本发明的目的、技术方案和有益效果进行了进一步详细说明,所应理解的是,以上所述仅为本发明的具体实施例而已,并不用于限定本发明的保护范围,凡在本发明的精神和原则之内,所做的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。The specific embodiments described above further describe the purpose, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above-mentioned specific embodiments are only specific embodiments of the present invention, and are not intended to limit the scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.
Claims (19)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202210651176.8A CN114972609A (en) | 2022-06-10 | 2022-06-10 | Method and device for generating ice crack style image |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202210651176.8A CN114972609A (en) | 2022-06-10 | 2022-06-10 | Method and device for generating ice crack style image |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN114972609A true CN114972609A (en) | 2022-08-30 |
Family
ID=82961599
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202210651176.8A Pending CN114972609A (en) | 2022-06-10 | 2022-06-10 | Method and device for generating ice crack style image |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN114972609A (en) |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102915552A (en) * | 2012-09-18 | 2013-02-06 | 中国科学院计算技术研究所 | Controllable flame animation generation method and system |
| CN109942228A (en) * | 2019-04-08 | 2019-06-28 | 肇庆爱博新材料科技有限公司 | A kind of preparation method of cracked ice pattern synthetic quartz plate |
| CN110310348A (en) * | 2019-07-09 | 2019-10-08 | 四川三秦电气有限责任公司 | A kind of three-dimensional flame Dynamic Simulation Method based on particIe system |
| US20210241466A1 (en) * | 2018-06-10 | 2021-08-05 | Tsi Incorporated | System and Method for Three Dimensional Particle Imaging Velocimetry and Particle Tracking Velocimetry |
| CN113508002A (en) * | 2018-12-29 | 2021-10-15 | 克利公司 | Laser-assisted method for dividing crystalline material |
-
2022
- 2022-06-10 CN CN202210651176.8A patent/CN114972609A/en active Pending
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102915552A (en) * | 2012-09-18 | 2013-02-06 | 中国科学院计算技术研究所 | Controllable flame animation generation method and system |
| US20210241466A1 (en) * | 2018-06-10 | 2021-08-05 | Tsi Incorporated | System and Method for Three Dimensional Particle Imaging Velocimetry and Particle Tracking Velocimetry |
| CN113508002A (en) * | 2018-12-29 | 2021-10-15 | 克利公司 | Laser-assisted method for dividing crystalline material |
| CN109942228A (en) * | 2019-04-08 | 2019-06-28 | 肇庆爱博新材料科技有限公司 | A kind of preparation method of cracked ice pattern synthetic quartz plate |
| CN110310348A (en) * | 2019-07-09 | 2019-10-08 | 四川三秦电气有限责任公司 | A kind of three-dimensional flame Dynamic Simulation Method based on particIe system |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| Schneider et al. | Has artificial intelligence given us the next great art movement? experts say slow down, the ‘field is in its infancy,’ | |
| Dormans | Level design as model transformation: a strategy for automated content generation | |
| CN114972609A (en) | Method and device for generating ice crack style image | |
| Frelik | " Silhouettes of Strange Illuminated Mannequins": Cyberpunk's Incarnations of Light | |
| US8732102B2 (en) | System and method for using atomic agents to implement modifications | |
| KR20180062901A (en) | rotating and ascending fireball generating method | |
| de Mello et al. | Exploring crowd dynamics: Simulating structured behaviors through crowd simulation models | |
| Allen et al. | Using Sketching to Control Heterogeneous Groups. | |
| Raif et al. | Revision on cartoon character integrate with chess concept for industrial ceramic artware | |
| Gaudl et al. | Learning from play: Facilitating character design through genetic programming and human mimicry | |
| Dorin | Aesthetic selection and the stochastic basis of art, design and interactive evolutionary computation | |
| Nabil et al. | The Study of Motion Illustration Trends of The Tales of Sang Kancil | |
| Watanabe | AItect: Can AI make designs? Architectural intelligence/artificial intelligence | |
| Elkins | Simulating destruction effects in SideFX Houdini | |
| Bailey | Building and Using a Character in 3D Space | |
| Marcos | Digital re-materialisation: towards a post-digital perspective in contemporary art research and practice | |
| Hayes | Starship troopers | |
| Rippingale et al. | Hybrid animation production and the dream of flight | |
| Lioret | Being paintings | |
| Amaya | The Bar | |
| Morris et al. | A modular framework for deformation and fracture using GPU shaders | |
| Maallem et al. | Can Virtual or Digital Creation be Considered as Art or Technique? | |
| Cardoso | Design methodologies to implement computer games (Super Milkman) | |
| Morland | Real-Time Particle Simulation and Motion Capture Interaction | |
| CN119996784A (en) | Video generation method, device, and electronic device |
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 |