Solution for problematic 3ds files exported from 3ds Max 2013

by abenedik 24. August 2012 09:17

Recently some customers reported that they have problems with reading some 3ds files with Ab3d.Reader3ds and Viewer3ds.

After investigating the files I have found out that the material names were not correctly written - only the first character of the material name was written to the 3ds file. For example instead of "Wood" only "W" was written as material name. In 3ds file, materials are defined first. After materials 3d objects are defined. Each object defines the used material by its name. In the broken files the full name was used - for example "Wood". But because the materials were defined by wrong names, the objects did not get the materials assigned. This problem was common in all the broken files I got recently. In some of the files there were also some other problems that broke the structure of 3ds file so much that only a first few objects could be read.

Soon we have found out that all the files with the above symptoms were exported from 3ds Max 2013. Previous versions of 3ds Max created valid 3ds files, but some changes in the new version broke the exported 3ds files.

After some search on the internet, a fix for that problem was found. It can be downloaded from:

http://area.autodesk.com/forum/autodesk-3ds-max/autodesk-3ds-max--3ds-max-design-2013/max2013-3ds-importexport-modules-fixedrecompiled

 

Until an official fix from Autodesk, I recommend applying this fix. It was tested from some of our customers and they confirmed that the problems were gone after installing it.

The new version of Viewer3ds (published yesterday) can also detect the problematic files and based on the above symptoms can alert the user that the file was probably exported from 3ds Max and that a fix should be applied.

 

UPDATE:

This problem has been fixed by an official 2013 PU6 update.

See more: http://forums.autodesk.com/t5/3ds-Max-3ds-Max-Design-General/Max2013-3ds-Import-Export-modules-fixed-recompiled/td-p/4254875

Tags:

Reader3ds

New release brings improved products, added .Net 4 assemblies and better installer

by abenedik 23. August 2012 22:23

This release brings the following:

-    improved installation on 64 bit Windows
-    added .Net 4 assemblies
-    improved Ab3d.PowerToys, Ab3d.Reader3ds and ZoomPanel libraries



The new installer has been improved to work better on 64 bit windows. Now the products are no longer installed under “Program Files (x86)” folder, but under “Program Files”. All the products are built with “Any CPU” setting and therefore do not need to be in the folder where all the “old stuff” is. Note that if you were referencing our products from the x86 folder, you will need to update the path to our products.

All the products now also contain assemblies that are built on .Net 4.0 Client Profile framework. When building .Net 4.0 applications, you can now reference native .Net 4 assemblies. Before you had to reference original .Net 3.0 (Ab3d.Reader3ds, Ab2d.ReaderSvg, Ab2d.ReaderWmf or ZoomPanel) or .Net 3.5 SP1 (Ab3d.PowerToys) assemblies. This was not a problem because the 4.0 CLR runs the assemblies on previous target frameworks natively inside 4.0 CLR (without running them in some kind of virtual machine). So it was already possible to use our libraries on machines where only .Net 4.0 is installed. Anyway time goes on and now almost all new applications are built on 4.0 so I decided to prepare native builds for that framework. Of course the original 3.0 and 3.5 assemblies are still available. Original assemblies are inside bin folder as before. The new assemblies can be found inside bin\.Net 4 folder.


Because all our products except Ab2d.ReaderWmf are using AllowPartiallyTrustedCallers assembly attribute, I had to take a closer look at the security critical sections of the code and add some security related attributes on some methods. This made the code .Net 4.0 compliant.

Note that the Viewer3ds, ViewerSvg and Paste2Xaml applications were not ported to .Net 4.0 and still requires older framework to run (older applications cannot run inside 4.0 CLR - only assemblies can be used inside 4.0 applications).

 

As mentioned before some of the products were also improved.


ZoomPanel library got improved ZoomPanelMiniMap control. Here controlling ZoomPanel with moving rectangle around was improved (before movements were slow). In the previous version it could happen that when a content of ZoomPanel was changed from a big to a much smaller content, than the new image in ZoomPanelMiniMap was too small. This is fixed now.

