This screensaver that generates the figure of the morel rose. mao rel rose, also translated as Mao Rel, is a very beautiful mathematical figure, a variant of the Rose Line. for more information about its mathematical interpretation, see: Mathematical graphics (1.45) Maurer rose (Maurer rose)
After the program starts, different Maurel rose images will be randomly generated. clicking the mouse or pressing any keyboard button will automatically exit. Use the scroll wheel to scroll the chart.
: Http://files.cnblogs.com/WhyEngine/MaurerRoseSP.zip
Double-click "maurerrosesp. scr" to run the program
Double-click "maurerrose.exe" to run the program in the window framework.
Screen Saver settings:
Under XP
Copy all files in the directory to the Windows System directory, for example, "C: \ WINDOWS \ System32"
In the set Screen Saver dialog box, select "maurerrosesp"
Windows 7 and Windows 8
Copy all files in the directory to the "C: \ WINDOWS \ syswow64" or "C: \ WINDOWS \ syswow32" directory.
In the set Screen Saver dialog box, select "maurerrosesp"
Code for generating the Maurel rose image:
1 Void Cmaurerrosespentity: reset () 2 { 3 M_nfinishtime = 0 ; 4 M_nplayvertices = 2 ; 5 6 Uint width; 7 Uint height; 8 M_pdx9render-> Getbackbuffersize (width, height ); 9 10 Vector2 vscreencenter (width * 0.5f , Height * 0.5f ); 11 12 Yreal screenradius = width 0.5f : Height * 0.5f ; 13 Screenradius-= 8.0f ; 14 If (Screenradius < 10.0f ) 15 { 16 Return ; 17 } 18 19 M_paramn = yf_rand ( 3 , 12 ); 20 M_paramd = yf_rand ( 1 , 128 ); 21 Float K; 22 Yreal X, Y; 23 Yuint T; 24 25 Rhwvertex * Vb; 26 M_pvb-> lock ( 0 , 0 ,( Void **) & VB, 0 ); 27 28 For (T = 0 ; T <yd_vertices_count; t ++ ) 29 { 30 K = ( Float ) (T * M_paramd ); 31 32 X = sinf (m_paramn * k )* Cosf (k ); 33 Y = sinf (m_paramn * k )* Sinf (k ); 34 35 X = vscreencenter. x + screenradius * X; 36 Y = vscreencenter. Y + screenradius * Y; 37 38 VB [T]. Set (x, y, 0.0f , 1.0f ); 39 } 40 41 M_pvb-> Unlock (); 42 43 // # Ifdef _ debug 44 // 45 // _ Why_core-> trace ("Maurer rose Param N: % d", N ); 46 // _ Why_core-> trace ("Maurer rose Param D: % d", d ); 47 // 48 // # Endif 49 }
View code