WPF 3D Model Drawing Tools - wpf

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).

Related

Porting Solar Wind XNA example to Helix 3d WPF

I am looking to port the Silverlight 5 / XNA example Solar Wind to WPF using the Helix3d toolkit.
The Solar Wind example is here:
http://code.msdn.microsoft.com/Solar-Wind-3D-Sample-4cb56170
I watched the video demonstrating the example and one of the great features is that the 3d geometry is expressed as XML and can be changed at runtime. This makes it possible for example to change terrain height or color at runtime based on sets of data.
I have been looking at the Helix 3d toolkit which looks amazing.
It can be found at:
http://helixtoolkit.codeplex.com/
I am aware that 3d geometry can be expressed as XAML in the Helix 3d toolkit. Is it possible to change the Geometry dynamically at runtime to support similar behaviour as the Solar Wind example does in XNA?
#user1306322 that just looks like a plug for Unity3d. Unity is a great engine, but I was suggested Helix 3d because it is built to integrate with WPF applications.
A beter suggestion in terms of porting the Solar Winds example would actually be Monogame, because it fully (well almost) supports the XNA framework, but supports DirectX 11 and multi platforms.

Displaying 3D models in WPF

I would like to display a 3D model in a WPF application (the model is prepared in an external tool such as blender). What is the best practice? Are there any tools to facilitate this? How about rotation/transform performance?
Good question!
The result-answer is depending from your goals.
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
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:
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.
The model you are prepared in professional tool like 3DMax, ...not
seems 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 is
Helix 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
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
You can use 3dsmax and convert your model by
Xaml exporter for 3D Studio Max.

Is there a library to display a Virtual Human [WPF]

While there are a lot of 3D libraries out there, I'm in struggle to find one suitable for WPF.
Basically, I want a Character Animation engine, which loads bone hierarchy and allows me to manipulate the skinned mesh.
I know, this is a classic topic for all the 3D engines. And they are made for building games.
How do I display a Skinned Character in a WPF application?
Depends on how broadly you want to distribute your app, provide installation support for it - and how much work you want to do
1) You can always do it yourself - but you've probably already decided you don't want to spend 2 years of your life building a render pipeline, learning the vagaries of IK, etc
2) You could target XNA - this is sort of WPF, will run on windows, and the xbox to boot - one package you could consider for XNA is Visual 3D - you can find a list of engines here
3) IFF you either can access the target machines directly, or can release your app as a standalone WPF application, you've got a lot of options - all you need is a C# wrapper that allows you to call a native implementation - the one thing you'll loose is WPF ability to superimpose controls, because your render surface will most likely be a winform control embedded in a WPF UI - you will need to get the wrapper DLL into the GAC if you want to distribute the app broadly -
3a) check out the Blender community - the entire tool is open source, and there's a lot of smart people playing in that space
4) I'd tout my own engine but it's undergoing a thorough revision and won't be out again for quite a few months - we'd provide WPF/Silverlight support via option 3 - .Net wrapper over C++ core directly installed into GAC - which makes it available for WPF/Silverlight - I believe we'll still have to pretend to be a winform control to allow the D3D render surfaces to punch through onto the screen
Hope this helps
PS - one side question - You capitalized Virtual Human -- you aren't referencing the NIH Visible Human Project, are you ? If so, last I knew you had to assemble the geometry/bones yourself , all it supplies is the tomagraphic slices
Well you could try this:
OGRE Game engine in WPF
If that OGRE engine supports bones, you should be good to go.
More about the OGRE Engine
Good Luck!
There is no support for skinned meshes in WPF. But you can animate other things like robots well in WPF (see the ape walk example at www.okino.com ).
You can make meshes deform in WPF by changing the position values. I have done this by creating a control which exposes properties to the WPF animation system. It just takes a lot of effort.
Here is my unfinished WPF app. Notice the ball joints in the robot. The only place I really need mesh deformations is in the face, so she can talk.
Since MS dropped support for WPF 3D in Visual Studio its really hard to make realistic animations. Although with UIElement3D you could write an app that allows you to let people drag the robots limbs around and then take a snapshot. An animation system on top of the WPF animation system.
I have written a plugin for blender which allows you to export 3D models from Blender.
So if you want to write a skinned mesh for WPF, you will have to write your own. Bones are really just transforms which work on part of the mesh.

3d Models in 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.

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.

Resources