WizIQ helps you learn and teach online - any subject you can think of!
Join for FREE

Bootcamp3D ppt feb 21

Add to Favourites
Post to:

Description
Bootcamp3D ppt feb 21

Comments
Presentation Transcript Presentation Transcript

Advanced 3D Techniques with WPF : Advanced 3D Techniques with WPF David Teitlebaum - Program Manager Jordan Parker - Developer Microsoft Corporation

Talk Outline : Talk Outline Introduction to WPF3D What do you need to do to see something? Interactive 2D on 3D Make VisualBrush work like you expected it to Performance Tips Learn how to avoid common mistakes

Jordan Parker : Jordan Parker basics

The Name Game Warmup Time : The Name Game Warmup Time Pattern: FooBar is a Bar with a Foo Examples: ModelVisual3D is a Visual3D with a Model3D GeometryModel3D is a Model3D with a Geometry3D MeshGeometry3D is a Geometry3D with a mesh ScaleTransform3D is a Transform3D with a scale And so on (generally) DrawingImage vs. ImageDrawing, anyone?

The Minimal Scene : The Minimal Scene Let’s do a simple 3D video example step-by-step

Our Coordinate System : Our Coordinate System Right-handed Notice that +Y is up… opposite of 2D! (Image from http://www.willamette.edu/~gorr/)

MeshGeometry3D : MeshGeometry3D Specifies a mesh of triangles Positions: Triangle vertices TriangleIndices: Optional indices into collections. Used to avoid duplicating vertices. Normals: Per-vertex orientation used in lighting. Generated for you if unspecified. TextureCoordinates: Describes the 2D Brush mapping. NOT generated for you. Not needed for SolidColorBrushes. Triangle vertices should be given in CCW order

TriangleIndices : TriangleIndices If specified: positions[indices[0]] positions[indices[1]] positions[indices[2]]… texcoords[indices[0]] texcoords[indices[1]] texcoords[indices[2]]… normals[indices[0]] normals[indices[1]] normals[indices[2]]… If not specified: positions[0] positions[1] positions[2] … texcoords[0] texcoords[1] texcoords[2] … normals[0] normals[1] normals[1] …

TextureCoordinates : TextureCoordinates (image from blogs.msdn.com/danlehen)

Normals : Normals If you don’t specify normals, we generate them by averaging the “true” surface normals of the triangles that share the vertex. This gives a smooth appearance. If you duplicate a vertex, it will end up with a different normal each time. Triangle specification matters! If you specify too many, we throw out the extras If you specify too few, we generate the rest

NormalsCylinder Cap Duplication Example : NormalsCylinder Cap Duplication Example

Positions: Specifying a Plane : Positions: Specifying a Plane (-1,1,0) 0 (0,0) (-1,-1,0) 1 (0,1) (1,-1,0) 2 (1,1) (1,1,0) 3 (1,0) Key: pos idx tc Looking down -Z, making a 2 x 2 plane on Z = 0

Mesh XAML : Mesh XAML We’ll let WPF compute the normals In general, you’ll be exporting a mesh to XAML from a tool or generating the mesh algorithmically

Materials : Materials Reflection/absorption of light EmissiveMaterial: Surface appears to give off light SpecularMaterial: Shine DiffuseMaterial: Soft scattering Takes a Brush for the base color Combine them with MaterialGroup When in doubt, use DiffuseMaterial

Material Examples : Material Examples

Video DiffuseMaterial XAML : Video DiffuseMaterial XAML

Want to learn?

Sign up and browse through relevant courses.

Name:
Your Email:
Password:
Country:
Contact no.:


Area code Number
Subject you are interested in:
Word verification: (Enter the text as in image)


Sign Up Already a member? Sign In
I agree to WizIQ's User Agreement & Privacy Policy
6 Members Recommend
1 Follower

Your Facebook Friends on WizIQ