Ab3d.Reader3ds library also got a few improvements. Most of the work there was done to improve reading of broken 3ds files. Because 3ds file is very old and very commonly used, there are many applications out there that can export to that file format. Unfortunately not all of them create valid 3ds files. I got some of such files. Most of them were so screwed that it was not possible to import them into 3D Studio Max (invalid file format error was shown). Despite that there were still some valid data inside those files. And the new version tries to read as much from them as possible.

In case when a broken 3ds file is read with Reader3ds, you will still get FileFormatException (when reading with default settings). But now you can catch the exception. Than you can warn the user about problematic file and if the user wants to read the file anyway, you can set the new TryToReadBrokenFiles property on Reader3ds to true and read the file again. You can also have that property always true and just check the IsBroken property after reading 3ds file. Both those options are also used in the new version of Viewer3ds.

One nice new feature of Viewer3ds is showing object’s bounding box, triangles and normal. This is very useful in finding the cause of the problems in some 3D objects that do not look correct. Because Viewer3ds uses powerful 3D lines capabilities of Ab3d.PowerToys library this was an easy task to do. The following screenshot shows that new feature:

Viewer3ds: Showing details of selected object - bounding box in red, triangles in green and normals in blue.

The longest list of new features for this release belongs to Ab3d.PowerToys library. Today I will just write short descriptions of new features. In one of the following posts I will discuss some of them in more details. So the improvements are:
-    Improved LinesUpdater performance and removed possible memory leaks.
-    Added Reset method to LinesUpdater that takes Viewport3D as parameter to reset (remove all lines) only from specific Viewport3D.
-    Added HeightMapVisual3D and HeightMapMesh3D (with two very nice samples)
-    Added TubeMesh3D, TubeVisual3D and TubeUIElement3D.
-    Added support to very easily create 3D curves: added Ab3d.Utilities.BezierCurve and Ab3d.Utilities.BSpline classes; also added CreateBSpline3D and CreateNURBSCurve3D to Line3DFactory.
-    Added MouseWheel event to EventManager3D – now you can subscribe to MouseWheel event on any Model3D object.

Ab3d.ReaderSvg and Ab2d.ReaderWmf libraries did not get any new features of fixes. But they also got new versions (with same major and minor version but increased build version) because of new .Net 4.0 assemblies and small changes that were needed in the code to make the code 4.0 compliant.

Tags: , , , ,

Ab3d.PowerToys | Reader3ds | ReaderSvg | ReaderWmf | ZoomPanel

Maintenance releases for all products are now available

by abenedik 24. February 2012 22:13

I am happy to announce that maintenance releases are now available for the following products:

  • Ab3d.Reader3ds and Viewer3ds
  • Ab3d.PowerToys
  • Ab2d.ReaderSvg and ViewerSvg
  • Ab2d.ReaderWmf and Paste2Xaml
  • ZoomPanel (evaluation version only)

 

Everybody that are using evaluation version will be happy to know that new evaluation versions of all the products now show the evaluation information dialog only once per day. Previous versions show evaluation information dialogs on each start of your application. If two or more controls were used (for example ReaderSvg and ZooomPanel) than each time you started your application two dialogs were shown. This was too annoying and is now lessened so the dialogs are shown only once per day.

Another important change in evaluation version allows you to reinstall evaluation version (the same version or newer) after 90 days from the date of installing previous evaluation version. The 60-day evaluation time limit is still the same. But with previous versions you need to contact support to extend the evaluation version after 60 days. This was not very practical when you tried an older version before some time and at that time you did not need the library or it did not have all the features you wanted. But after some time you decided to try with the new version and you were not able to install the evaluation because it has already expired. Now this is not the case any more because after 90 days you can reinstall the evaluation version again. Note that when reinstalling the same version it is recommended to uninstall it before installing it again. There is still 30 days between evaluation expiration and possibility to reinstall after 90 days - this is left to prevent continuous use of only evaluation version. But if you need to extend the 60-day period you can still contact support to extend your evaluation.

 

Of course there are also some other improvements and new features that apply for both evaluation and commercial version.

