A few lucky draws are required. Program It is a lucky draw program, and it is essential to make a cool and gorgeous. If you are not familiar with flash, give up. If you are using Silverlight, you need to present it on the webpage, which is inconvenient. You are only familiar with winform and WPF technologies. After doing so, I found that it was really difficult to use winform to achieve cool and gorgeous effects, while WPF was much simpler. Since it is done, it is the coolest thing to do. Cube It is a good idea to show the texture of a cartoon image, move the mouse over the cube, rotate the cube, trigger the sound, and show the results with the music.
Final Result
Expand
The XAML defines the button template to implement the cube button.
After the button is triggered, change the button style and disable the button.
Core Code : < Viewport3d >
< Viewport3d. Camera >
< Perspectivecamera Position = "2.9, 2.9, 2.9" Lookdirection = "-1,-1,-1" />
</ Viewport3d. Camera >
< Viewport3d. Children >
< Modelvisual3d >
< Modelvisual3d. Content >
< Directionallight Direction = "-0.3,-0.4,-0.5" />
</ Modelvisual3d. Content >
</ Modelvisual3d >
< Modelvisual3d >
< Modelvisual3d. Transform >
< Rotatetransform3d >
< Rotatetransform3d. Rotation >
< Axisanglerotation3d Axis = "0, 1" Angle = "0" />
</ Rotatetransform3d. Rotation >
</ Rotatetransform3d >
</ Modelvisual3d. Transform >
< Modelvisual3d. Content >
< Geometrymodel3d >
< Geometrymodel3d. Material >
< Diffusematerial >
< Diffusematerial. Brush >
< Visualbrush Viewportunits = "Absolute" Transform = "1, 0, 0,-1, 0" >
< Visualbrush. Visual >
< Border Background =" {Binding Path = background, relativesource = '{relativesource templatedparent }'} " >
< Label Content =" {Binding Path = content, relativesource = '{relativesource templatedparent }'} " />
</ Border >
</ Visualbrush. Visual >
</ Visualbrush >
</ Diffusematerial. Brush >
</ Diffusematerial >
</ Geometrymodel3d. Material >
< Geometrymodel3d. Geometry >
< Meshgeometry3d
Positions = ",-1 1,-1,-1-1,-1,-1-,-1, 1-, 1-1, -,-1, 1,-1,-1,-1,-1,-1,-1 1,--1,--1, -1,-1-1,-1,-1-1,--, 1-,-1, 1,-1, -1-1, 1"
Triangleindices = "0 1 2 0 2 3 4 5 6 4 6 7 8 9 10 10 11 12 12 13 14 14 15 16 16 18 18 19 20 21 22 20 22 23"
Texturecoordinates = ", 0,-,-0,-,-0,-,-0-,-0-1,-0, -0" />
</ Geometrymodel3d. Geometry >
</ Geometrymodel3d >
</ Modelvisual3d. Content >
</ Modelvisual3d >
</ Viewport3d. Children >
</ Viewport3d >