WPF 3D flip lottery Program

Source: Internet
Author: User
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 >

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.