Let me start with Ab2d.ReaderSvg (and ViewerSvg). The changes in new version are:

  • Improved reading size of root svg object (improved support for viewBox and added support for preserveAspectRatio).
  • The GetXaml method now preserves the width and height in specified units (cm or inch).
  • Removed memory leak that occurred sometimes when reading embedded images.
  • Improved reading embedded images - they are now read faster and with lower memory usage.
  • Fixed problems when Path bounds were negative and IsSizeSetToPathElement in SilverlightXamlWriterSettings was set to true.
  • Prevented adding PresentationOptions:Freeze="True" text to XAML for Silverlight.
  • Added option to export for Silverlight 5.
  • Fixed reading svg file that contain links to images and were read without specifying the whole path (Read method was called only with svg file name without the full path).

 

Ab2d.ReaderWmf got the following changes:

  • Fixed leaking GDI+ handles under some circumstances. This could lead to "Cannot open wmf file!" exception after opening a few thousands metafiles.
  • The Read and ReadGeometry methods that take stream as parameter now read the metafiles directly from the stream and do not create a temp file from stream as before.

 

Changes for Ab3d.Reader3ds:

  • Improved reading textures in Model3ds and Viewport3ds. Added TexturesPath property to both controls - it can be used to specify custom textures path. If TexturesPath is not specified, the path of the 3ds file is used.
  • Added support for cameras that are children of helper objects (for example when camera is linked to a helper object so the camera is transformed as the helper object).
  • Fixed setting IsCameraAnimated property - Reader3ds sets this property to true if the 3ds file contains camera animations. Before the property could be set to true in cases when the camera was not animated.
  • Added ReadLightRange property to Reader3ds. Before the Range of PointLights and SpotLights was not read. Now it is possible to read the Range with setting ReadLightRange to true. Note that attenuation data are not present in the 3ds file - if they are used they need to be manually set to lights after the 3ds file is read.

It is also worth noting that with new version of Viewer3ds all the cameras defined in 3ds file are exported as comments in xaml. The xaml also get a description of the exported cameras. This makes switching between cameras defined in 3ds file very easy.

 

There are also a few improvements for Ab3d.PowerToys:

  • Fixed rotating with MouseCameraController and CameaControlPanel when the scene in vertically inverted when Attitude is between 90 and 270 degrees.
  • Fixed EventManager3D where under some circumstances a new object drag can be automatically stared just after end drag event.
  • Improved MaterialTypeConverter: Added support for simply defining SpecularMaterial and EmissiveMaterials. For example the "s:32;Blue" text can be used to define MaterialGroup with DiffuseMaterial and SpecularMaterial (SpecularPower = 32; SpecularBrush = White; DiffuseMaterial = Blue). The "e:Yellow" can be used to show yellow emissive material. Also improved support for defining textures path (now files from local disk and from http can be used).
  • Fixed occasional NullReferenceException in SphericalCamera when layout is updated in Visual Studio designer.

 

The commercial version of ZoomPanel was not updated.

 

I would like to conclude the blog post with something completley different - a new logo for the company AB4D d.o.o.

ab4d logo

I got the new logo from a design contest that run on 99designs.com. I was really satisfied with the contest and would really recommend that page to everyone. We are also making a redesign of the web page that will be available soon.

We are also preparing a very interesting new product (but more on that later).

I surely believe that the future is very bright for the company. I hope that our products will also make it brighter for you.

Major update of 3D libraries available

by abenedik 21. October 2011 22:50

I am really happy to announce that a new major release of Ab3d.Reader3ds and Ab3d.PowerToys libraries has been released.

The key features of this release are:

  • Added transparency sorting that prevents problems with transparent 3D objects in WPF.
  • Improved reading of some 3ds files.
  • Simplified animating camera rotations.
  • Added support for OrthographicCamera.
  • Improved commercial licensing code.

 

Before describing some of the key features in more details let me first give you the full list of changes.

