CN1773516A - Water ink transmission model based on Chinese brush and xuan paper and emulation algorithm - Google Patents
Water ink transmission model based on Chinese brush and xuan paper and emulation algorithm Download PDFInfo
- Publication number
- CN1773516A CN1773516A CN 200510115184 CN200510115184A CN1773516A CN 1773516 A CN1773516 A CN 1773516A CN 200510115184 CN200510115184 CN 200510115184 CN 200510115184 A CN200510115184 A CN 200510115184A CN 1773516 A CN1773516 A CN 1773516A
- Authority
- CN
- China
- Prior art keywords
- ink
- diffusion
- water
- fiber
- writing brush
- 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
Links
- XLYOFNOQVPJJNP-UHFFFAOYSA-N water Substances O XLYOFNOQVPJJNP-UHFFFAOYSA-N 0.000 title claims abstract description 97
- 230000005540 biological transmission Effects 0.000 title claims abstract description 38
- 238000004422 calculation algorithm Methods 0.000 title claims abstract description 13
- 239000000835 fiber Substances 0.000 claims abstract description 122
- 235000007164 Oryza sativa Nutrition 0.000 claims abstract description 56
- 235000009566 rice Nutrition 0.000 claims abstract description 56
- 241000209094 Oryza Species 0.000 claims abstract description 44
- 238000009792 diffusion process Methods 0.000 claims description 114
- 238000009826 distribution Methods 0.000 claims description 43
- 238000000151 deposition Methods 0.000 claims description 30
- 230000008021 deposition Effects 0.000 claims description 30
- 230000000694 effects Effects 0.000 claims description 28
- 239000002245 particle Substances 0.000 claims description 25
- 238000000034 method Methods 0.000 claims description 21
- 239000011159 matrix material Substances 0.000 claims description 15
- 230000008569 process Effects 0.000 claims description 13
- 238000010276 construction Methods 0.000 claims description 8
- 230000008859 change Effects 0.000 claims description 4
- 230000007423 decrease Effects 0.000 claims description 4
- 230000005855 radiation Effects 0.000 claims description 4
- 238000001704 evaporation Methods 0.000 claims description 3
- 230000008020 evaporation Effects 0.000 claims description 3
- 238000011069 regeneration method Methods 0.000 claims description 3
- 241001593805 Lichenaula lambda Species 0.000 claims description 2
- 230000002457 bidirectional effect Effects 0.000 claims description 2
- 239000000969 carrier Substances 0.000 claims description 2
- 238000006243 chemical reaction Methods 0.000 claims description 2
- 230000003247 decreasing effect Effects 0.000 claims description 2
- JEGUKCSWCFPDGT-UHFFFAOYSA-N h2o hydrate Chemical compound O.O JEGUKCSWCFPDGT-UHFFFAOYSA-N 0.000 claims description 2
- 230000001788 irregular Effects 0.000 claims description 2
- 238000005070 sampling Methods 0.000 claims description 2
- 206010010071 Coma Diseases 0.000 abstract 2
- 239000000976 ink Substances 0.000 description 134
- 239000010410 layer Substances 0.000 description 22
- 238000010422 painting Methods 0.000 description 16
- 238000004088 simulation Methods 0.000 description 10
- 238000012546 transfer Methods 0.000 description 7
- 238000010586 diagram Methods 0.000 description 6
- 238000010521 absorption reaction Methods 0.000 description 5
- 238000005094 computer simulation Methods 0.000 description 5
- 230000002452 interceptive effect Effects 0.000 description 5
- 238000013461 design Methods 0.000 description 4
- 238000005516 engineering process Methods 0.000 description 3
- 238000009877 rendering Methods 0.000 description 3
- 238000011160 research Methods 0.000 description 3
- 238000013507 mapping Methods 0.000 description 2
- 239000000463 material Substances 0.000 description 2
- 230000007246 mechanism Effects 0.000 description 2
- 239000000123 paper Substances 0.000 description 2
- 230000001413 cellular effect Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000007598 dipping method Methods 0.000 description 1
- 238000009432 framing Methods 0.000 description 1
- 238000001764 infiltration Methods 0.000 description 1
- 230000008595 infiltration Effects 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 238000004806 packaging method and process Methods 0.000 description 1
- 230000008092 positive effect Effects 0.000 description 1
- 230000001376 precipitating effect Effects 0.000 description 1
- 238000001556 precipitation Methods 0.000 description 1
- 230000001681 protective effect Effects 0.000 description 1
- 230000008439 repair process Effects 0.000 description 1
- 230000007480 spreading Effects 0.000 description 1
- 238000003892 spreading Methods 0.000 description 1
- 239000002344 surface layer Substances 0.000 description 1
Images
Landscapes
- Processing Or Creating Images (AREA)
- Toys (AREA)
Abstract
An ink and water color transmission model based on brush pen and rice paper consists of brush pen model and rice paper model on computer. It is featured as using fleece structure as rice paper model, forming said structure by coma connected by fiber bundle, utilizing coma as container and carrier of ink and water color and using fiber bundle as guide tube to transmit ink and water color. Its artificial algorithm includes ink and water color transmission on virtual brush pen and on virtual rice paper as well as ink and water color transmission between virtual brush pen and virtual rice paper on computer.
Description
[ technical field ]: the invention relates to the technical field of computer art simulation, in particular to a computer simulation method for simulating the transmission of rice paper and ink and water and ink, which realizes the special art effect of ink and water paintings by carrying out computer simulation on the painting mechanism of Chinese ink and water paintings.
[ background Art ] A method of: with the rapid development of computer graphics and non-photorealistic rendering technologies, computer simulation of Chinese ink-wash painting art is also becoming the focus of research. The pen, ink, paper and inkstone are four treasures of the Chinese ink painting, namely four basic painting tools and materials, wherein the pen and the paper are two main materials showing the artistic effect of the Chinese ink painting, and the special effects of diffusion, infiltration, pen marks and the like generated by the pen and the paper form the main form difference between the Chinese painting and the western painting and also form the unique artistic charm of the Chinese painting. Therefore, in the computer simulation of the traditional Chinese painting art, in addition to the simulation of the writing brush, another important technical point is the computer simulation of the ink transfer model, which is further divided into the ink transfer models (diffusion, precipitation, evaporation, etc.) on the writing brush, between the writing brush and the paper and on the paper. The research of the ink and water transmission model is combined with the realization of the writing brush simulation, so that a complete interactive Chinese painting simulation drawing system can be realized, and the system has higher practical application value in the fields of process packaging design, advertisement design, image recognition design, book framing, character design, movie and television manufacturing, digital art creation, even the protective repair research and copy reproduction of ancient precious ink and water paintings and the like.
The study on ink-wash painting simulation is not a few, but the ink-wash painting on the writing brush and the ink transfer between the pen and the paper are rarely directly processed, and an empirical model (such as texture mapping) is more adopted to draw the pen path. The texture mapping method has limited artistic effects and unreal and unnatural simulation effects due to lack of flexibility. The diffusion algorithm is the most important part of the ink transport model on paper, and more technology is related to it, such as particle systems, local equilibrium models (PDEs), Lattice Boltzmann Equalization (LBE), etc. However, since diffusion is not separated from the paper, a paper model must be constructed in order to produce a natural and realistic diffusion effect. The technology of the paper model is typically divided into three layers of a surface layer, an absorption layer and a deposition layer according to functions, but because the rice paper is not simulated from a physical fiber structure, the final simulation effect of the diffusion algorithm is not ideal because the diffusion algorithm lacks randomness.
[ summary of the invention ]: the invention aims to solve the problems of stiff and unnatural pen path, poor flexibility and lack of expressive force in the simulation drawing of the existing computer, provides a Chinese art paper model-based ink and water transmission model, simulates various typical brush pen paths and embodies natural and real simulation diffusion effect; and the stroke track drawing simultaneously meets the real-time requirement of interactive drawing.
The invention provides a Chinese brush and rice paper-based ink and water transmission model and a simulation algorithm, which are divided into three parts: the transmission of ink on virtual writing brush, the exchange of ink between virtual writing brush and virtual rice paper and the transmission of ink in virtual rice paper specifically include:
first, the establishment of the rice paper model
This rice paper model adopts three layer construction, does in proper order: contact layer-responsible for ink exchange with the writing brush; diffusion layer-finishing the operations of diffusion, deposition and evaporation of moisture of the ink in the paper; deposit layer-save the deposited ink information and map it finally to the screen;
each layer of rice paper model is a simulated fiber mesh structure and consists of fiber clusters connected by fiber bundles, wherein the fiber clusters are containers and carriers of ink, and the fiber bundles are conduits for conveying the ink; wherein,
the construction rule of the rice paper model fiber web is as follows:
a) the fiber distribution is subject to global consistency and local randomness, wherein the global consistency means that the fiber quantity contained in each pixel area on the plane is consistent when viewed from the whole rice paper plane, the consistency means that the fiber quantity of each pixel is taken as a random quantity, the random quantities have the same mean value and are subject to normal distribution, and the local randomness means that the fiber distribution in each pixel area is completely random, and the rule is the key for simulating the irregular distribution of the rice paper fiber structure;
b) the number, the length and the direction of the fiber bundles are subject to normal distribution;
c) the algorithm for generating the normal distribution random number is as follows: we use a common random number generation method: "transform sampling method", basic flow:
proc NRand (in u, in diff out result)// u is mean, diff is variance
r1←Rand()
r2←Rand()
result ← u + diff × C// is the random number sought
End Proc
The rice paper fiber web construction algorithm:
each web needs to be computationally generated at initialization and subject to a "globally consistent, locally random" fiber distribution, the construction steps are as follows:
first, fiber distribution on a "cell matrix": dividing each pixel into n × n cells, and making the refined paper plane matrix be "cell matrix" and using the density parameter D × G of rice paperMAXIs a mean value of, wherein GMAXGenerating a random number N following normal distribution for the maximum number of fiber pointsgAs the amount of fibers to be distributed to each pixel region, N is randomly distributed in each pixel regiongA "fiber dot"
Ng=NRand(D*GMAXDiff), diff is a constant
Step two, combining the fiber clusters: combining adjacent fiber points into a fiber cluster according to the distribution of the fiber points on the cell matrix;
thirdly, distributing fiber bundles on the cell matrix: for each "cell" position, according to the user-specified mean value D x FMAXGenerating a normal random number N from the sum variance difffRegeneration of NfFiber bundle F with root length and direction conforming to normal distributionxy(1,α):
Nf=NRand(D*FMAXDiff), diff is a constant
Step four, connecting the fiber clusters: calculating the fiber clusters passed by each fiber bundle, and connecting the fiber bundles to form the rice paper with a simulated fiber net structure;
second, initial distribution of ink on virtual brush pen
Virtual 3D brush pen model
The writing brush model comprises a skeleton and a surface, wherein the skeleton consists of a backbone and an auxiliary surface, the backbone is positioned on the central axis of the skeleton, n nodes are distributed on the backbone, the nodes are called as key nodes in the model, the distance between every two adjacent key nodes is an arithmetic series, and the tolerance d is l.lambda (n2-n), where l is the brush length and λ is the adjustment factor; the auxiliary surface is centered on the key nodes and perpendicular to the central axisThe auxiliary surface is provided with m/2 axial lines passing through the center of the auxiliary surface, the included angles of the adjacent axial lines are equal, and the end points of the axial lines are called as auxiliary nodes in the model; the brush model simulates the change of the initial radius of the auxiliary surface by using a parabola, and adds a surface on the model framework to complete the establishment of the brush geometric model;
initializing ink distribution
Every time Ink is dipped, the user gives the Ink particle number Ink on the key point of the brush pen frameworkcenterTaking one section of the writing brush model, namely an auxiliary surface, under the condition that the writing brush model is vertical, storing ink information on a key node of a writing brush skeleton, and calculating the number of ink particles of other parts of the writing brush section by taking the number of ink particles of the key node as the ink amount of all points of the auxiliary surface or adopting two ink diffusion modes of radiation type diffusion and vector type diffusion: the radial diffusion, i.e. the ink color at the center point decreases outwards by a certain step (the minimum value is 0), and the diffusion formula is as follows:
Inkradio=Inkcenter*(1-Rstep*D)
d is the distance between the target point and the central point, RstepIs a factor of variation
Vector (directional) type diffusion, i.e., the ink color at the center point decreases (increases in the negative direction) in steps along the direction at an angle θ to the x + axis, the diffusion formula is as follows:
Inkvector=Inkcenter*(1-Vstep*D)
d represents the connecting line of the target point and the key point on the auxiliary surface, VstepIs a factor of variation
Projection length in diffusion direction (may be negative)
The final ink distribution is a weighted sum of the two diffusion modes:
Inkdest=Inkradio*WR+Inkvector*WV
WRand WVWeights for radiation distribution and vector distribution, respectively
Second, exchange of ink between pen and paper
Firstly, calculating the handwriting of the writing brush, namely the contact area between the pen and the paper, taking a key node of the pen as a center, when the section is intersected with the paper, the intersection part of the section and the paper is a straight line, defining the intersection line as a handwriting element, defining two end points of the handwriting element as an upper auxiliary point and a lower auxiliary point respectively, defining the projection of the key node on the intersection line as a projection center point, and storing ink information on the handwriting through the projection center point. The whole handwriting consists of a plurality of handwriting elements, and the ink and water distribution of the whole handwriting is determined by the ink and water information of the projection center point of each handwriting element;
when the virtual writing brush collides with the rice paper, namely the virtual writing brush contacts with the rice paper, ink and water exchange can be carried out between the writing brush and the paper fiber group in the handwriting area, the exchange is bidirectional, the transmission direction of the ink and water can be judged by calculating the ink and water information of the corresponding contact surface of the section of the writing brush and the paper at the moment of contact, and the ink and water on the writing brush and the paper need to be redistributed after the exchange is finished;
redistribution of ink on a writing brush
For the writing brush, the ink variation amplitude of each part is obtained by calculating the distance between each part on the writing brush and the contact surface of the writing brush and paper and the ink loss or the obtained maximum value, and the effect of uniform ink variation on the whole writing brush is further obtained;
if the 'original handwriting' of the writing brush in contact with the paper is S, the ink information of a certain key node/auxiliary point p on the writing brush, which is not on the original handwriting, is expressed by a formula:
Inkp’=Inkp-(1-Dp(S)/Dmax)*Inktran_avg*k
wherein Inkp' is the number of ink particles of the pen after transmission, Inkp is the number of ink particles before transmission, Dp (S) is the average distance from a point p to S, Dmax is the maximum distance from a key node on the writing brush to S, Inktran _ avg is the average number of ink particles transmitted from the writing brush to the original handwriting, k is used for controlling the influence range on the writing brush when ink on a certain position on the writing brush is changed, the value of k is 0-1, and the smaller the k is, the smaller the influence range is;
similarly, for the transmission of the water on the writing brush, the formula is as follows:
Waterp’=Waterp-(1-Dp(S)/Dmax)*Watertran_avg*k’
because the ink and water transmission on the rice paper is easier than that on the writing brush, k' is larger than k;
third, the transmission of the ink and wash in the rice paper
The transmission of the ink and water between the rice paper is divided into: diffusion, deposition, water volatilization and ink superposition;
diffusion: diffusion is realized in a paper model, the diffusion direction and the diffusion magnitude are determined by comparing the ink concentration of each fiber mass in the diffusion layer, and the diffusion is realized as a chain reaction process (see figure 9) by the transmission of fiber bundles, and the specific steps of the diffusion process are as follows:
● calculating the diffusion condition, and setting the Ink viscosity and water viscosity of the virtual rice paper as Ink _ Stick and
water _ Stick, where the Ink particle number and the Water particle number of the fiber aggregate are Ink and Water, diffusion occurs
The conditions are as follows:
ink > Ink _ Stick and Water > Water _ Stick
A mass of fibers satisfying the above conditions is called a "motile" mass of fibers;
● for each "live" fiber mass, its average cellular Water content, Water _ Avg, and average
Ink content Ink _ Avg;
● for the fiber mass, the average water content of the cells of each adjacent fiber mass is calculated
Water _ Avg 'and average Ink content Ink _ Avg', which are related to the corresponding value of the center fiber cluster
For comparison, when:
(r) Water _ Avg > Water _ Avg' or
Water _ Avg < Water _ Avg 'but Ink _ Avg > Ink _ Avg'
When the ink is dispersed, the ink is transferred from the central fiber cluster to the adjacent fiber clusters, and the amount of the ink is transferred
The following formula determines:
water delivery amount ═ (Water-Water')/(Fibre _ Avg +1)
Ink transport amount ═ (Ink-Ink')/(Fibre _ Avg +1)
Wherein Water and Water' denote Water particles of the central and adjacent fiber clusters, respectively
Numbers, Ink and Ink' denote the number of Ink particles of the central fiber cluster and the adjacent fiber clusters, respectively,
fibre Avg represents the number of Fibre bundles connected on average per Fibre mass in the paper model, in this case
The simultaneous transfer of ink under (i) is called "running water transfer", and in case (ii) only ink transfer is called "running water transfer
For "kinetic ink transport";
the diffusion adopts a continuous model, namely the diffusion runs through the whole drawing process, once the diffusion starts (generally from the drawing of the first pen path), the diffusion is continuously carried out until the concentration of the ink among all fiber groups reaches the balance (see figure 10), the process of reaching the balance is completely determined by the ink information on the diffusion layer of the rice paper, the process of drawing the pen path by a user is irrelevant, the diffusion and the receiving user pen path are divided into two independent threads, the shared data of the two threads is the ink information of the diffusion layer, and the ink information on the diffusion layer can be continuously changed when the user draws a new pen path, so that the intermediate value of the diffusion is changed, and various effects are obtained;
deposition: the ink deposition between the virtual rice paper has two modes, one mode is that after the writing brush is contacted with the paper and the handwriting of the writing brush is formed on the contact layer, the deposition from the handwriting to the deposition layer is carried out, and the deposition amount is based on the ink information of the handwriting formed on the contact layer and the preset deposition proportion; the second kind of deposition occurs in the diffusion process, the deposition is carried out from the diffusion layer to the deposition layer, the deposition continuously occurs along with the continuous progress of the diffusion, and the deposition amount depends on the ink information on the diffusion layer;
1) volatilization of water: the volatilization of the water also occurs in the diffusion layer, and the water on the diffusion layer is volatilized continuously in a certain proportion until the ink is dried along with the lapse of time;
2) ink and water superposition: a continuous diffusion model is adopted, so that superposition and diffusion are unified; the superposition actually changes the ink amount of the diffusion layer which is not diffused, and the superposition effect and the ink diffusion effect are finally realized by the diffusion process which continuously changes the initial value;
fourthly, drawing of pen path
The drawing of the pen path needs to meet the real-time requirement, and when the pen path needs to be drawn, the program loads ink information deposited on a deposition layer and displays the ink information on a screen by loading the ink information as OpenGL textures or GDI bitmaps; since the diffusion is continuously performed, the next stroke to be displayed is actually the previous stroke which is continuously diffused, or a new stroke is added at the same time to form an overlapping effect.
The invention has the advantages and positive effects that: 1. the controllability is better, a user can control the ink dipping process by controlling the initial distribution of the ink on the virtual writing brush, so that various ink color change effects can be drawn; the user can control the structural parameters of the virtual rice paper to achieve the purpose of simulating various rice paper effects, such as density D (see figure 12), wherein the higher the density is, the denser the rice paper fibers are, and the finer the ink diffusion effect is; conversely, the rougher the diffusion effect. The user can also control the diffusion degree by controlling the water absorption capacity of the rice paper (see figure 13), and the larger the water absorption capacity is, the larger the diffusion degree is; conversely, the smaller the degree of diffusion. 2. The simulated pen path has a more natural and vivid diffusion effect due to the use of the physical paper model. 3. The drawing process is more dynamic and intuitive, the ink and water transmission mechanism in the invention is controllable, the whole process of drawing and diffusing the stroke channel is visible, and the diffusion of the stroke channel is performed step by step along with the drawing process of a user, as shown in fig. 11 and 14. 4. The method has higher real-time performance, and the algorithm adopted in the invention also ensures the real-time performance required by interactive rendering on the premise of ensuring the vivid effect.
[ description of drawings ]:
FIG. 1 is a flow chart of an interactive stroke track drawing;
FIG. 2 is a schematic diagram of a skeleton in a 3D virtual brush model;
FIG. 3 is a schematic cross-sectional view of a writing brush;
FIG. 4 is a schematic illustration of key dot ink color diffusion;
FIG. 5 is a schematic view of a three-ply paper model;
FIG. 6 is a schematic view of a web structure of a paper pattern;
FIG. 7 is a schematic diagram of fiber mass generation;
FIG. 8 is a schematic view of a connecting fiber mass;
FIG. 9 is a schematic view of a diffusion step;
FIG. 10 is a schematic view of a continuous diffusion process;
FIG. 11 is a diagram of a handwriting step-by-step rendering process;
FIG. 12 is a schematic diagram of handwriting diffusion effects on different rice papers (different densities);
FIG. 13 is a schematic diagram of the handwriting diffusion effect on different rice paper (different water absorption);
FIG. 14 is a schematic diagram of a process of drawing a pen track.
[ embodiments ] of the present invention:
example 1:
the ink and water transmission model is combined with any existing three-dimensional brush pen model to form a complete interactive ink and water painting simulation drawing system. When a user operates an input device (such as a mouse) to enable the writing brush model to be in contact with the paper model, the ink and water transmission process starts, the diffusion process starts, and the brush path of the writing brush gradually diffuses and forms as time passes. The implementation is illustrated here by way of example (as shown in fig. 1 and 14):
first, fiber distribution on a "cell matrix": each pixel is further divided into n multiplied by n (system default n is 4) cells, the refined paper plane matrix is called as a cell matrix, and the density parameter D G of the rice paper is used as the density parameterMAXIs a mean value of, wherein GMAXGenerating a random number N following normal distribution for the maximum number of fiber pointsgE.g. NgAs the amount of fibers to be distributed per pixel region, 9, N is randomly distributed in each pixel regiongSee FIG. 7 for "fiber points".
Ng=NRand(D*GMAXDiff), diff is a constant
Step two, combining the fiber clusters: combining adjacent fiber points into a fiber cluster according to the distribution of the fiber points on the cell matrix;
thirdly, distributing fiber bundles on the cell matrix: for each "cell" position, according to the user-specified mean value D x FMAXGenerating a normal random number N from the sum variance difffRegeneration of NfFiber bundle F with root length and direction conforming to normal distributionxy(l,α):
Nf=NRand(D*FMAXDiff), diff is a constant
Step four, connecting the fiber clusters: calculating the fiber clusters passed by each fiber bundle, and connecting the fiber bundles by the fiber bundles, as shown in figure 8, to form the rice paper with a simulated fiber net structure, as shown in figure 6;
d, F in initial valueMAX、GMAXAnd diff are respectively taken as initial values:
D=0.4 GMAX=16 FMAX=4.0 Diff=1.0
fig. 8 is a schematic representation of the connecting fiber mass.
Virtual 3D brush pen model
As shown in fig. 2 and 3, the writing brush model includes a skeleton and a surface, the skeleton is composed of a spine 4 and an auxiliary surface 3, the spine is located on a central axis of the skeleton, n (for example, 20) key nodes 1 are distributed on the spine in an equal difference mode, and a tolerance d is l · λ/(n) ° k ═ n2-n), where l is the brush length (system default is 10.0), λ is the adjustment factor (system default is 2.0); the auxiliary surface takes the key nodes as the center, the auxiliary surface is vertical to the central axis, m/2 (such as 4) axial lines passing through the center of the auxiliary surface are arranged on the auxiliary surface, included angles of adjacent axial lines are equal, and end points of the axial lines are called as auxiliary nodes 2 in the model; the brush model simulates the change of the initial radius of the auxiliary surface by using a parabola, and adds a surface on the model framework to complete the establishment of the brush geometric model;
initializing ink distribution
1) The user firstly dips Ink, namely, the Ink amount Ink on the key node of the brush pen framework is setcenter110.0. Set up such that
Using the Ink amount of the key point as the Ink amount Ink of all the pointsdest=Inkcenter。
Radial diffusion, i.e. the ink color at the center point is decreased outward by a certain step (minimum value is 0), as shown in fig. 4(a), the first step diffusion:
Inkradio=Inkcenter*(1-Rstep*D)=110*(1-0.3*0.5)=93.5
vector (directional) type diffusion, i.e., the ink color at the center point decreases (increases in the negative direction) in a direction at an angle θ to the x + axis in steps, as shown in fig. 4(b), the first step diffusion:
Inkvector=Inkcenter*(1-Vstep*D)=110*(1-0.2*0.5)=99
the final ink distribution is a weighted sum of these two diffusion modes, as shown in FIG. 4 (c):
Inkdest=Inkradio*WR+Inkvector*WV=93.5*0.6+99*0.4=95.7
redistribution of ink on a writing brush
If the 'original handwriting' of the writing brush in contact with the paper is S, the ink information of a certain key node/auxiliary point p on the writing brush, which is not on the original handwriting, is expressed by a formula:
Inkp”=Inkp-(1-Dp(S)/Dmax)*Inktran_avg*k
wherein Inkp' is ink information of a pen after transmission, Inkp is the number of ink particles before transmission, Dp (S) is the average distance from a point p to S, Dmax is the maximum distance from a key node on the writing brush to S, Inktran _ avg is the average ink value transmitted from the writing brush to original handwriting, k is used for controlling the influence range on the writing brush when ink and water on a certain position on the writing brush are changed, the value of k is 0-1, and the smaller the k is, the smaller the influence range is;
similarly, for the transmission of the water on the writing brush, the formula is as follows:
Waterp’=Waterp-(1-Dp(S)/Dmax)*Watertran_avg*k’
k' should be greater than k; in the model, k and k' are 0.1 and 0.8 respectively.
2) The user sets paper parameters: the density parameter D is 0.5, and the water absorption parameter A is 0.6. And generating virtual rice paper. As shown in fig. 5, wherein: 7 contact layer, 8 diffusion layer and 9 deposition layer. Also shown in fig. 6 is the web structure of the paper pattern. FIGS. 12 and 13 show the different effects of paper models of different parameters
3) And (3) moving the three-dimensional writing brush model by the user, calculating handwriting, transferring ink on the pen to paper, redistributing the ink on the pen, and diffusing, volatilizing and precipitating the ink on the paper. Therefore, the handwriting of the writing brush can be seen to be gradually spread, and even after the user stops writing, the continuous spreading of the pen path under the driving of the redundant water can be seen. The effect is shown in fig. 7, in which fig. 9 shows a diffusion step, and fig. 10 shows a continuous diffusion flow.
Claims (1)
1. A water and ink transmission model and a simulation algorithm based on a writing brush and rice paper are characterized in that the water and ink transmission model is divided into three parts: the transmission of ink on virtual writing brush, the exchange of ink between virtual writing brush and virtual rice paper and the transmission of ink in virtual rice paper specifically include:
first, the establishment of the rice paper model
This rice paper model adopts three layer construction, does in proper order: contact layer-responsible for ink exchange with the writing brush; diffusion layer-finishing the operations of diffusion, deposition and evaporation of moisture of the ink in the paper; deposit layer-save the deposited ink information and map it finally to the screen;
each layer of rice paper model is a simulated fiber mesh structure and consists of fiber clusters connected by fiber bundles, wherein the fiber clusters are containers and carriers of ink, and the fiber bundles are conduits for conveying the ink; wherein,
the construction rule of the rice paper model fiber web is as follows:
a) the fiber distribution is subject to global consistency and local randomness, wherein the global consistency means that the fiber quantity contained in each pixel area on the plane is consistent when viewed from the whole rice paper plane, the consistency means that the fiber quantity of each pixel is taken as a random quantity, the random quantities have the same mean value and are subject to normal distribution, and the local randomness means that the fiber distribution in each pixel area is completely random, and the rule is the key for simulating the irregular distribution of the rice paper fiber structure;
b) the number, the length and the direction of the fiber bundles are subject to normal distribution;
c) the algorithm for generating the normal distribution random number is as follows: we use a common random number generation method: "transform sampling method", basic flow:
proc NRand (in u, in diff, out result)// u is mean, diff is variance
r1←Rand()
r2←Rand()
result ← u + diff × C// is the random number sought
End Proc
The rice paper fiber web construction algorithm:
each web needs to be computationally generated at initialization and subject to a "globally consistent, locally random" fiber distribution, the construction steps are as follows:
first, fiber distribution on a "cell matrix": dividing each pixel into n × n cells, and making the refined paper plane matrix be "cell matrix" and using the density parameter D × G of rice paperMAXIs a mean value of, wherein GMAXGenerating a random number N following normal distribution for the maximum number of fiber pointsgAs the amount of fibers to be distributed to each pixel region, N is randomly distributed in each pixel regiongA "fiber dot"
Ng=NRand(D*GMAXDiff), diff is a constant
Step two, combining the fiber clusters: combining adjacent fiber points into a fiber cluster according to the distribution of the fiber points on the cell matrix;
thirdly, distributing fiber bundles on the cell matrix: for each "cell" position, according to the user-specified mean value D x FMAXGenerating a normal random number N from the sum variance difffRegeneration of NfFiber bundle F with root length and direction conforming to normal distributionxy(1,α):
Nf=NRand(D*FMAXDiff), diff is a constant
Step four, connecting the fiber clusters: calculating the fiber clusters passed by each fiber bundle, and connecting the fiber bundles to form the rice paper with a simulated fiber net structure;
second, initial distribution of ink on virtual brush pen
Virtual 3D brush pen model
The writing brush model comprises a skeleton and a surface, wherein the skeleton consists of a spine and an auxiliary surface, the spine is positioned on the central axis of the skeleton, n nodes are distributed on the spine, the nodes are called as key nodes in the model, the distance between every two adjacent key nodes is an arithmetic series, and the tolerance d is l.lambda/(n) with the tolerance d2-n), where l is the brush length and λ is the adjustment factor; the auxiliary surface is centered on the key nodes and perpendicular to the central axis, and has m/2 axial lines passing through its center, the adjacent axial lines have equal included angles, and the end points of these axial lines are called auxiliary nodes in the modelPoint; the brush model simulates the change of the initial radius of the auxiliary surface by using a parabola, and adds a surface on the model framework to complete the establishment of the brush geometric model;
initializing ink distribution
The quantity of the water ink is expressed by adopting a particle number, namely the quantity of water is expressed by the water particle number, and the quantity of the ink is expressed by the ink particle number;
every time Ink is dipped, the user gives the Ink particle number Ink on the key point of the brush pen frameworkcenterTaking one section of the writing brush model, namely an auxiliary surface, under the condition that the writing brush model is vertical, storing ink information on a key node of a writing brush skeleton, and calculating the number of ink particles of other parts of the writing brush section by taking the number of ink particles of the key node as the ink amount of all points of the auxiliary surface or adopting two ink diffusion modes of radiation type diffusion and vector type diffusion: the radial diffusion is that the ink color at the central point is decreased outwards by a certain step length, the minimum value is 0, and the diffusion formula is as follows:
Inkradio=Inkcenter*(1-Rstep*D)
d is the distance between the target point and the central point, RstepIs a factor of variation
Vector type diffusion, i.e., the ink color at the center point decreases in steps in the direction at an angle θ to the x + axis, or increases in the negative direction, the diffusion formula is as follows:
Inkvector=Inkcenter*(1-Vstep*D)
d represents the connecting line of the target point and the key point on the auxiliary surface, VstepIs a factor of variation
Projection length in diffusion direction (may be negative)
The final ink distribution is a weighted sum of the two diffusion modes:
Inkdest=Inkradio*WR+Inkvector*WV
WRand WVWeights for radiation distribution and vector distribution, respectively
Thirdly, the exchange of ink and wash between the pen and the paper
Firstly, calculating the handwriting of the writing brush, namely the contact area between the pen and the paper, taking a key node of the pen as a center, when the auxiliary surface is intersected with the paper, the intersection part of the section and the paper is a straight line, defining the intersection line as a handwriting element, defining two end points of the handwriting element as an upper auxiliary point and a lower auxiliary point respectively, defining the projection of the key node on the intersection line as a projection center point, and storing ink information on the handwriting through the projection center point; the whole handwriting consists of a plurality of handwriting elements, and the ink and water distribution of the whole handwriting is determined by the ink and water information of the projection center point of each handwriting element;
when the virtual writing brush collides with the rice paper, namely the virtual writing brush contacts with the rice paper, ink and water exchange can be carried out between the writing brush and the paper fiber group in the handwriting area, the exchange is bidirectional, the transmission direction of the ink and water can be judged by calculating the ink and water information of the corresponding contact surface of the section of the writing brush and the paper at the moment of contact, and the ink and water on the writing brush and the paper need to be redistributed after the exchange is finished;
redistribution of ink on a writing brush
For the writing brush, the ink variation amplitude of each part is obtained by calculating the distance between each part on the writing brush and the contact surface of the writing brush and paper and the ink loss or the obtained maximum value, and the effect of uniform ink variation on the whole writing brush is further obtained;
if the 'original handwriting' of the writing brush in contact with the paper is S, the ink information of a certain key node/auxiliary point p on the writing brush, which is not on the original handwriting, is expressed by a formula:
Inkp’=Inkp-(1-Dp(S)/Dmax)*Inktran_avg*k
wherein Inkp' is the number of ink particles of the pen after transmission, Inkp is the number of ink particles before transmission, Dp (S) is the average distance from a point p to S, Dmax is the maximum distance from a key node on the writing brush to S, Inktran _ avg is the average number of ink particles transmitted from the writing brush to the original handwriting, k is used for controlling the influence range on the writing brush when ink on a certain position on the writing brush is changed, the value of k is 0-1, and the smaller the k is, the smaller the influence range is;
similarly, for the transmission of the water on the writing brush, the formula is as follows:
Waterp’=Waterp-(1-Dp(S)/Dmax)*Watertran_avg*k’
k' should be greater than k;
fourth, the transmission of the ink and wash in the rice paper
The transmission of the ink and water between the rice paper is divided into: diffusion, deposition, water volatilization and ink superposition;
diffusion: diffusion is realized in a paper model, the diffusion direction and the diffusion magnitude are determined by comparing the ink concentration of each fiber mass in the diffusion layer, and the diffusion is realized as a chain reaction process (see figure 9) by the transmission of fiber bundles, and the specific steps of the diffusion process are as follows:
●, calculating diffusion conditions, wherein the Ink viscosity and the Water viscosity of the virtual rice paper are Ink _ Stick and Water _ Stick respectively, and the Ink particle number and the Water particle number of the fiber mass are Ink and Water, the diffusion conditions are as follows:
ink > Ink _ Stick and Water > Water _ Stick
A mass of fibers satisfying the above conditions is called a "motile" mass of fibers;
● calculating for each "live" fiber mass its average Water content of cells, Water _ Avg and average Ink content Ink _ Avg;
● for this fiber mass, the average Water content Water _ Avg 'and the average Ink content Ink _ Avg' of the cells of each of its adjacent fiber masses were calculated and compared with the corresponding values for the central fiber mass when:
(r) Water _ Avg > Water _ Avg' or
(vii) Water _ Avg < Water _ Avg 'but Ink _ Avg > Ink _ Avg', diffusion occurs, delivering Ink from the central cluster to its neighboring clusters, the amount of delivery being determined by the following equation:
water delivery amount ═ (Water-Water')/(Fibre _ Avg +1)
Ink transport amount ═ (Ink-Ink')/(Fibre _ Avg +1)
Wherein, Water and Water 'respectively represent the Water particle numbers of a central fiber cluster and an adjacent fiber cluster, Ink and Ink' respectively represent the Ink particle numbers of the central fiber cluster and the adjacent fiber cluster, Fibre _ Avg represents the average connected fiber bundle number of each fiber cluster in the paper model, Water and Ink are simultaneously transmitted under the condition of (i) being called 'dynamic Water transmission', and only Ink is transmitted under the condition of (ii) being called 'dynamic Ink transmission';
the diffusion adopts a continuous model, namely the diffusion runs through the whole drawing process, once the diffusion starts (generally from the drawing of the first pen path), the diffusion is continuously carried out until the concentration of the ink among all fiber groups reaches the balance (see figure 10), the process of reaching the balance is completely determined by the ink information on the diffusion layer of the rice paper, the process of drawing the pen path by a user is irrelevant, the diffusion and the receiving user pen path are divided into two independent threads, the shared data of the two threads is the ink information of the diffusion layer, and the ink information on the diffusion layer can be continuously changed when the user draws a new pen path, so that the intermediate value of the diffusion is changed, and various effects are obtained;
deposition: the ink deposition between the virtual rice paper has two modes, one mode is that after the writing brush is contacted with the paper and the handwriting of the writing brush is formed on the contact layer, the deposition from the handwriting to the deposition layer is carried out, and the deposition amount is based on the ink information of the handwriting formed on the contact layer and the preset deposition proportion; the second kind of deposition occurs in the diffusion process, the deposition is carried out from the diffusion layer to the deposition layer, the deposition continuously occurs along with the continuous progress of the diffusion, and the deposition amount depends on the ink information on the diffusion layer;
1) volatilization of water: the volatilization of the water also occurs in the diffusion layer, and the water on the diffusion layer is volatilized continuously in a certain proportion until the ink is dried along with the lapse of time;
2) ink and water superposition: a continuous diffusion model is adopted, so that superposition and diffusion are unified; the superposition actually changes the ink amount of the diffusion layer which is not diffused, and the superposition effect and the ink diffusion effect are finally realized by the diffusion process which continuously changes the initial value;
fifth, drawing of pen path
The drawing of the pen path needs to meet the real-time requirement, and when the pen path needs to be drawn, the program loads ink information deposited on a deposition layer and displays the ink information on a screen through a bitmap loaded as an OpenGL texture or a GDI; since the diffusion is continuously performed, the next stroke to be displayed is actually the previous stroke which is continuously diffused, or a new stroke is added at the same time to form an overlapping effect.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CNB2005101151847A CN100338612C (en) | 2005-07-08 | 2005-11-15 | Water ink transmission model based on Chinese brush and xuan paper and emulation algorithm |
Applications Claiming Priority (3)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN200510014446 | 2005-07-08 | ||
CN200510014446.0 | 2005-07-08 | ||
CNB2005101151847A CN100338612C (en) | 2005-07-08 | 2005-11-15 | Water ink transmission model based on Chinese brush and xuan paper and emulation algorithm |
Publications (2)
Publication Number | Publication Date |
---|---|
CN1773516A true CN1773516A (en) | 2006-05-17 |
CN100338612C CN100338612C (en) | 2007-09-19 |
Family
ID=36760479
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CNB2005101151847A Expired - Fee Related CN100338612C (en) | 2005-07-08 | 2005-11-15 | Water ink transmission model based on Chinese brush and xuan paper and emulation algorithm |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN100338612C (en) |
Cited By (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102254333A (en) * | 2011-07-25 | 2011-11-23 | 浙江大学 | Image-based method for generating ink painting style image |
CN101377854B (en) * | 2008-10-07 | 2012-01-04 | 浙江大学 | Method for simulating Chinese characters hand-written handwriting by a computer |
CN102436348A (en) * | 2011-11-14 | 2012-05-02 | 中国科学院合肥物质科学研究院 | Writing brush calligraphy expressing method based on force information |
CN102831292A (en) * | 2012-07-09 | 2012-12-19 | 大连理工大学 | Method for calculating virtual ink diffusion range based on force feedback technology |
CN102831291A (en) * | 2012-07-09 | 2012-12-19 | 大连理工大学 | Calculation method of ink concentration of light color diffusion area in virtual drawing |
CN102939575A (en) * | 2010-06-14 | 2013-02-20 | 微软公司 | Ink rendering |
CN103345773A (en) * | 2013-06-20 | 2013-10-09 | 大连理工大学 | Writing brush modeling method based on force feedback technology |
CN103412969A (en) * | 2013-04-27 | 2013-11-27 | 天津大学 | Method for utilizing computer to stimulate hand painted weaving painted patterns |
CN103440380A (en) * | 2013-08-27 | 2013-12-11 | 西安邮电大学 | Three-layer paper model building method based on surface roughness |
CN104240176A (en) * | 2014-09-19 | 2014-12-24 | 中国科学院合肥物质科学研究院 | Ink expression method for digital paper with fiber network structure |
CN105631916A (en) * | 2014-11-25 | 2016-06-01 | 奥多比公司 | Paintbrush and liquid simulation |
CN111639263A (en) * | 2020-06-03 | 2020-09-08 | 小红书科技有限公司 | Note recommendation method, device and system |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2001086513A2 (en) * | 2000-05-11 | 2001-11-15 | Quickturn Design Systems, Inc. | Emulation circuit with a hold time algorithm, logic analyzer and shadow memory |
CN1584907A (en) * | 2003-08-20 | 2005-02-23 | 英业达股份有限公司 | Artificial game system and method for combining geographic information |
-
2005
- 2005-11-15 CN CNB2005101151847A patent/CN100338612C/en not_active Expired - Fee Related
Cited By (22)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101377854B (en) * | 2008-10-07 | 2012-01-04 | 浙江大学 | Method for simulating Chinese characters hand-written handwriting by a computer |
CN102939575A (en) * | 2010-06-14 | 2013-02-20 | 微软公司 | Ink rendering |
CN102939575B (en) * | 2010-06-14 | 2016-05-18 | 微软技术许可有限责任公司 | Ink presents |
CN102254333B (en) * | 2011-07-25 | 2012-11-14 | 浙江大学 | Image-based method for generating ink painting style image |
CN102254333A (en) * | 2011-07-25 | 2011-11-23 | 浙江大学 | Image-based method for generating ink painting style image |
CN102436348A (en) * | 2011-11-14 | 2012-05-02 | 中国科学院合肥物质科学研究院 | Writing brush calligraphy expressing method based on force information |
CN102831292B (en) * | 2012-07-09 | 2015-01-07 | 大连理工大学 | Method for calculating virtual ink diffusion range based on force feedback technology |
CN102831292A (en) * | 2012-07-09 | 2012-12-19 | 大连理工大学 | Method for calculating virtual ink diffusion range based on force feedback technology |
CN102831291A (en) * | 2012-07-09 | 2012-12-19 | 大连理工大学 | Calculation method of ink concentration of light color diffusion area in virtual drawing |
CN102831291B (en) * | 2012-07-09 | 2015-04-29 | 大连理工大学 | Calculation method of ink concentration of light color diffusion area in virtual drawing |
CN103412969B (en) * | 2013-04-27 | 2016-03-09 | 天津大学 | Freehandhand-drawing is weaved cotton cloth the computer simulation method of decalcomania |
CN103412969A (en) * | 2013-04-27 | 2013-11-27 | 天津大学 | Method for utilizing computer to stimulate hand painted weaving painted patterns |
CN103345773B (en) * | 2013-06-20 | 2015-11-18 | 大连理工大学 | A kind of writing brush modeling method based on force feedback technique |
CN103345773A (en) * | 2013-06-20 | 2013-10-09 | 大连理工大学 | Writing brush modeling method based on force feedback technology |
CN103440380A (en) * | 2013-08-27 | 2013-12-11 | 西安邮电大学 | Three-layer paper model building method based on surface roughness |
CN103440380B (en) * | 2013-08-27 | 2016-02-24 | 西安邮电大学 | Three-ply paper based on surfaceness opens model modelling approach |
CN104240176A (en) * | 2014-09-19 | 2014-12-24 | 中国科学院合肥物质科学研究院 | Ink expression method for digital paper with fiber network structure |
CN104240176B (en) * | 2014-09-19 | 2017-07-21 | 中国科学院合肥物质科学研究院 | A kind of ink expression of the digital paper with fibrillar meshwork structure |
CN105631916A (en) * | 2014-11-25 | 2016-06-01 | 奥多比公司 | Paintbrush and liquid simulation |
CN105631916B (en) * | 2014-11-25 | 2020-12-04 | 奥多比公司 | Brush and liquid simulation |
CN111639263A (en) * | 2020-06-03 | 2020-09-08 | 小红书科技有限公司 | Note recommendation method, device and system |
CN111639263B (en) * | 2020-06-03 | 2023-11-24 | 小红书科技有限公司 | Note recommending method, device and system |
Also Published As
Publication number | Publication date |
---|---|
CN100338612C (en) | 2007-09-19 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN100338612C (en) | Water ink transmission model based on Chinese brush and xuan paper and emulation algorithm | |
Sousa et al. | Computer‐generated graphite pencil rendering of 3D polygonal models | |
CN101051390A (en) | Method and system for simulating river | |
Kazi et al. | Vignette: interactive texture design and manipulation with freeform gestures for pen-and-ink illustration | |
US8207966B2 (en) | Terrain editor tool for rule-based procedural terrain generation | |
CN1647034A (en) | Systems and methods for implementing shader-driven compilation of rendering assets | |
CN1967596A (en) | Triangulation construction method of three-dimensional scattered point set in three-dimensional scanning system | |
US11961174B2 (en) | Programmatically configuring materials | |
CN1926558A (en) | System and method for applying accurate three-dimensional volume textures to arbitrary triangulated surfaces | |
KR20070049115A (en) | Resource management for rule-based procedural terrain generation | |
EP1763846A2 (en) | Rule-based procedural terrain generation | |
Way et al. | Physical-based model of ink diffusion in Chinese paintings | |
CN1267859C (en) | Method for drawing picture on two-dimensional screen | |
Loi et al. | Programmable 2d arrangements for element texture design | |
Eroglu et al. | Fluid sketching―Immersive sketching based on fluid flow | |
CN1299244C (en) | System and method for building three-dimentional scene dynamic model and real-time simulation | |
Battiato et al. | A Survey of Digital Mosaic Techniques. | |
CN103793549A (en) | Computer-aided random stitch embroidery producing method adopting fuzzy clustering and random walk | |
CN102306389B (en) | Method for realizing embossment effect of animation character and background of mobile phone | |
CN1932757A (en) | Core 1 DRAW software teaching technological plan | |
CN110349266A (en) | Sequence in tessellation operation | |
Geng | The algorithms and principles of non-photorealistic graphics: artistic rendering and cartoon animation | |
CN1870052A (en) | Three-D Chinese brush model and emulation method based on pressure pen device | |
Guo | Generating realistic calligraphy words | |
CN1695169A (en) | A unified surface model for image based and geometric scene comprosition |
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 | ||
C19 | Lapse of patent right due to non-payment of the annual fee | ||
CF01 | Termination of patent right due to non-payment of annual fee |