Animated 3D Buttons Panel sample

by abenedik 21. January 2009 16:13

As promised I have published a source code for Animated 3D buttons that were used in previous version of Viewer3ds.

The sample shows how to create 3D buttons that are animated when mouse moves over them. Under the buttons there is a nice reflection of the buttons. The models for the buttons are defined in 3ds files and read with Ab3d.Reader3ds.

Animated 3D Buttons Panel sample

The sample is now part of the samples that come with Reader3ds installation.

It is also possible to download the sample alone from here (note that Ab3d.Reader3ds have to be installed on the system).

Tags: , , ,

Reader3ds

Ab3d.Reader3ds v5.2 has improved WPF Browser applications support

by abenedik 20. January 2009 19:34

The previous version or Ab3d.Reader3ds did not work with WPF Browser applications (XBAP). Because WPF Browser applications are running inside a partially trusted environment, the licensing code could not read the license or evaluation information. The new version overcomes this by embedding the information into the applications resources. To do this a license.licx file needs to be added to WPF Browser application's project and its build action should be set to Embedded resource (also for evaluation version).

This is the list of changes for v5.2:

  • Added support for using Ab3d.Reader3ds in WPF Browser applications (partially trusted).
  • Fixed problems with evaluation version with SmoothingGroups - sometimes "Index was out of range. Must be non-negative and less than the size of the collection." was thrown.
  • Fixed reading some 3ds files with animation - sometimes "System.OutOfMemoryException" was thrown.

For convenience I have also included samples for VS 2008 into the installer (besides VS 2008 solution).

WPF Browser application

The new version is available on https://www.ab4d.com/Downloads.aspx.

Tags: , , ,

Reader3ds

Ab2d.ReaderSvg library improved

by abenedik 4. January 2009 20:34

Ab2d.ReaderSvg library has been improved.

The list of changes is not long. I needed some new functionality for importing text. The previous version has also some problems with importing rectangles. This is a list of changes for version 2.2:

  • Added support for FontWeight and Italic FontStyle.
  • Added support for Rotate in Tspan (for Text on Path).
  • Fixed fill and stroke brush for Rectangle element.
  • Removed RunWithDeveloperLicense Dialog (shown when commercial license is installed, but the application did not have an embedded license.licx file).

The new version is available on https://www.ab4d.com/ReaderSvg.aspx.

Tags: , , ,

ReaderSvg

There is never enough testing!

by abenedik 1. January 2009 14:26

Everyone who has already tried the new version of Viewer3ds knows what I mean. The application just did not start!

During the final testing a wrong version of Viewer3ds "smuggled" into my installer project. Because I have already done extensive Viewer3ds testing, I did not test it again. What a mistake! The installer contained a version of Viewer3ds that required a wrong version of Reader3ds.

Luckily the new Viewer3ds has an error reporting system, so I could act quickly.

The fixed version is already available on https://www.ab4d.com/Viewer3ds.aspx. It was actually already available on 31th December 2008, but because of a New Year celebration I did not have time to write a message about it.

I must admit that the past few releases were not very good. Every release had some problems. I am already using a unit testing, but still there is place for error. I was also quite under pressure, because I have to release new versions for all the products before the previous version expired. With the releases still to come I will have more time for additional testing. So they should be less buggy.

The only thing left to say is:

Happy New Year 2009!

Tags: , , ,

Reader3ds

New version of Viewer3ds and Ab3d.Reader3ds available

by abenedik 27. December 2008 22:40

Finally my firstly published application, Viewer3ds, got a major update. The Ab3d.Reader3ds library was also updated.

The previous version of Viewer3ds was really old. More than 2 years old! The main problem with Viewer3ds was that it was using an embedded Ab3d.Reader3ds library for importing 3ds file. This meant that the updates of Ab3d.Reader3ds and many new features that were introduced did not have any effect on the Viewer3ds.

Viewer3ds

The new version of Viewer3ds does not have an embedded Reader3ds, so the currently available version is used.

The application now also supports many new features. For example:

  • The objects hierarchy is displayed in a tree view. It displays names of the objects that were defined in a 3D modeling applications. So when the exported xaml is used in your application, you can know which names to use to access the objects.
  • All the 3D objects can be renamed (or given a name if a name was not specified).
  • If the 3ds file contains an animation, it can be played with Viewer3ds. A selected frame can be exported to xaml.
  • It is possible to export only selected objects (besides exporting all objects).
  • Camera can be freely rotated around the read objects (select Free Camera in Cameras Panel).
  • Lights can be turned on and off. A camera light that shines in the direction of the camera can be added to the scene (in case the scene does not contain any light).
  • There are many options on how to load the 3ds file. For example it is possible to disable transparencies, control the shading of objects, etc.