Ab3d.Reader3ds v8.0:

  • Added support for simple transparency sorting that can prevent most of the problems with transparent objects. If the new IsTransparencySortingEnabled property is true (by default) the transparent objects are moved after non-transparent objects. For complex models with many transparent objects use of advanced transparency sorting in Ab3d.PowerToys is needed. Also added TransparentObjectsCount property to Reader3ds (so user can decide if he need to enable transparency sorting or not - with Ab3d.PowerToys).
  • Added NameFormatString to BaseXamlWriterSettings - it can be used to customize how the object names are written to XAML (custom prefixes and suffixes can be added to names).
  • Added possibility to read tga into BitmapImage with static Read method in a new Ab3d.Common.TgaReader class. Note: The previous versions of Reader3ds already supported reading tga files. But it was not possible to read tga files in your applications. This is now possible and enabled you to convert tga images to common files (for example png) that can be used with xaml created from 3ds file). This feature is available only in pro version.
  • Fixed reading some of the objects with object matrix that has negative determinant.
  • Fixed using ForceTwoSidedMaterials property for models that does not have material defined and where the default material is used.
  • Fixed objects without material set (default material is used) and with object matrix that has negative determinant.
  • Fixed when object with negative determinant is broken into sub objects for different materials - the parent's negative determinant was not used before.
  • Fixed reading 3ds file where definition of two sided material is written outside material chunk.
  • Fixed reading some partially broken 3ds file (objects with invalid triangle indices are not shaded).
  • Skipped importing 3D objects that does not have triangle indices set (have only positions set).
  • Fixed security exception in partially trusted WPF Browser applications - before the multi-treading code was not able to get the number of processors on the system.
  • Improved commercial licensing code to prevent delay caused in RSACryptoServiceProvider under some circumstances.
  • Added Ab3d.Licensing.PowerToys.EmbeddedLicenseAssembly property to speed-up looking for embedded license key in commercial version.

Ab3d.PowerToys v3.0:

  • Added support for transparency sorting with new TransparencySorter and TransparencyHelper classes.
  • Simplified animating camera rotation with new StartRotation, StopRotation methods on SphericalCamera. There is also a new IsRotating properties. The MouseCameraController is also adjusted to suspend animated rotation while user rotates the camera with the mouse.
  • Added axes names to CameraAxisPanel. Also added IsAxisNameShown, XAxisColor, YAxisColor and ZAxisColor properties to CameraAxisPanel.
  • Added support for OrthographicCamera for all Ab3d.PowerToys Cameras. Added CameraType and CameraWidth properties to BaseCamera.
  • Greatly improved creating wireframe from existing 3D models - now it is much faster and uses much less memory.
  • Improved LinesUpdater - the lines that are removed from the visual tree are now free to be cleaned by garbage collection.
  • Added Reset and UnregisterLine methods to LinesUpdater to manually remove lines from LinesUpdater. This enables better manual control of the registered lines.
  • Improved measuring scene bounds in SceneCamera when transformations are used on Visual3D objects. Before the used transformations prevented the camera to correctly show the scene.
  • Fixed selecting cameras with mouse click on camera icon in Visual Studio 2010 designer.
  • Added GetCameraMatrixes to BaseCamera to get view and projection Matrix3D of the current camera.
  • Improved Ab3d.Utilities.Dumper class - Added GetTransformText and GetMatrix3DText methods and made GetMaterialText public. Also the GetModelInfoString method now also displays the Transformation details.
  • Improved commercial licensing code to prevent delay caused in RSACryptoServiceProvider under some circumstances.
  • Added Ab3d.Licensing.PowerToys.EmbeddedLicenseAssembly property to speed-up looking for embedded license key in commercial version.

 

TRANSPARENCY SORTING

WPF 3D can show transparent 3D objects. But to show them correctly, the transparent objects need to be defined after all the objects that are visible through them.

The following image shows the transparency problem in a simple 3D scene. Because the red boxes are defined after the semi-transparent GlassPlane they are not visible through the GlassPlane (the order of objects is visible in the right):

WPF 3D transparency problem

To solve the problem, the GlassPlane needs to be moved after the non-transparent objects. The following image is showing the correctly rendered scene.

Solved WPF 3D transparency problem

For cases when the number of transparent objects is not big and if the transparent objects are not positioned in 3D space one after another, the simple transparency sorting is usually enough to produce correct rendering in WPF 3D.

But simply moving transparent objects after non-transparent objects is not always enough. For example if transparent object A is visible through transparent object B, than B must be defined after A. The problem in this case occurs when the camera is rotated so that B is visible through A. Now B must be defined before A. To solve this problem correctly, firstly the transparent objects must be moved after non-transparent objects and than transparent objects must be sorted by their distance to the camera. The sorting must be done after the camera is changed.

