How to Export Viewport3D to a 2d Image file? - wpf

I'm using 3d in WPF and want to save it to a 2d image file, kind of screen shot.
What's the best way to do that ?

In his 12 days of WPF 3D series, Eric Sink has a nice post about Rendering a WPF 3D scene to a Bitmap. Also of interest might be the post on Printing support.
And for any WPF 3D user, I highly recommend the (open-source) Helix 3D Toolkit, which has several importers and exporters to different formats, and is an essential WPF 3D companion library.

Related

How to write custom shader for 3D meshes in WPF with custom vertex and texture properties?

I am pretty new to WPF and want to use the 3D rendering options in WPF. For this I need to write custom shaders for my 3D meshes. I searched a lot, but haven't found anything related to 3D. I only found the ShaderEffect, that can be used for 2D graphics. So is there any way to do this? Maybe by looking on how the DiffuseMaterial or other Material work?

Rendering WPF controls on planes in 3D space

I have the following setup: I can track a surface very accuratly in a 3d space using a tracking system. Now I want to project on this plane with an overhead projector.
I want to develop my interface in WPF/XAML and then render it in real time to the surface that is tracked. But I don't know exactly how to do it...
This is what I think: I need to model the tracked surface in a 3D space, then I want to develop the interface using regular WPF/XAML controls use (maybe) directx to render these controls to model in 3D that represent the tracked surface.
I already found information of using directx in combination with wpf (Sharpdx.WPF) but here they demonstrate how to create 3d scenes with wpf... However, they don't show how to use regular WPF controls and render these to the 3d models.
Do I first need to convert the user control of WPF/XAML to an image and then render it to the 3d model or is there another way to do it?

WPF - Drawing 3D Object

I am newbie to WPF.
I have drawn simple 3D cube and rotate it with mouse
But my question is,
is it possible to draw wireframe object in WPF Without using any third party library(eg.Charles Petzold's libraty etc..)?
Unfortunatly the DirectX that WPF is built upon doesn't allow drawing lines, only rectangles which in turn means no wireframe. Sorry, you´ll have to look around for another solution.

Silverlight - Perspective 3D

I am considering using Silverlight for a project I am working on. This project will need to show a 3-Dimensional cube. Is this possible in Silverlight?
I see a lot of examples that a basically 2-sides of one item. Kind of like a sheet of paper. Is this what "perspective" 3D is? How is perspective 3D different than normal 3D?
Thank you!
You should look at Kit3D for Silverlight. Someone also created a silverlight3d.com site, but it current just has three reference articles and a link to Kit3D.
It is also possible to emulate 3D as demonstrated by this MSDN article.
The feature that was added in Silverlight 3 is referred to as "perspective 3D" to avoid confusion that might arise with someone expecting it be some kind of full scale 3d rendering API (like DirectX or OpenGl etc.) or something like WPFs UIElement3D.
The "perspective 3D" feature in Silverlight allows you to take any regular 2D UIElement and rotate it in 3D dimensions; you can think of it like a more powerful RenderTransform. There are two ways of setting a "Projection" on a UIElement, with a PlaneProjection (simple) or with a Matrix3DProjection (more complex).
You could certainly use this feature to create a 3D cube, where each face of the cube is a UIElement with a Projection applied to it. However you would not use this feature to create something that required complex 3d models such as a 3D game.

Where can I find information about creating 3D controls in WPF?

I am about to start to make the interface for a game in WPF / Silverlight. I'd like it to have a nice look all in 3 dimensions. Can you point me to some good resources, tutorials, books... on how to develop real 3D controls, like Buttons and such?
Charles Petzold's Book on WPF 3D Applications
WPF3D Team Blog
Codegod tutorial on WPF 3D
12 part series on Eric Sink's Blog
A couple of interesting resources linked here
More specific to controls:
Channel9 video on the topic of WPF 3D View Controls.
2D Controls on 3D Objects.
Thriple, a library of 3D controls and panels, for use in WPF applications.
Perspective library use case.

Resources