Displaying 3D models in WPF Displaying 3D models in WPF wpf wpf

Displaying 3D models in WPF


Good question!The result-answer is depending from your goals.

  1. Approach. You are in interest to put some .3ds(.obj,..) model object as stationary part of your scene without any interactive transformations (moving, scaling and so on). This approach is for simple playing (learning WPF3D) as a rule
  2. Approach. You are thinking to have full interactive part with support any WPF3D transformations within your Viewport3D. This approach is for rich 3D scene manipulations in professional application as a rule.

There are relatively many tools for solve this task, but there is no any case universal solution.There are two troubles to do this task:

  1. Incompatible formats between tools. For example, one tool creates.3ds(.obj,..) model, but second tool for translating it into .xaml(reading .3ds, .obj, ...) do not understand this model.
  2. The model you are prepared in professional tool like 3DMax, ...notseems so fine in WPF3D.

Moreover it will be very good to change materials in model by the compatible (for further adequate WPF presentation) way.

Be ready experimenting many times for best results...It seems that you are about 2 point - Approach.So, best tool for reading .3ds, .obj file isHelix 3D Toolkit

Recipe is very simple. For example, in VB

Dim CurrentHelix3DSStudioReader As New StudioReader()Dim MyToyModel3DGroup as Model3DGroup = CurrentHelix3DSStudioReader.Read("MyToy.3ds")

Or

Dim CurrentHelixObjReader As New ObjReader()Dim MyToyModel3DGroup as Model3DGroup = CurrentHelixObjReader.Read("MyToy.obj")

Best tool for manipulation .3ds, .obj, ... models including saving in .xaml is Deep Exploration. My sample in WPF 3D scene. Fast full managed object

My sample in WPF 3D scene. Fast full managed object


Zam3d is was a great tool for converting 3D Models into Xaml, but it looks like Electric Rain has gone defunct, you may be able to find a copy somewhere by Googling for it. I highly recomend Petzold's book 3D Programming for Windows. There are also a ton of tutorials online, I would google for some modern ones.


You can import and convert OBJ-Files to XAML using "Blend for Visual Studio" please take a look here:

alternative-to-zam-3d-editor