As seen from the new features lists above, both Ab3d.Reader3ds and Ab3d.PowerToys now support transparency sorting.

Ab3d.Reader3ds can perform a simple transparency sorting by moving transparent objects after non-transparent objects. Transparency sorting is performed if the IsTransparencySortingEnabled is set to true (by default). It is also possible to get the number of transparent objects by the TransparentObjectsCount property. Ab3d.Reader3ds does not do any sorting by camera distance. For this the Ab3d.PowerToys library is needed.

With Ab3d.PowerToys library it is possible to perform simple transparency sorting and sorting by camera distance. TransparencySorter class can be used to perform simple transparency sorting or ByCameraDistance transparency sorting where the transparent objects are sorted by their distance to the camera.

Simple transparency sorting (moving transparent objects after non-transparent objects) can be done with the following line:

Ab3d.Utilities.TransparencySorter.SimpleSort(myModelsGroup);

When sorting by camera distance is used, the TransparencySorter can also automatically re-sort the objects when the camera is changed. To optimize the sorting it is possible to specify an angle that will tell how much the camera's direction must be changed when a new sort is preformed.

To perform transparency sorting by camera distance the following lines of code can be used:

private TransparencySorter _transparencySorter;
 
private void StartTransparencySorting()
{
    _transparencySorter = new TransparencySorter(_rootModel3DGroup, Camera1);
     
    // Re-sort on every 10 degrees change
    _transparencySorter.CameraAngleChange = 10; 
 
    // Do an initial sorting
    _transparencySorter.Sort();
 
    _transparencySorter.StartSortingOnCameraChanged();
}
 
private void StopTransparencySorting()
{
    if (_transparencySorter != null)
        _transparencySorter.StopSortingOnCameraChanged();
}

For more code samples see the samples that come with Ab3d.PowerToys library.

The following images show rendering of the objects before (left image) and after (right image) transparency sorting:

WPF 3D transparency problem

WPF 3D transparency problem

IMPROVED READING OF 3DS FILES IN AB3D.READER3DS

Ab3d.Reader3ds went through a big test with our bigger customer. Many real world 3ds files were used to test the accuracy of the reader. Because many test files were not created with 3D Studio Max or similar product, many of them were not correctly formatted (it was not possible to open them with 3D Studio Max). After some changes in Ab3d.Reader3ds mst of those "broken" 3ds file can now be read correctly. This made the library even better and proved its status as the best library for importing 3ds files.

IMPROVED COMMERCIAL LICENSING CODE

The last relase of Ab2d.ReaderSvg, Ab2d.ReaderWmf and ZoomPanel library already got improved commercial licensing code. The change fixed a potential issue with using RSACryptoServiceProvider that can lead to very long delays when checking the license key. This issue has been now fixed for Ab3d.Reader3ds and Ab3d.PowerToys. Because of this issue it is highly recommended to upgrade to the new version.

Additionally as with the 2D libraries it is now possible to set the EmbeddedLicenseAssembly property to speed up finding the embedded license key in the application.

To see more details about this change please see the blog post for the 2D libraries or check the new help files.

OTHER IMPORTANT AB3D.POWERTOYS IMPROVEMENTS

A very useful new features of the Ab3d.PowerToys library simplifies creating animated camera rotations. Before animated camera rotations were created with binding a DoubleAnimation to Heading property of the camera. But using DoubleAnimation has its drawback because it the animation locks the value of the Heading and therefore makes rotating the camera with the mouse impossible.

The new version now include the StartRotation and StopRotation methods that can be used to simply start the camera animation. The StartRotation method takes two parameters: the first is heading change per second, the second is attitude change per second. The best thing about this is that while the camera is animated with StartRotation method, user can still use the mouse to rotate the camera (during mouse rotation the animation is suspended). This way it is very easy to create great presentations of 3D models where the model is rotated and the used can still manually change the rotation with the mouse.

One of the very requested feature was also a support for OrthographicCamera. It is mostly used in technical applications where the ratios and parallel lines of the 3D objects need to be preserved. The OrthographicCamera is now also supported.

