3d Models in WPF - wpf

My question is simply
How can I get a file with .3ds or .obj extension loaded in a wpf project?
How can I drag and drop that 3d model with the mouse?
(I'm doing a 3d chess project)

Blend has support for loading an obj file and converting it to xaml. Unfortunately, there is no support for 3DS in the box - getting 3DS files requires 3rd party software such as Reader3ds.
You'll need to write your own hit testing, and handle this yourself.

Related

Where to get large images for Ribbon control

I am trying to build a Ribbon control in WPF. I've downloaded the Visual Studio 2013 Image Library. It's got a lot of images but all the standard ones like Cut, Copy and Paste are only in 16x16 format.
Large ribbon images need to be 32x32 (or even up to 64x64 depending on device resolution, according to Microsoft).
I've found several articles on building a Ribbon control and they all seem to use the same icons. Does anyone know where I can find these icons?
It appears that, while Visual Studio includes a library of toolbar images that make it easier to have your own applications have a similar look and feel, Microsoft did not include a very rich set of images in the correct size for the Ribbon control.
So I guess that answer is that you either 1) Create your own, 2) Scavenge the images off the web, or 3) purchase a ready-made library of images with the correct sizes.

How to display Autocad DXF on WPF Canvas?

I am whole new in Autocad using in .NET application. I am working on WPF application that need to import, export and view 2d DXF or DWG file on canvas. I need some general information about how to achieve my goal if possible step by step instruction.
I would suggest you use the Autodesk View & Data webservice to show the model as a WebGL viewer on your application. There are some samples on the link and you need internet connection in order to have this viewer working.

WPF 2d vector-graphics library

I'm looking for a WPF library for 2d vector graphics.
Required features
API for:
drawing shapes
editing shapes
highlighting shapes
Optional features:
possibility to save image to a binary file and to load image from such file (format doesn't matter)
own editor which has UI for creating and editing shapes and which can be integrated in an application (WPF control or external application)
Both free and commercial libraries are acceptable.
P.S. In the last resort WinFroms libraries are acceptable.
You might could use some of the classes from this cool geometry tool.
http://livegeometry.codeplex.com/
or this:
http://wpfholepatterns.codeplex.com/

WPF 3D Model Drawing Tools

Are there any applications out there for 3D modeling that would output the finished product to an array of points (X,Y,Z) that you could then import to a WPF 3D Model?
ie:
<MeshGeometry3D Positions="0,0,0 10,0,0 0,10,0 10,10,0 0,0,10 10,0,10 0,10,10 10,10,10"
TriangleIndices="0,2,1 1,2,3 0,4,2 2,4,6 0,1,4 1,5,4 1,7,5 1,3,7 4,5,6 7,6,5 2,6,3 3,6,7" />
A simple google search for "WPF exporter", an I found:
Viewer3ds - 3ds to xaml converter
Viewer3ds is a WPF application that can read 3ds files and convert them into xaml. It is using the Ab3d.Reader3ds library that imports 3ds files at runtime.
This might be what you need because almost all 3D authoring application are able to export to .3ds format.
Edit:
You could also try Blender and XAML Exporter for Blender to create your 3D assets.
you can use google sketchup, and the exporter I wrote.
http://itaibh.blogspot.com/2009/09/google-sketchup-xaml-exporter.html
Viewer3ds is a converter rather than a modeling tool. If you are looking for free tools, Blender is a very powerful 3D modeling application (albeit with a high learning curve for the UI and workflow) which can export .xaml files with the help of this Blender plugin.
If free is less of a concern to you, then you can use other applications such as Maya or 3ds Max, also with plugins : http://max2xaml.codeplex.com/
All tools mentioned above have the ability to define normals, smoothing groups, materials, etc., everything that WPF supports (and much more, of course).

Does WPF support reading/writing WMF/EMF files natively?

Can Windows Presentation Foundation read/write WMF/EMF files without having to use WinForms Interop or Win32.
If it does not, what is the reason?
A quick search on MSDN reveals a thread containing a post by Peggi Goodwin, a PM at Microsoft:
WPF does not support the EMF and WMF image formats. These formats are more susceptible to security vulnerabilities than other image formats, so we do not intend to support them.
I did it !!!
I'm using ComponentOne's WPF chart in my real code but to keep the example simple I just did a button. But it DOES work on Complex wpf widgets. Fonts, Transparency, AntiAlias etc. everything works. And I can paste into Word and change labels on charts etc.
Basically I decimate the XAML to XPS then import it back into XAML.
Then I used an open source project that converts XAML to WMF called XAMLToys.
XAMLToys would fail 99% of the time because you cannot serial complex XAML objects
http://softronix.com/download/WpfToWmfClipboard.zip
Big kudos to these two projects
http://xamltoys.codeplex.com/
http://khason.net/blog/converting-fixeddocument-xpsdocument-too-to-flowdocument/

Resources