CN106503188A - A kind of generation method of particle effect and device - Google Patents
A kind of generation method of particle effect and device Download PDFInfo
- Publication number
- CN106503188A CN106503188A CN201610941564.4A CN201610941564A CN106503188A CN 106503188 A CN106503188 A CN 106503188A CN 201610941564 A CN201610941564 A CN 201610941564A CN 106503188 A CN106503188 A CN 106503188A
- Authority
- CN
- China
- Prior art keywords
- particle
- emission layer
- class
- particle emission
- emitter
- 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
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/957—Browsing optimisation, e.g. caching or content distillation
- G06F16/9577—Optimising the visualization of content, e.g. distillation of HTML documents
Landscapes
- Engineering & Computer Science (AREA)
- Databases & Information Systems (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Processing Or Creating Images (AREA)
Abstract
The invention discloses a kind of generation method of particle effect and device, in order to realize the purpose of the animation effect for more dazzling cruel in terminal.Methods described includes:First obtained in operating system specifies class, specifies class to create particle emission layer using described first;One or more particle cells are created in the particle emission layer;Second obtained in the operating system specifies class, specifies the respective particle property of one or more of particle cells that class setting is created using described second;Based on the particle emission layer and the respective particle property of one or more of particle cells, corresponding particle effect is generated.
Description
Technical field
The present invention relates to technical field of internet application, more particularly to a kind of generation method of particle effect and device.
Background technology
With the development of Internet technology, the information that people can be obtained from the Internet is increasingly enriched, due to animation
Can present give people to enrich, interesting picture and content, increasing people like seeing animation on the net.Dynamic in the Internet
Draw and present to user, such as flash animation in a variety of forms, flash can include simple animation, video content, answer
Miscellaneous PowerPoint or application program etc..However, with the development of terminal technology, how to create in terminal and more dazzle cruel animation
Effect becomes problem demanding prompt solution.
Content of the invention
The present invention provides a kind of generation method of particle effect and device, in order to realize more dazzling cruel animation in terminal
The purpose of effect.
The present invention provides a kind of generation method of particle effect, including:
First obtained in operating system specifies class, specifies class to create particle emission layer using described first;
One or more particle cells are created in the particle emission layer;
Obtain in the operating system second specify class, using described second specify class arrange create one or
The respective particle property of multiple particle cells;
Based on the particle emission layer and the respective particle property of one or more of particle cells, generate corresponding
Particle effect.
In an embodiment of the present invention, described first class is specified for CAEmitterLayer classes.
In an embodiment of the present invention, described second class is specified for CAEmitterCell classes.
In an embodiment of the present invention, after specifying class to create particle emission layer using described first, methods described is also
Including:
The particle emission layer for creating is added in target view.
In an embodiment of the present invention, class is specified to create particle emission layer using described first, including:
Class is specified to define the attribute of particle emission layer using described first, to create the particle emission layer.
In an embodiment of the present invention, the attribute of the particle emission layer includes at least one following:
Emitter in the particle emission layer is in the center of x/y plane;
Emitter in the particle emission layer is in the position of z-plane;
The size of the emitter in the particle emission layer;
The depth of the emitter in the particle emission layer;
The shape of the emitter in the particle emission layer.
The present invention also provides a kind of generating means of particle effect, including:
First creation module, specifies class for obtaining in operating system first, specifies class to create grain using described first
Sub- emission layer;
Second creation module, for creating one or more particle cells in the particle emission layer;
3rd creation module, specifies class for obtaining in the operating system second, specifies class to set using described second
Put the respective particle property of one or more of particle cells of establishment;
Generation module, for based on the particle emission layer and the respective particle category of one or more of particle cells
Property, generate corresponding particle effect.
In an embodiment of the present invention, described first class is specified for CAEmitterLayer classes.
In an embodiment of the present invention, described second class is specified for CAEmitterCell classes.
In an embodiment of the present invention, described device also includes:
Add module, after specifying class to create particle emission layer in first creation module using described first,
The particle emission layer for creating is added in target view.
In an embodiment of the present invention, first creation module is additionally operable to:
Class is specified to define the attribute of particle emission layer using described first, to create the particle emission layer.
In an embodiment of the present invention, the attribute of the particle emission layer includes at least one following:
Emitter in the particle emission layer is in the center of x/y plane;
Emitter in the particle emission layer is in the position of z-plane;
The size of the emitter in the particle emission layer;
The depth of the emitter in the particle emission layer;
The shape of the emitter in the particle emission layer.
In embodiments of the present invention, first obtained in operating system specifies class, specifies class to create grain using described first
Sub- emission layer;One or more particle cells are created in the particle emission layer;Obtain the second finger in the operating system
Determine class, the respective particle property of one or more of particle cells that class setting is created is specified using described second;Based on institute
Particle emission layer and the respective particle property of one or more of particle cells is stated, corresponding particle effect is generated.Thus
It can be seen that, the embodiment of the present invention can realize the purpose of the animation effect for more dazzling cruel in terminal.
Other features and advantages of the present invention will be illustrated in the following description, also, partly be become from description
Obtain it is clear that or being understood by implementing the present invention.The purpose of the present invention and other advantages can pass through in the explanation that is write
In book, claims and accompanying drawing, specifically noted structure is realizing and obtain.
Below by drawings and Examples, technical scheme is described in further detail.
Description of the drawings
Accompanying drawing is used for providing a further understanding of the present invention, and constitutes a part for description, the reality with the present invention
Applying example is used for explaining the present invention together, is not construed as limiting the invention.In the accompanying drawings:
The flow chart that Fig. 1 show the generation method of particle effect in one embodiment of the invention;
The flow chart that Fig. 2 show the generation method of particle effect in another embodiment of the present invention;
Fig. 3 show the structural representation of the generating means of particle effect in one embodiment of the invention;And
Fig. 4 show the structural representation of the generating means of particle effect in another embodiment of the present invention.
Specific embodiment
The preferred embodiments of the present invention are illustrated below in conjunction with accompanying drawing, it will be appreciated that preferred reality described herein
Apply example to be merely to illustrate and explain the present invention, be not intended to limit the present invention.
The flow chart of the generation method of particle effect in one embodiment of the invention is illustrated in figure 1, the method can be applied
In the terminals such as computer, smart mobile phone, the method may comprise steps of S11-S14.
Step S11, first obtained in operating system specify class, specify class to create particle emission layer using first.
In this step, the first specified class can be CAEmitterLayer classes.In the alternative embodiment of the present invention,
When specifying class to create particle emission layer using first, class can will be specified to define the attribute of particle emission layer using first, to create
Build particle emission layer.Here, the attribute of particle emission layer can be including the emitter in particle emission layer at the center of x/y plane
The size of emitter of the emitter in position, particle emission layer in the position of z-plane, particle emission layer, particle are sent out
Shape of emitter in the depth of the emitter that penetrates in layer, particle emission layer etc., the invention is not restricted to this.
Further, after specifying class to create particle emission layer using first, the particle emission layer of establishment can be added
It is added in target view.
Step S12, creates one or more particle cells in particle emission layer.
In this step, if particle effect to be generated is the effect of flame, then two particle cells can be created, one
Particle cell is used for generating smog, and another particle cell is used for generating flare.
Step S13, second obtained in operating system specify class, specify class to arrange the one or more of establishment using second
The respective particle property of particle cell.
In this step, the second specified class can be CAEmitterCell classes.Here particle property can include particle
Establishment speed, the movement velocity of particle, the scaling size of particle, the rotation position of particle, the life span of particle, particle
The launch angle in x/y plane of launch angle, particle of life span tolerance, particle in z-axis direction, the appearance of particle emission angle
Difference, color of particle etc., the invention is not restricted to this.
Step S14, based on particle emission layer and the respective particle property of one or more particle cells, generates corresponding
Particle effect.
In embodiments of the present invention, first obtained in operating system specifies class, specifies class to create grain using described first
Sub- emission layer;One or more particle cells are created in the particle emission layer;Obtain the second finger in the operating system
Determine class, the respective particle property of one or more of particle cells that class setting is created is specified using described second;Based on institute
Particle emission layer and the respective particle property of one or more of particle cells is stated, corresponding particle effect is generated.Thus
It can be seen that, the embodiment of the present invention can realize the purpose of the animation effect for more dazzling cruel in terminal.
The generation method that the particle effect of the present invention is discussed in detail below by a specific embodiment realizes process.Such as
The flow chart that Fig. 2 show the generation method of particle effect in another embodiment of the present invention, the method can be applied in computer, intelligence
In the terminals such as energy mobile phone, the method may comprise steps of S21-S26.
Step S21, first obtained in the operating system of terminal specify class.
In this step, the first specified class can be CAEmitterLayer classes.
Step S22, specifies class to define the attribute of particle emission layer using first, to create particle emission layer.
In this step, the attribute of particle emission layer can be including the emitter in particle emission layer at the center of x/y plane
The size of emitter of the emitter in position, particle emission layer in the position of z-plane, particle emission layer, particle are sent out
Shape of emitter in the depth of the emitter that penetrates in layer, particle emission layer etc., the invention is not restricted to this.
Step S23, the particle emission layer of establishment is added in target view.
Step S24, creates one or more particle cells in particle emission layer.
In this step, if particle effect to be generated is the effect of flame, then two particle cells can be created, one
Particle cell is used for generating smog, and another particle cell is used for generating flare.
Step S25, second obtained in operating system specify class, specify class to arrange the one or more of establishment using second
The respective particle property of particle cell.
In this step, the second specified class can be CAEmitterCell classes.Here particle property can include particle
Establishment speed, the movement velocity of particle, the scaling size of particle, the rotation position of particle, the life span of particle, particle
The launch angle in x/y plane of launch angle, particle of life span tolerance, particle in z-axis direction, the appearance of particle emission angle
Difference, color of particle etc., the invention is not restricted to this.
Step S26, based on particle emission layer and the respective particle property of one or more particle cells, generates corresponding
Particle effect.
Above step S21-S26 can be realized by code below:
// specify class to define the attribute of particle emission layer using first, to create particle emission layer
CAEmitterLayer*emitter=[CAEmitterLayer new];
Emitter.bounds=self.bounds;
Emitter.position=self.center;
[self.layer addSublayer:emitter];// the particle emission layer of establishment is added in target view
Emitter.emitterShape=kCAEmitterLayerRectangle;
Emitter.emitterPosition=
CGPointMake(self.bounds.size.width/2,self.bounds.size.height/2);
Emitter.emitterSize=self.bounds.size;
// the respective particle property of one or more particle cells that class setting is created is specified using second
CAEmitterCell*emitterCell=[CAEmitterCell new];
EmitterCell.contents=[UIImage imageNamed:@"snowflake1"];
EmitterCell.birthRate=80;
EmitterCell.lifetime=3.5;
Emitter.emitterCells=@[emitterCell];
EmitterCell.yAcceleration=70.0;
EmitterCell.xAcceleration=10.0;
EmitterCell.velocity=20.0;
EmitterCell.emissionLongitude=-M_PI;
EmitterCell.velocityRange=200.0;
EmitterCell.emissionRange=M_PI_2;
EmitterCell.color=[UIColor colorWithRed:0.9green:1.0blue:1.0alpha:
1.0].CGColor.
The embodiment of the present invention can realize the purpose of the animation effect for more dazzling cruel in terminal.
It should be noted that in actual applications, above-mentioned all optional embodiments can be any in the way of adopting and combine
Combination, forms the alternative embodiment of the present invention, and this is no longer going to repeat them.
Corresponding to the generation method of the particle effect in above-described embodiment, the present invention also provides a kind of generation of particle effect
Device.The structural representation of the generating means of particle effect in one embodiment of the invention is illustrated in figure 3, including:
First creation module 31, specifies class for obtaining in operating system first, specifies class to create using described first
Particle emission layer;
Second creation module 32, for creating one or more particle cells in the particle emission layer;
3rd creation module 33, specifies class for obtaining in the operating system second, specifies class using described second
The respective particle property of the one or more of particle cells for creating is set;
Generation module 34, for based on the particle emission layer and the respective particle of one or more of particle cells
Attribute, generates corresponding particle effect.
In an embodiment of the present invention, described first class is specified for CAEmitterLayer classes.
In an embodiment of the present invention, described second class is specified for CAEmitterCell classes.
In an embodiment of the present invention, as shown in figure 4, the device that figure 3 above shows can also include:
Add module 41, for first creation module 31 using described first specify class create particle emission layer it
Afterwards, the particle emission layer for creating is added in target view.
In an embodiment of the present invention, first creation module 31 is additionally operable to:
Class is specified to define the attribute of particle emission layer using described first, to create the particle emission layer.
In an embodiment of the present invention, the attribute of the particle emission layer includes at least one following:
Emitter in the particle emission layer is in the center of x/y plane;
Emitter in the particle emission layer is in the position of z-plane;
The size of the emitter in the particle emission layer;
The depth of the emitter in the particle emission layer;
The shape of the emitter in the particle emission layer.
The said apparatus of the embodiment of the present invention:First obtained in operating system specifies class, specifies class using described first
Create particle emission layer;One or more particle cells are created in the particle emission layer;Obtain in the operating system
Second specifies class, specifies the respective particle property of one or more of particle cells that class setting is created using described second;
Based on the particle emission layer and the respective particle property of one or more of particle cells, corresponding particle effect is generated
Really.As can be seen here, the embodiment of the present invention can realize the purpose of the animation effect for more dazzling cruel in terminal.
Those skilled in the art are it should be appreciated that embodiments of the invention can be provided as method, system or computer program
Product.Therefore, the present invention can adopt complete hardware embodiment, complete software embodiment or with reference to software and hardware in terms of reality
Apply the form of example.And, the present invention can be adopted in one or more computers for wherein including computer usable program code
The shape of the upper computer program that implements of usable storage medium (including but not limited to disk memory and optical memory etc.)
Formula.
The present invention is the flow process with reference to method according to embodiments of the present invention, equipment (system) and computer program
Figure and/or block diagram are describing.It should be understood that can be by computer program instructions flowchart and/or each stream in block diagram
Journey and/or the combination of square frame and flow chart and/or the flow process in block diagram and/or square frame.These computer programs can be provided
Instruct the processor of general purpose computer, special-purpose computer, Embedded Processor or other programmable data processing devices to produce
A raw machine so that produced for reality by the instruction of computer or the computing device of other programmable data processing devices
The device of the function of specifying in present one flow process of flow chart or one square frame of multiple flow processs and/or block diagram or multiple square frames.
These computer program instructions may be alternatively stored in and can guide computer or other programmable data processing devices with spy
Determine in the computer-readable memory that mode works so that the instruction being stored in the computer-readable memory is produced to be included referring to
Make the manufacture of device, the command device realize in one flow process of flow chart or one square frame of multiple flow processs and/or block diagram or
The function of specifying in multiple square frames.
These computer program instructions can be also loaded in computer or other programmable data processing devices so that in meter
Series of operation steps is executed on calculation machine or other programmable devices to produce computer implemented process, so as in computer or
The instruction executed on other programmable devices is provided for realization in one flow process of flow chart or multiple flow processs and/or block diagram one
The step of function of specifying in individual square frame or multiple square frames.
Obviously, those skilled in the art can carry out the essence of various changes and modification without deviating from the present invention to the present invention
God and scope.So, if these modifications of the present invention and modification belong to the scope of the claims in the present invention and its equivalent technologies
Within, then the present invention is also intended to comprising these changes and modification.
Claims (10)
1. a kind of generation method of particle effect, it is characterised in that include:
First obtained in operating system specifies class, specifies class to create particle emission layer using described first;
One or more particle cells are created in the particle emission layer;
Second obtained in the operating system specifies class, specifies class to arrange the one or more of of establishment using described second
The respective particle property of particle cell;
Based on the particle emission layer and the respective particle property of one or more of particle cells, corresponding particle is generated
Effect.
2. method according to claim 1, it is characterised in that described first to specify class be CAEmitterLayer classes.
3. method according to claim 1 and 2, it is characterised in that described second to specify class be CAEmitterCell classes.
4. method according to claim 1 and 2, it is characterised in that specifying class to create particle emission using described first
After layer, methods described also includes:
The particle emission layer for creating is added in target view.
5. method according to claim 1 and 2, it is characterised in that specify class to create particle emission layer using described first,
Including:
Class is specified to define the attribute of particle emission layer using described first, to create the particle emission layer.
6. method according to claim 5, it is characterised in that the attribute of the particle emission layer include following at least it
One:
Emitter in the particle emission layer is in the center of x/y plane;
Emitter in the particle emission layer is in the position of z-plane;
The size of the emitter in the particle emission layer;
The depth of the emitter in the particle emission layer;
The shape of the emitter in the particle emission layer.
7. a kind of generating means of particle effect, it is characterised in that include:
First creation module, specifies class for obtaining in operating system first, specifies class to create particle using described first and sends out
Penetrate layer;
Second creation module, for creating one or more particle cells in the particle emission layer;
3rd creation module, specifies class for obtaining in the operating system second, specifies class to arrange wound using described second
The respective particle property of one or more of particle cells for building;
Generation module, for being based on the particle emission layer and the respective particle property of one or more of particle cells,
Generate corresponding particle effect.
8. device according to claim 7, it is characterised in that described first to specify class be CAEmitterLayer classes.
9. the device according to claim 7 or 8, it is characterised in that described second to specify class be CAEmitterCell classes.
10. the device according to claim 7 or 8, it is characterised in that also include:
Add module, after specifying class to create particle emission layer in first creation module using described first, will wound
The particle emission layer that builds is added in target view.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610941564.4A CN106503188A (en) | 2016-10-25 | 2016-10-25 | A kind of generation method of particle effect and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610941564.4A CN106503188A (en) | 2016-10-25 | 2016-10-25 | A kind of generation method of particle effect and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN106503188A true CN106503188A (en) | 2017-03-15 |
Family
ID=58321070
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610941564.4A Pending CN106503188A (en) | 2016-10-25 | 2016-10-25 | A kind of generation method of particle effect and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106503188A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108933895A (en) * | 2018-07-27 | 2018-12-04 | 北京微播视界科技有限公司 | Three dimensional particles special efficacy generation method, device and electronic equipment |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103455323A (en) * | 2013-07-05 | 2013-12-18 | 新奥特(北京)视频技术有限公司 | Implementation method and device of particle effects |
CN104850389A (en) * | 2014-02-14 | 2015-08-19 | 腾讯科技(深圳)有限公司 | Method and apparatus for implementing dynamic interface |
CN105975273A (en) * | 2016-05-04 | 2016-09-28 | 腾讯科技(深圳)有限公司 | Particle animation realization method and system as well as purification process display method and system for optimization tool |
-
2016
- 2016-10-25 CN CN201610941564.4A patent/CN106503188A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103455323A (en) * | 2013-07-05 | 2013-12-18 | 新奥特(北京)视频技术有限公司 | Implementation method and device of particle effects |
CN104850389A (en) * | 2014-02-14 | 2015-08-19 | 腾讯科技(深圳)有限公司 | Method and apparatus for implementing dynamic interface |
CN105975273A (en) * | 2016-05-04 | 2016-09-28 | 腾讯科技(深圳)有限公司 | Particle animation realization method and system as well as purification process display method and system for optimization tool |
Non-Patent Citations (2)
Title |
---|
刘媛媛: "《Xamarin iOS移动开发实战》", 31 May 2015, 北京:清华大学出版社 * |
张益珲: "《iOS开发实战 从零基础到App Store上架》", 31 July 2016, 北京:清华大学出版社 * |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108933895A (en) * | 2018-07-27 | 2018-12-04 | 北京微播视界科技有限公司 | Three dimensional particles special efficacy generation method, device and electronic equipment |
US11412159B2 (en) | 2018-07-27 | 2022-08-09 | Beijing Microlive Vision Technology Co., Ltd | Method and apparatus for generating three-dimensional particle effect, and electronic device |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP7475423B2 (en) | Synchronized speech generation from video | |
WO2017050004A1 (en) | Animation management method and system thereof | |
KR101323148B1 (en) | Ucr contents editor device | |
CN106502573A (en) | A kind of method and device of view interface movement | |
CN102800045A (en) | Image processing method and device | |
CN109242934A (en) | A kind of generation method and equipment of animation code | |
US10013788B2 (en) | Method and system for generating crowd animation and computer-readable recording medium | |
CN101436312A (en) | Method and apparatus for generating video cartoon | |
CN111246301A (en) | Video playing method and device, electronic equipment and computer readable storage medium | |
CN104731855A (en) | Method and device for displaying image resources of WeChat friend circle | |
CN110750659B (en) | Dynamic display method, device and storage medium for media resources | |
CN104615347A (en) | Method and device for achieving virtual and real picture synchronization | |
CN106503188A (en) | A kind of generation method of particle effect and device | |
CN106504305A (en) | A kind of animation processing method and device | |
US20230364505A1 (en) | Processing for vibration generation | |
Choi et al. | New promotional video technique utilizing augmented reality and popcode | |
CN103870124A (en) | Information processing method and electronic equipment | |
CN109799975B (en) | Action game making method and system based on neural network | |
CN106503117A (en) | A kind of animated show method and device | |
CN103295181B (en) | A kind of stacking method and device of particle file and video | |
CN113453048A (en) | Audio and video tactile feedback setting method, audio and video playing method and computer equipment | |
US20190086997A1 (en) | System and method for providing stimulation to a user's senses | |
CN104965910A (en) | Method and apparatus for dynamically displaying social network member information | |
Vate-U-Lan | Augmented reality 3D pop-up book: An educational research study | |
CN104506332A (en) | Sign-in method and device for group members based on social network application platform |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20170315 |