A very nice new feature is also that axis names are shown on the CameraAxisPanel (it shows the orientation of axis of the current scene).

A lot of work was also done to improve 3D lines. Now wireframes from existing 3D objects are created much faster and also use much less memory. Also the memory management of the 3D lines is greatly improved and enables user to have more control of the registered 3D lines.

 

With new features the development of applications with 3D content has become even easier.

WPF 3D is very capable of displaying 3D content for most needs of business applications. It also has many advantages over other platforms (DirectX, XNA). With WPF 3D, Ab3d.PowerToys and Ab3d.Reader3ds programming with 3D was never easier.

I would like to conclude with saying that in my opinion desktop applications will not just sink into oblivion. They will still have their big share with complex business applications that need to be very user friendly, need advanced user interfaces to simplify complex user processes or require lots of resources. Despite many (usually not developers but marketing driven) considerations, I believe that WPF is still the very best technology for writing such applications.

Tags:

Ab3d.PowerToys | Reader3ds

New maintenance release with many improvements for metafile reader

by abenedik 20. April 2011 23:42

This release brings many improvements to almost all our products.

The metafile reader (Ab2d.ReaderWmf) library got most of the changes. The svg reader (Ab2d.ReaderSvg) also got a few new features. There were also some improvements that affected all the products except ZoomPanel. ZoomPanel control was left out of this release because the library is waiting for a major upgrade. Now when this release is out I will finally start working on it (many things are already prepared - like mini map, rotate the content, zoom slider, etc. - they just need to be polished and tested).

Let me first describe the changes that affected all the products (except ZoomPanel):

  • The licensing dialogs are now created in WPF and not in Windows Forms as before (this skips loading Windows Forms and other related assemblies and therefore speeds up the application start - especially in evaluation version).
  • Improved commercial license code that tries to find embedded resources - this code is now much faster.
  • Added splash screens to all of the converter applications.

Besides the changes above the Ab3d.Reader3ds and Ab3d.PowerToys libraries did not get any new features.

 

But as mentioned before the Ab2d.ReaderWmf library was improved quite significantly. The code that transformed positions data from metafile into WPF was rewritten from ground up. The new version now enables to specify in which units the read positions will be - they can be in Pixels, Millimeters, Inches or GdiCompatable units. This can be useful when the drawing for example in Microsoft Visio is created in millimeters, the WPF elements that are created with pasting the drawing into Paste2Xaml can be also defined in millimeters. When the default Pixel units are used, the size of the read metafile is now the same as the size that is shown when the metafile is opened by Windows.

This is the list of changes in Ab2d.ReaderWmf library:

  • Added MetafileUnits property. It specifies the units in which the metafile is read. By default its value is set to Pixel. It can be also set to Millimeter, Inch or GdiCompatable. This can be useful to preserve the positions and other properties when the drawing is created in millimeter or inch units.
  • Added AutoSize property - defines if size of the root canvas is get from metafiles bounds or its frame. When bounds is used, the root canvas size is just as big as its containing objects.
  • Added GetSize(units) method that can be used to get the size of the read metafile in the specified units.
  • The size of the read metafile is now by default (if MetafileUnits is Pixel) the same as the size shown when metafile is opened by Window.
  • Improved reading metafiles that use MM_LOMETRIC, MM_HIMETRIC, MM_LOENGLISH, MM_HIENGLISH or MM_TWIPS mapping mode.
  • When reading polyline from a metafile and it has only 2 points a Line is used instead of a Polyline.
  • Added UsedMinLineWidthFactor to get the used minimal line width.
  • Improved Ab2d.Utility.ReaderWmf.ResourceDictionaryWriter - now the process of creating ResourceDictionary from metafiles can be better customized by creating a derived class.
  • Removed obsolete Ab2d.WmfViewbox control - the control has been obsolete for a few versions - Ab2d.Controls.WmfViewbox should be used instead. This also removes the need for Designer assemblies to remove the obsolete control from Designer ToolBox.

The Paste2Xaml application that can be used to simply copy objects from drawing application and paste them into XAML was also improved - support for the new features of the Ab2d.ReaderWmd library was added.

 

