advertisement

Wpf Workgroup 4

42 %
58 %
advertisement
Information about Wpf Workgroup 4

Published on June 19, 2007

Author: andrei_i

Source: slideshare.net

Description

The fourth WPF workgroup at FCS, UAIC
advertisement

Andrei Iacob Microsoft Student Partners

Agenda 3D - Sistemul de coordonate - Marii juc ători (Point3D, Vector3D, Size3D, Visual3D, MeshGeometry3D, GeometryModel3D, ModelVisual3D, PerspectiveCamera) - O scenă simplă - Randarea controalelor în 3D - Transformari 3D - ZAM3D - Crearea unei scene 3D din cod - Hit testing - Tema: controale 2D în spaţiul 3D

3D

- Sistemul de coordonate

- Marii juc ători (Point3D, Vector3D, Size3D, Visual3D, MeshGeometry3D, GeometryModel3D, ModelVisual3D, PerspectiveCamera) - O scenă simplă - Randarea controalelor în 3D - Transformari 3D - ZAM3D - Crearea unei scene 3D din cod - Hit testing - Tema: controale 2D în spaţiul 3D

Bazele unei scene 3D +x -x +y -y +z -z Sistemul de coordonate – right handed

Bazele unei scene 3D C âteva clase: System.Windows.Media.Media3D Point3D Size3D Rect3D Vector3D X,Y,Z

C âteva clase:

System.Windows.Media.Media3D

Point3D

Size3D

Rect3D

Vector3D

X,Y,Z

Bazele unei scene 3D Ce constituie o scenă 3D ? Cel pu ţin o formă geometrică Cel puţin o sursă de lumină O cameră (de luat vederi) Viewport3D: - Camera (System.Windows.Media3D.Camera) - Children (Visual3DCollection)

Ce constituie o scenă 3D ?

Cel pu ţin o formă geometrică

Cel puţin o sursă de lumină

O cameră (de luat vederi)

Viewport3D:

- Camera (System.Windows.Media3D.Camera)

- Children (Visual3DCollection)

Bazele unei scene 3D MeshGeometry3D Object DispatcherObject (abstract) DependencyObject Freezable (abstract) Animatable (abstract) Geometry3D (abstract) MeshGeometry3D

Bazele unei scene 3D MeshGeometry3D – exemplu <MeshGeometry3D Positions=&quot;-1 0 0, 0 1 0, 1 0 0&quot; TriangleIndices=&quot;0 2 1&quot; />

Bazele unei scene 3D MeshGeometry3D + material = GeometryModel3D Object DispatcherObject (abstract) DependencyObject Freezable (abstract) Animatable (abstract) Material (abstract) DiffuseMaterial EmissiveMaterial MaterialGroup SpecularMaterial

Bazele unei scene 3D MeshGeometry3D + material = GeometryModel3D <ModelVisual3D> <ModelVisual3D.Content> <GeometryModel3D> <GeometryModel3D.Geometry> <MeshGeometry3D Positions=&quot;-1 0 0, 0 1 0, 1 0 0&quot; TriangleIndices=&quot;0 2 1&quot; /> </GeometryModel3D.Geometry>   <GeometryModel3D.Material> <DiffuseMaterial Brush=&quot;Red&quot; /> </GeometryModel3D.Material>   <GeometryModel3D.BackMaterial> <DiffuseMaterial Brush=&quot;Blue&quot; /> </GeometryModel3D.BackMaterial> </GeometryModel3D> </ModelVisual3D.Content> </ModelVisual3D>

Bazele unei scene 3D Lumini Object DispatcherObject (abstract) DependencyObject Freezable (abstract) Animatable (abstract) Model3D (abstract) GeometryModel3D Light (abstract) AmbientLight DirectionalLight PointLightBase (abstract) PointLight SpotLight

Bazele unei scene 3D Lumini <ModelVisual3D> <ModelVisual3D.Content> <AmbientLight Color=&quot;White&quot; /> </ModelVisual3D.Content> </ModelVisual3D>

Bazele unei scene 3D Camere Object DispatcherObject (abstract) DependencyObject Freezable (abstract) Animatable (abstract) Camera (abstract) MatrixCamera ProjectionCamera (abstract) OrthographicCamera PerspectiveCamera

Bazele unei scene 3D Camere <Viewport3D.Camera> <PerspectiveCamera Position=&quot;0 0.5 3&quot; LookDirection=&quot;0 0 -1&quot; UpDirection=&quot;0 1 0&quot; FieldOfView=&quot;90&quot; /> </Viewport3D.Camera> LookDirection = VisualCenter – Position