As you have probably noticed from the screenshot above, the user interface is completely changed. It is now similar to ViewerSvg and Paste2Xaml. The process of user interface unification will eventually lead to a single application that could be used for all the supported file types. I also plan to include some great new features (but will not let you reveal my plans :)

Some of you will probably miss the 3D buttons that were used in the old Viewer3ds. No need to worry. I am going to prepare a sample with the same 3D buttons. It will be available with full source code so you could add the same functionality to your applications.

The Ab3d.Reader3ds library also had some improvements and bug fixes:

  • Fixed bug when reading spot lights.
  • Fixed Null reference exception when setting Default Material.
  • When applying smoothing groups or smooth shading, the texture coordinates are also remapped (before textures were not applied correctly).
  • Using new licensing model with improved evaluation. The new version has no fixed expiration date - instead library can be installed for a 60 days evaluation.

The new version is available from https://www.ab4d.com/Viewer3ds.aspx.

Tags: , , ,

Reader3ds

New version of ViewerSvg and Ab2d.ReaderSvg available

by abenedik 12. December 2008 19:30

I am happy to announce that the new version of ViewerSvg and Ab2d.ReaderSvg is available.

ViewerSvg

The new Ab2d.ReaderSvg library is now even better. The following is a list of new features and improvements:

  • Fixed resolving external references in svgz files.
  • Fixed positioning bitmap images.
  • Adjusted LinearGradientBrush to show correctly in WPF.
  • Added support for MappingMode in LinearGradientBrush.
  • Added reading elements inside switch element (before switch was skipped).
  • Improved evaluation mode.

ViewerSvg application has also been improved. Now it is using my ZoomPanel.

Most of the improvements are based on great user feedback. I am grateful for it. So if you find any file that is not read correctly you are most welcome to upload it on my Feedback page.

Unfortunately I did not have time to implement support for Geometry and its optimization as it is done in Ab2d.ReaderSvg. But this feature is very high on my priority list and will be surely implemented soon.

The new version is available from https://www.ab4d.com/ViewerSvg.aspx.

Tags: , , ,

ReaderSvg

New Ab2d.ReaderWmf support Drawing objects with advanced optimization

by abenedik 5. December 2008 00:45

I am really excited to inform you about new features of the new Ab2d.ReaderWmf v3.0 library.

Previous versions of Ab2d.ReaderWmf read metafiles and returned them as Shapes (Path, Polyline, Ellipse, etc.). This was great when you needed to manipulate separate objects or add some mouse events to objects. This flexibility with Shapes has its cost when complex objects are shown - the performance could be very poor and memory consumption very high.

WPF provides a much more efficient way to show more complex images with Drawing objects - objects that derive from Geometry class - DrawingGeometry, StreamGeometry, etc. The new version of Ab2d.ReaderWmf provides a ReadGeometry method that returns drawing objects (the Read method returns Shapes). And this is not all - it is possible to further optimize the drawing by using resources for similar Pens and Brushes and by combining geometries together..

The following two graphs show how the load time and the memory usage are decreased when optimized Drawing objects are used. Results are based on a complex dwg (AutoCAD) file that was converted to metafile and exported to xaml with Paste2Xaml with different export options.

geometry load time
geometry memory usage

The results show that it is possible that the load time decreases for more than 10 times and the memory usage for more than 5 times. This is especially true for metafile with lots of objects that have same pen or brush. The results are best on files created from AutoCAD or other CAD or vector drawing application. Cliparts and other types of metafiles also have significant performance improvement.

Heavy optimization of course has its side effects. If geometries are be combined, they cannot be manipulated individually. It is possible that with full optimization, some animalied appear on image. Because of this, it is possible to fine tune the optimization with lots of advanced options and find the right balance between usability and performance.

The following two screenshots show the new Paste2Xaml application and its new Export dialog:

Paste2Xaml
Paste2Xaml ExportDialog

And there is more new to show. The next new feature is support for building ResourceDictionaries from many metafiles. ResourceDictionaryWriter class can be used to simplify this job. And to make this even simpler there is also a sample application with full source code that on one side shows how to use the ResourceDictionaryWriter and on the other side provides really easy to use application to create ResourceDictionaries. The following image shows the ResourceDictionaryWriter application:

ResourceDictionaryWriter

The list of new features is not over. Here is also a GetXaml method that gets the xaml text of the last read metafile. This method is needed because the WPF's XamlWriter does not correctly write some elements and is also not useful for naming elements and writing ResourceDictionaries.

That is quite a bunch of new features, isn't it?

So to conclude. The new version of Ab2d.ReaderWmf library not only enables you to convert almost any image from almost any vector drawing application into xaml, but also enables you to choose between Shapes and optimized Drawing objects and also enables you to package all those objects into a ResourceDictionary.

The only thing left to say is to invite you to try the 60 days evaluation version. It is available from https://www.ab4d.com/Paste2Xaml.aspx.

Tags: , , ,

ReaderWmf