Some of the changes were also made in Ab2d.ReaderSvg library:

  • Markers (arrows and other line endings) are now correctly show on line and polyline elements (before they worked only on path elements).
  • markerWidth and markerHeight attributes are now correctly handled.
  • Removed obsolete Ab2d.SvgViewbox control - the control has been obsolete for a few versions - Ab2d.Controls.SvgViewbox should be used instead. This also removes the need for Designer assemblies to remove the obsolete control from Designer ToolBox.

 

Now I have to put together the new version of ZoomPanel.

Than a new exciting area awaits - Silverlght 5 with its 3D.

Tags: , , ,

Ab3d.PowerToys | Reader3ds | ReaderSvg | ReaderWmf

New maintenance release for Ab2d.Reader3ds and Ab3d.PowerToys

by abenedik 3. March 2011 21:37

A minor update for Ab2d.Reader3ds and Ab3d.PowerToys libraries is available.

The update fixes licensing code for WPF Browser applications (partially trusted) - before it was not possible to use both Ab3d.Reader3ds and Ab3d.PowerToys the same WPF Browser application.

The update also fixes problems with reading some tga files with Ab3d.Reader3ds. Because some older 3ds files use tga files for textures quite often, the internal tga file reader was added to version 7.0. This version had problems with some tga files. This problems are now fixed.


Some of you have already noticed that the evaluation version has a brand new installer that enables installing any product from only one installer (before each product has to be installed separately). With the new versions the new installers are now available also for commercial products.

Because of the new installers there are also new commercial versions of Ab2d.ReaderSvg and Ab2d.ReaderWmf libraries available to commercial users. Those versions contain just small changes made for the new installation process and do not bring any new functionality.

Tags: , ,

Ab3d.PowerToys | Reader3ds

New versions of 3D libraries bring WPF 3D to a completely new level

by abenedik 16. December 2010 18:19

With the release of Ab3d.Reader3ds v7.0 and Ab3d.PowerToys v2.0 a new milestone in 3D programming was reached.

The first version of WPF brought us simplified programming with 3D. With WPF there is no need any more to deal with C++, DirectX and graphics drivers. Now programmers can use xaml and managed code to define the 3D scene. Besides this WPF can use high end graphic cards when they are available and can fallback to software rendering when the computer does not have an accelerated graphics.

Of course WPF does not provide all the features of DirectX, so it is not capable of running high end 3D games. But my customers have already proven that it is very capable of showing very complex 3D scenes with models with several hundred thousands triangles.

But WPF still lacks many features to make programming with 3D easy.

Now with Ab3d.Reader3ds and Ab3d.PowerToys users have the ultimate framework to work with WPF 3D.

The Ab3d.PowerToys includes advanced cameras, camera controllers (rotate and move the camera with the mouse, etc.), 3D objects (Box, Sphere, Cone, etc.), 3D lines, 3D text and classes to simplify using mouse events on 3D objects.

With Ab3d.Reader3ds and Viewer3ds it is possible to define 3D models in almost any 3D modeling application (3D Studio Max, Maya, AutoCad, etc.), save the objects into 3ds file and use the 3D models in your WPF application.

The libraries gives you a complete solution for:

  • creating monitoring systems with 3D models,
  • displaying 3D simulations and mathematical models,
  • displaying 3D models of your products or prototypes,
  • creating designing and configuration applications in reality-like 3D scenes,
  • creating interesting 3D effects,
  • etc.

 

That was a short overview. Now to the details about the libraries and more information about new features.

Viewer3ds

The new version of Viewer3ds application (3ds to xaml converter) that comes with Ab3d.Reader3ds library brings many new improvements.

The application is now using the Ab3d.PowerToys library. Therefore it was really easy to add camera rotation and movement. Among other changes I would also like to mention the new possibility to get detailed information about selected objects (sizes, materials, detailed mesh information, etc.).

 

The Ab3d.Reader3ds library also got many improvements.

The biggest enhancement is great performance improvement - because of optimized algorithm and multi-threaded processing some 3ds files are read 80% faster. But reading some very large 3ds files can still take a few seconds. To improve user experiance it is now possible to get progress reports while reading the file. The samples that came with the library demonstrate how to show progress window on another thread or read the 3ds file on another thread and show the progress on the main thread.

