characteristics of spr<strong>in</strong>g as bend<strong>in</strong>g rather than stretch<strong>in</strong>gthe spr<strong>in</strong>g. <strong>Brush</strong> is made of animal hair, while hav<strong>in</strong>g theflexibility, but it is still hard, and will not change with theforce and length changes, but change the shape byextrusion, there will be trends <strong>in</strong> restitution. Therefore, thespr<strong>in</strong>g bend<strong>in</strong>g simulation is used for hair brush pen.Spr<strong>in</strong>g bend<strong>in</strong>g formula:F = k× ( θ − θ )(13)0dt −1dtΔ θt+1= ( I − H× ) × Ft× (14)M MB. <strong>Brush</strong> geometry characteristic behaviorThe hairy brushes, used <strong>in</strong> Ch<strong>in</strong>ese pa<strong>in</strong>t<strong>in</strong>g andcalligraphy, are made from hair of animals, such as horse,deer, and rabbit. Accord<strong>in</strong>g to the k<strong>in</strong>ds of hair, they aregenerally classified <strong>in</strong>to three ma<strong>in</strong> types: hard, soft andcomb<strong>in</strong>ation, each of which has different stiffness andabsorbent. The bristles have different length; shorter onesare <strong>in</strong>side and longer ones are outside. The brush forms as<strong>in</strong>gle tuft and run <strong>in</strong>to a f<strong>in</strong>e tip when it is moisten. Wewill emulate the brush <strong>in</strong> moisten state, not <strong>in</strong> the dry state.A brush is elastic. It bends when some external forceapplied to it and restore to its orig<strong>in</strong>al shape when theforce is released. Emulat<strong>in</strong>g this deformation <strong>in</strong> real timeis a tough problem. To make problem simpler, we modelthe brush with a simple skeleton and compute thedeformation of this skeleton and apply it to the wholebrush [16], as shown <strong>in</strong> Figure 1. Our emulation <strong>in</strong>cludestwo parts: brush geometry and brush dynamic.position of the root sp<strong>in</strong>e node, p, from tablet device. Thealgorithm is as follows [5]:a) Calculate the distance between the new position andold position of the root sp<strong>in</strong>e node, let O 0 =p, where p isthe new position.b) Determ<strong>in</strong>e if there is any sp<strong>in</strong>e nodes penetrate thepaper. If yes, set m<strong>in</strong>imization constra<strong>in</strong>ts of these sp<strong>in</strong>enodes to be above the paper.c) Solv<strong>in</strong>g the energy m<strong>in</strong>imization problem to get θ iand update the new position of sp<strong>in</strong>e nodes.Figure 2. <strong>Brush</strong> dynamic transformationThe energy function is used to demonstrate thedeformation of the brush when there is a force applied onit. Applied the m<strong>in</strong>imum pr<strong>in</strong>ciple of <strong>in</strong>crementalpotential energy [17], we can predict the shape ofdeformed brush. The <strong>in</strong>cremental potential energy termshere account for stra<strong>in</strong> energy and friction force. At eachtime frame, the program update the brush state throughthe deformation of brush skeleton which satisfy<strong>in</strong>g allconstra<strong>in</strong>ts.Figure 1. <strong>Brush</strong> elementary geometry modelC. <strong>Brush</strong> dynamicOur brush model has to be bended when it touch thepaper with a given applied force and return to normal statewhen the force release. This <strong>in</strong>cludes conservative anddissipative forces, and can be referred as <strong>in</strong>crementalpotential energy. To model the brush dynamic, we useenergy m<strong>in</strong>imization method to def<strong>in</strong>e the deformed stateof the brush tuft at a certa<strong>in</strong> time frame. With a certa<strong>in</strong>applied force, we formulate an energy m<strong>in</strong>imizationfunction with Newtonian physics, then solv<strong>in</strong>g thisconstra<strong>in</strong>ts optimization problem and updat<strong>in</strong>g the state ofbrush.First, we will describe the algorithm for brush dynamicproblem <strong>in</strong> Figure 2. Then we will present energym<strong>in</strong>imization problem. Let O i (i = 0, 1,… , 6) is theposition of sp<strong>in</strong>e nodes, θ i is the angle between the i-thsegment and the previous segment. We can get the newIV. IMPLEMENTATION AND EVALUATIONWe have rendered the brush model us<strong>in</strong>g OpenGLbound with Visual C++ <strong>in</strong> general purpose PC platformwith an Intel dual core 2.4GHz CPU and 1GB RAM.The system architecture <strong>in</strong>cludes three phases: <strong>in</strong>putdata, emulation of the brush, expert system, stroke andbackground environment render<strong>in</strong>g. The system providesa convenient user <strong>in</strong>terface and service for <strong>in</strong>telligentdecisions, has full knowledge base and provide.With coord<strong>in</strong>ates of sp<strong>in</strong>e nodes at a certa<strong>in</strong> time frame,we can use OpenGL to render the brush model andbackground environment. In the first module, we <strong>in</strong>put thestroke trajectories which can be done with a digitiz<strong>in</strong>g penor a mouse to start the calligraphy system.To obta<strong>in</strong> footpr<strong>in</strong>t, we let a part of the brush surface<strong>in</strong>tersect the paper plane, and calculate the orthogonalprojection of the penetration. We only need to calculatethe penetration of ellipse cross sections which <strong>in</strong>tersect thepaper l<strong>in</strong>e. After gett<strong>in</strong>g all cross po<strong>in</strong>ts, we will have thefootpr<strong>in</strong>t of the brush. In the second module, therelationships among all strokes are determ<strong>in</strong>ed. F<strong>in</strong>ally,when each stroke is allocated with a specific stroke type,as shown <strong>in</strong> figure 3.187
Figure 3. <strong>Simulation</strong> resultV. CONCLUSION AND FUTURE WORKSWe have presented a model for 3D hairy brushemulation. This <strong>in</strong>teractive model can real time deformsthe shape of brush tuft when there is a force applied on,based on constra<strong>in</strong>ed energy m<strong>in</strong>imization function.However, the ma<strong>in</strong> feature of calligraphy system is the<strong>in</strong>tegration of computer graphics and knowledgeeng<strong>in</strong>eer<strong>in</strong>g. With computer graphics, the graphicalbehavior of calligraphy can be presented <strong>in</strong> the virtualworld. With knowledge eng<strong>in</strong>eer<strong>in</strong>g, the aestheticcalligraphic characters can be generated <strong>in</strong>telligently. Wecomb<strong>in</strong>e these two different fields <strong>in</strong> computer science toachieve better results.EFERENCES[1] Bendu Bai, Kam-Wah Wong and Yann<strong>in</strong>g Zhang, “AnEfficient Physically-Based <strong>Model</strong> for Ch<strong>in</strong>ese <strong>Brush</strong>”, LectureNotes <strong>in</strong> Computer Science 4613, 2007, pp. 261-270.[2] Porch KC, Fellner WD, “The circle-brush algorithm.”,ACM Transactions on Graphics, Vol. 8, No. 1, pp. 1-24,January 1989.[3] Strassmann S, “<strong>Hairy</strong> brushes”, Computer Graphics, Vol.20, pp. 225-232, August 1986.[4] Horace H S Ip, Helena T F Wong, “Calligraphic charactersynthesis us<strong>in</strong>g a brush model”, Proceed<strong>in</strong>gs of ComputerGraphics International 1997, pp. 13-21.[5] Nelson S.-H. Chu, Chiew-Lan Tai, “An efficient brushmodel for physically-based 3D pa<strong>in</strong>gt<strong>in</strong>g”, Proceed<strong>in</strong>gs of the10 th Pacific Conference on CG&A,pp. 413-418, 2002.[6] Yang His-M<strong>in</strong>g, Lu Ja<strong>in</strong>n-Jyh, Lee His-Jian, “A Beziercurve-based approach to shape description for Ch<strong>in</strong>esecalligraphy characters”, International conference on documentanalysis and recognition, pp. 276-280, 2001.[7] Wei Li, Ichiro Hagiwara, Takao Yasui, Hu-awei Chen, “Amethod of generat<strong>in</strong>g scratched look calligraphy charactersus<strong>in</strong>g mathematical morphology”, Joural of computational andapplied mathematics, pp. 85-90, 2003.[8] Mi Xiaofeng, Xu Jie, Tang M<strong>in</strong>, Dong J<strong>in</strong>xiang, “Thedroplet virtual brush for Ch<strong>in</strong>ese calligraphic charactermodel<strong>in</strong>g”, Proceed<strong>in</strong>gs of the sixth IEEE workshop onapplications of computer vision, pp. 330-334, 2002.[9] S. Strassmann, “<strong>Hairy</strong> <strong>Brush</strong>es”, SIGGRAPH 1986Proceed<strong>in</strong>g, 20(4), pp. 225-232, August 1986.[10] H. T. F. Wong and H. H. S. Ip., “Virtual brush: a model -based synthesis of Ch<strong>in</strong>ese calligraphy”, Computer and Graphic,24(1), pp. 99-113, February 2000.[11] J. Lee, “<strong>Simulation</strong> oriental black-<strong>in</strong>k pa<strong>in</strong>t<strong>in</strong>g”, IEEEComputer Graphics and Applications, 19(3), pp. 74-81,May/June 1999.[12] S. Saito and M. Nakajima, “3D physically based brushmodel for pa<strong>in</strong>t<strong>in</strong>g”, SIGGRAPH99 Conference Abstracts andApplications, pp. 226-233, 1999.[13] B. Baxter, V. Scheib, M. L<strong>in</strong> and D. Manocha, “DAB:<strong>Interactive</strong> haptic pa<strong>in</strong>t<strong>in</strong>g with 3D virtual brushes”,SIGGRAPH 2001 Proceed<strong>in</strong>gs, August 2001.[14] S. Xu, M. Tang, F. C. M. Lau and Y. Pan, “A solid modelbased virtual hairy brush”, Computer Graphics Forum (Proc. ofEurographics 2002), 21(3), pp. 299-308, 2002.[15] S. Xu, M. Tang, F. C. M. Lau and Y. Pan, “Advanceddesign for a realistic virtual brush”, Proc. of Eurographics 2003,22(3), 2003.[16] E. Plante, M.-P. Cani and P. Poul<strong>in</strong>, “A layered wispsmodel for simulat<strong>in</strong>g <strong>in</strong>teractions <strong>in</strong>side long hair”, ComputerAnimation and <strong>Simulation</strong> 2001[17] A. Pandolfi et al., “Time-Discretized VariationalFormulation of Non-Smooth Frictional Contact”, Int’l J.Numerical Methods <strong>in</strong> Eng., vol. 53, pp. 1801-1829, 2002.188