Bazele unei scene 3D Prima scen ă <Viewport3D> <ModelVisual3D> <ModelVisual3D.Content> <GeometryModel3D.Geometry> <!– Forma geometrica  </GeometryModel3D.Geometry>  <GeometryModel3D.Material>  <!-- Material --> </GeometryModel3D.Material>  </GeometryModel3D> </ModelVisual3D.Content> </ModelVisual3D> <!-- Lumina -->   <ModelVisual3D> <ModelVisual3D.Content> <AmbientLight Color=&quot;White&quot; /> </ModelVisual3D.Content> </ModelVisual3D> <!-- Camera. --> <Viewport3D.Camera> <PerspectiveCamera Position=&quot;0 0.5 1.5&quot; LookDirection=&quot;0 0 -1&quot; UpDirection=&quot;0 1 0&quot; FieldOfView=&quot;120&quot; /> </Viewport3D.Camera> </Viewport3D> 

Bazele unei scene 3D Transform ări Object DispatcherObject (abstract) DependencyObject Freezable (abstract) Animatable (abstract) Transform3D (abstract) AffineTransform3D (abstract) RotateTransform3D ScaleTransform3D TranslateTransform3D MatrixTransform3D Transform3DGroup

Scena 3D din C# Pasul 1: Proiectarea unei structuri de date care să stocheze modelele 3D (pentru prelucrare) ex. ArrayList Pasul 2: Crearea unui model: Model3DGroup m odel =new Model3DGroup(); GeometryModel3D geometrie = new GeometryModel3D(); geometrie.Geometry = (MeshGeometry3D)t.FindResource(“cub”); // de ex m odel .Children.Add(geometrie); Pasul 3: Ad ăugarea modelului în Viewport Viewport.Children.Add(model);

Pasul 1:

Proiectarea unei structuri de date care să stocheze modelele 3D (pentru prelucrare) ex. ArrayList

Pasul 2:

Crearea unui model:

Model3DGroup m odel =new Model3DGroup(); GeometryModel3D geometrie = new GeometryModel3D(); geometrie.Geometry = (MeshGeometry3D)t.FindResource(“cub”); // de ex

m odel .Children.Add(geometrie);

Pasul 3:

Ad ăugarea modelului în Viewport

Viewport.Children.Add(model);

Hit Testing public HitTestResultBehavior HTResult(System.Windows.Media.HitTestResult rawresult) {     RayHitTestResult rayResult = rawresult as RayHitTestResult;    if (rayResult != null)     {         RayMeshGeometry3DHitTestResult rayMeshResult = rayResult as RayMeshGeometry3DHitTestResult;         if (rayMeshResult != null)         {             GeometryModel3D hitgeo = rayMeshResult.ModelHit as GeometryModel3D;      // Aici facem ceva cu modelul.         }    }    return HitTestResultBehavior.Continue; } PointHitTestParameters pointparams = new PointHitTestParameters(mouseposition); VisualTreeHelper.HitTest(mainViewport, null, HTResult, pointparams);

Add a comment

Related pages

Neues in WPF Version 4.5 - msdn.microsoft.com

Dieses Thema enthält Informationen über die neuen Features und Verbesserungen in Windows Presentation Foundation (WPF) Version 4.5.
Read more

Einführung in WPF in Visual Studio 2015

Neues in WPF Version 4.5. Exemplarische Vorgehensweise: Erste Schritte mit WPF. Exemplarische Vorgehensweisen für WPF. WPF-Communityfeedback. TOC
Read more

Introduction to WPF 4 Multitouch | Jaime Rodriguez

Introduction to WPF 4 Multitouch ... Approach #2: Manipulation in WPF 4 Manipulation in WPF 4 is an opt-in behavior.
Read more

WPF 4.5 und XAML: Grafische Benutzeroberflächen für ...

WPF 4.5 und XAML: Grafische Benutzeroberflächen für Windows inkl. Entwicklung von Windows Store Apps Gebundene Ausgabe – 6. Dezember 2012
Read more

WPF in 4.6 and beyond | dotnetConf 2015 | Channel 9

WPF in 4.6 and beyond. Date: March 18, 2015 from 3:00PM to 4:00PM; ... You need to be signed in to Channel 9 to use this feature.
Read more

WPF 4 Unleashed: Amazon.de: Adam Nathan: Fremdsprachige Bücher

Adam Nathan - WPF 4 Unleashed jetzt kaufen. ISBN: 0752063331194, Fremdsprachige Bücher - Softwareentwicklung
Read more

Download Microsoft Ribbon for WPF October 2010 from ...

Microsoft Ribbon for WPF.msi. 3.4 MB. 3.4 MB: Microsoft Ribbon for WPF Source and Samples.msi. ... To install this download of Microsoft Ribbon for WPF:
Read more

1 of 4 - SolidWorks Workgroup PDM Basic Tutorial - YouTube

2 of 4 - SolidWorks Workgroup PDM Basic Tutorial - Duration: 6:25. PrismEngineering 26,488 views. 6:25 3 of 4 - SolidWorks Workgroup PDM Basic ...
Read more

Windows Presentation Foundation – Wikipedia

Windows Presentation Foundation (kurz WPF), auch bekannt unter dem Codenamen Avalon, ist ein Grafik-Framework und Teil des .NET Frameworks von Microsoft ...
Read more