Let me also mention some other important changes:

  • Improved handling of texture files with simplified notifications about missing texture files.
  • Added GetXaml method to Reader3ds class to get formatted xaml text of the read 3ds file.
  • Improved reading FiledOfView and SpecularMaterials.
  • Improved support for running in partially trusted environment.
  • Added Lights collection.

Complete list of changes can be seen here.

 

Viewer3ds

I am really proud of the features and capabilities the Ab3d.PowerToys library. They really bring WPF 3D to a completely new level.

The library makes Visual Studio a simple 3D modeling application as all the 3D objects and cameras that are defined in xaml are immediately seen in designer window. This way it is very easy to arrange the objects, set camera or otherwise define the scene.

Already the previous version of the library had advanced cameras (SceneCamera, FirstPersonCamera, ThirdPersonCamera) that enable setting the camera with simply setting heading, attitude and bank angles and defining some other properties like distance. The cameras can be simply rotated with the mouse or camera control panel. The new version goes further with enabling moving the camera. Now any camera can be rotated and moved around. And it is possible to assign rotation and movement of the camera to any mouse button and to any keyboard modifiers. For example the following two lines of xaml add a SceneCamera to the scene and enable rotationg the camera with right mouse button and moving the camera with right mouse button and alt key pressed:

<cameras:SceneCamera Heading="30" Attitude="-20" Distance="200"/>
<ab3dControls:MouseCameraController RotateCameraConditions="RightMouseButtonPressed"
                                    MoveCameraConditions="RightMouseButtonPressed, AltKey"/>

The previous version of Ab3d.PowerToys already included many basic 3D objects (Box, Sphere, Cone, etc), 3D Lines and simplified mouse event handling on 3D objects.

Besides improved cameras the following are the main improvements of the new version:

  • Added support for 3D text.
  • Improved PolyLines - they are now correctly connected to each other.
  • Added MultiMaterialBox where each side of the box can have its own material.
  • Added CreateFrom method to all Ab3d.Cameras - it can be used to create any Ab3d.Camera from existing WPF's Camera (or camera read from 3ds file with Ab3d.Reader3ds).
  • Added CameraAxisPanel - a predefined panel that shows the axis orientation for the target camera.
  • Added RectangleVisual3D, WireBoxVisual3, WireCrossVisual3D, VerticalPlaneVisual3D and LineArcVisual3D.
  • Added IsVisible property to all 3D models derived from Visual3D.
  • Added CreateWireframe method that takes Model3D to create wireframe from Model3DGroup or GeometryModel3D.
  • Fixed for using in partially trusted environment - before creating custom cursor was not allowed - now a Hand cursor is used instead.
  • BREAKING CHANGE: Fixed Bank - now the positive bank values rotate the camera in the clockwise direction (before the direction was counter-clockwise). For example bank angle 30 means that the Camera is rotated as a head would be bended to the right.

The complete list of changes is really long - it can be seen on Abd3.PowerToys web page.

 

A quick preview of cameras and 3D objects can be seen from two cheat sheets (prepared with WPF; full source code is included with the samples that come with the library):
Cameras cheat sheet
Cameras cheat sheet


Objects cheat sheet
3D Objects cheat sheet

 

The following are a few screenshots (click on xaml link to see the xaml source code):

[xaml] [xaml] [xaml]
 
 
[xaml] [xaml]  

 

To see more screenshots and details about the library see Abd3.PowerToys web page.

 

Ab3d.Reader3ds and Ab3d.PowerToys are separate products, but when the Ab3d.Reader3ds pro library license is purchased, the price for Ab3d.PowerToys library is ONLY 1 USD.

 

I am already planning to add a few new exciting features to the library. If you have any recommendation and other comments you are most welcome to post them to the library’s forum.

 

As usual the new version can be downloaded from User Account page (for commercial users) or from my Downloads page (for evaluation version).

 

PS: For the customers of Ab3d.Reader3ds with expired updates subscription I am preparing a very special offer to renew the subscription – detailed information will be sent to your email in the following days.

Tags: , , , ,

Ab3d.PowerToys | Reader3ds