Viewer3ds - 3ds to xaml converter


Viewer3ds is a free 3ds file viewer and xaml exporter.
It is also one of the first applications with animated 3D buttons and other WPF goodies like reflection, transparencies and work area zoom.

Note:
Viewer3ds with its xaml exported is ment to be used for simpler 3ds objects. It does not use the latest 3ds reading engine - to achieve the best results and to have more options when importing 3ds file please use Reader3ds library instead - there is also support for simple animations.

Page contents:
Viewer3ds screenshot

Advanced User interface

Semi-transparent panels are shown on the left side of the application. Their transparency is set to 69% (0xAA) so if the 3D objects are behind the panels they can still be visible. Also when you show or hide the panels they are automatically positioned one over another - a WPF's StackPanel is used to achieve that.

Workspace zoom can be used to make the panels and 3D buttons smaller (to get more workspace) or bigger (to see them better :). This can be practical when you are already very familiar with the panels and its options and would like to maximize the 3D object workspace. This will be also very handy in the future because there will be LCD monitors with huge resolution - with the default workspace zoom the buttons and panels will be simply too small and the user can than set their size to the scale he wants. And regardless of the zoom factor all the buttons, checkboxes and other controls are still working - great work Microsoft.

Animation is used to show and hide error and message panels. With WPF's Storyboard this was a simple job.

Animated real 3D buttons are something that really makes this application unique. When user moves the mouse over a button the button not only changes the background color, gets different border or changes from black and white to colored image but starts rotating in real 3D.

Why using 3D buttons? I believe it a natural step in a user interface evolution:

Windows 3.1
Windows 3.1

Windows Vista
Windows Vista

What is the main difference between these buttons? The buttons in Windows Vista are not just flat images like most of the buttons from Windows 3.1 but look more realistic - almost as real 3D objects that you could grab with your hand. But they are still just images.

So it is not hard to guess the next step in the buttons evolution - real 3D buttons.
And with WPF this is now possible:
Viewer3ds
Viewer3ds Buttons (with reflection and 3D animated)

Read more here.

Viewer3ds features

You can open 3ds file with clicking on the File open button, with dragging and dropping 3ds file from windows explorer or by double clicking on the 3ds file in windows explorer. After opening 3ds file all the 3D objects with it material information (including textures) are imported and should be seen in the application. All the lights and cameras are imported as well.

All the read lights are shown in the lights panel. There is also a free light that is a DirectionalLight and is added by Viewer3ds. The direction in which this light shines can be manually changes with the sliders below the free light. With the checkboxes the lights can be switched on or off.

The cameras are listed in the cameras panel. As with the lights Viewer3ds also adds a free camera that can be controlled by the user. The free camera's position and distance can be set with the sliders or with holding the right mouse button (rotate the camera) or with the mouse wheel (change distanced). In order to use the free camera it must be selected.

With the options button you bring up the Import Filters panel. Because WPF does not support Glossiness the imported objects that use SpecularMaterials sometimes does not look as expected (too big specular effect). In this case it is handy to disable SpecularMaterials in the scene. Sometimes the read 3ds model does not have correctly set normals so when imported into Viewer3ds some holes are shown in the rendered model. In this case it is useful to force that all material are two sided - in WPF's terminology that means that all the GeometryModel3D also have BackMaterial the same as Material. Sometimes transparencies in WPF are not rendered correctly. It is possible to disable them as well.

The last button is used to show Export panel. It is possible to export 3D objects into a xaml file, to the clipboard, save the image of the rendered objects (as seen in Viewer3ds) or save a simple text report about the 3D objects and its materials. The files are created in the same directory as the original 3ds file.

With the "Type" drop down list it is possible to set the type of exported xaml. The default value is "Page (loose xaml)". This means the exported xaml can be used as a loose xaml page - for example in a web applications. The exported file can be opened directly in internet explorer. The other two options are to export as a Canvas or as a Viewport3D - useful to add the xaml with 3D objects to an existing xaml for example to a xaml in Interactive Designer. With the "use relative path for textures" relative or absolute paths for textures can be used.

Let's say you want to export the 3D model into MS Expression Interactive Designer. If you are in Interactive designer working with Grids than you should select the "Viewport3D" as export type. Click the "Export XAML to Clipboard" and in Interactive designer go to Code View. Put the pointer to the place where you want the 3D object to be and press Paste. If you are working with Canvases select this type to export.

If you want to add xaml to your web site as loose xaml select "Page (loose xaml)" and click "Save XAML". The xaml is saved into the directory of the original 3ds file. Now just upload the exported xaml to your web server ("How to use xaml in your web page in IFRAME - coming soon in How to section.

More 3ds sample files

There are plenty of 3D objects in 3ds file format freely available on the internet. Some simples objects like box, pyramid, sphere, simple hand, moon and others can be find on this site under 3D Objects section. Some other sites with free 3ds files can be found in Links section.

Free 3D modeling applications

If you would like to create your own 3D models you do not need to buy a professional modeling application like 3D Studio Max or Maya. There are also some very good modeling applications available - see Links section.

Online 3ds to xaml converter

The simplest way to convert a 3ds file to a xaml file is probably with the Online 3ds to xaml converter available on my site. The only limitation is the uploaded file size that is limited to 100 Kb. 

Reader3ds library

If you truly want to exploit the power of 3D with 3ds files than you should try the Reader3ds. This a library that enables you to open 3ds file directly into your WPF application - without turning all the data about positions, triangles and other data into text format. See Reader3ds section for more.


DOWNLOAD All Ab3d tools, libraries and samples (3.29MB) [1 Jul 2008]
(Viewer3ds, Ab3d.Reader3ds, help file all sample applications)


System requirements:
Windows XP, Windows Vista (recommended)
.Net Framework 3.0 (also works with 3.5)
Visual Studio 2005 (can be imported into VS 2008) - for samples



Note: Subscribe to RSS feed to be informed about new content on the site.
Copyright © 2007 by Andrej Benedik. All Rights Reserved.