Chapter 6. Video and 3-D

Source: Internet
Author: User

Although the video and3-DBeyond the scope of this book, it is worthwhile to obtain support for these features.

VideoMediaelementType. This element can be addedUIAny place in the tree. Simply set itsSourceAttribute to associate it with the video stream to be played, as shown in the example7-49.

Example7-49

< Mediaelement Source = "C: \ windows \ system32 \ oobe \ images \ intro. wmv" Stretch = "Fill"   />

3-DContent passedViewport3dYes. UntilWPFThe appearance system is associated,Viewport3dIt is just a regular control, and it can be set to size and positioning, just like other controls. However, you provide such controls3-DModel, light, camera location information. It generates this model. This control acts as3-DThe form on the screen, as shown in the example7-50.

Example7-50

< Viewport3d Cliptobounds = "True" >
< Viewport3d. Camera >
< Perspectivecamera Nearplanedistance = "1" Farplanedistance = "100"
Lookatpoint = "0, 0" Position = "30,-2, 20" Up = "0, 0, 1"
Fieldofview = "45"   />
</ Viewport3d. Camera >

< Viewport3d. Models >
< Model3dgroup >
< Directionallight Color = "# Ffffffff" Direction = "10, 25,-1"   />
< Ambientlight Color = "#66666666"   />

< Geometrymodel3d >
< Geometrymodel3d. Geometry >
< Meshgeometry3d
Triangleindices = "0 1 2 1 2 3 2 3 0 0 1 3"
Normals = "-1,-1,-, 0, 0, 0, 0, 1"
Positions = "-2,-2,-2 2,-2,-2 0,-2 0, 1" />
</ Geometrymodel3d. Geometry >
< Geometrymodel3d. Material >
< Materialgroup >
< Diffusematerial Brush = "Lightgreen"   />
< Specularmaterial Brush = "White"   />
</ Materialgroup >
</ Geometrymodel3d. Material >
</ Geometrymodel3d >
</ Model3dgroup >
</ Viewport3d. Models >
</ Viewport3d >

This creates a very simple 3-DThe model contains a separate square-based taper. Figure7-58The result is displayed. This model also contains some light sources to ensure that the model is visible. ThisViewportThere is also a detailed camera location.

Figure7-58


In fact, you can use any type3-DDesign the tool model, so you cannot typically want to work with the model tag, as shown in the example7-50.Viewport3dOnly one convenient method is provided to integrate the results into your visualization tree.

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.