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

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

Preview the 3D objects from 3ds files in Visual Studio Designer

by abenedik 3. December 2009 23:03

Did you guess it?

A new version of Ab3d.Reader3ds is available!

And it adds great support for showing 3D objects from 3ds file with using only XAML.

By the way, for those who do not know what 3ds is: 3ds is the most commonly used file format for storing 3D content. And Ab3d.Reader3ds is the library that enables you to bring all the 3D models stored in 3ds into the WPF's 3D world.

There are also some other improvements, but let me firstly show you the new XAML support. The following image shows one example of what is possible now:

Viewport3ds in Visual Studio Designer

The image shows that with only one control it is now possible to show 3D models from 3ds file. And it is also possible to see the preview in Visual Studio Designer.

The above code shows the 80th frame of the animation stored in "ab3d drop down.3ds" file. If you would like to play the animation the following can be used:

<controls3ds:Viewport3ds Source="ab3d drop down.3DS"
                         IsAnimated="True"
                         AutoRepeat="True"
                         AnimationDuration="0:0:10"/>

So you only need to set the IsAnimated property to true and the animation stored in 3ds file will be played automatically. It is also possible to set some other animation properties - in our example AutoRepeat and AnimaitonDuration.

This way it has become really easy to include animated 3D content inside WPF applications.

 

The Viewport3ds is just the most basic way to show the objects from 3ds files. For more advanced users it is now possible to use Model3ds and even Reader3ds in XAML.

The Model3ds is derived from ModelVisual3D. This means it can be used inside Viewport3D. The main advantage of Model3ds over Viewport3ds is that it support precise positioning and sizing of the shown model. Also with Model3ds it is possible to shown just one part of all the models inside the 3ds file. For example the following XAML shows only "Torus01" model from the 3ds file on a custom set position and with custom size:

<model3ds:Model3ds Source="multiple objects.3ds" 
                   ObjectName="Torus01"
                   SizeX="50" SizeY="30" SizeZ="40"
                   PreserveScaleAspectRatio="False"
                   Position="100 20 0" PositionType="BottomCenter"/>	

As with Viewport3ds, the results with Model3ds are also immediately visible in Visual Studio Designer. This way you can simply position and size the 3D element. You can also very easily mix the objects from 3ds file with the basic 3D objects available with Ab3d.PowerToys (for example box, plane, etc.)

This was just a simple sample of Model3ds. For more check out the samples that come with the Ab3d.Reader3ds library.

I have mentioned that now also Reader3ds class can be used in XAML. How is this possible? Until now the class was used in code to read 3ds files. But now it derived from DependencyObject. And this means it can be defined as Resource. For example:

<Page x:Class="Reader3dsSamples.Reader3ds.Reader3dsAsResource"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:ab3d="clr-namespace:Ab3d;assembly=Ab3d.Reader3ds"
    <Page.Resources>
        <ab3d:Reader3ds x:Key="MyReader3ds" Source="robotarm.3ds"/>
    </Page.Resources>
    <Grid>
        <Viewport3D Camera="{Binding Source={StaticResource MyReader3ds},
                    Path=Cameras[0]}">
            <ModelVisual3D Content="{Binding Source={StaticResource MyReader3ds}, 
                           Path=RootModel3DGroup}"/>
        </Viewport3D>
    </Grid>
</Page>    

The sample shown that because Reader3ds is defined as Page's Resource, it can be used in databinding. In the sample above the Content of the ModelVisual3D and the Viewport3D's Camera are databound to the Reader3d. And this is not all - it is also possible to bind to the Reader3ds NamedObjects dictionary, to Materials dictionary, Cameras list, etc. (see samples with library for more).

 

As I have already mentioned, the new XAML support is not the only improvement of the Reader3ds.

The 3ds reading engine has been also improved.

Now all the known problems from my very big list of 3ds files (collected with your help also) have been solved.

I have finally managed to find a way to correctly read some 3d objects that were defined with using left-handed coordinate system instead of right-handed one (usually mirrored objects).

Texture mapping is also improved (before some Textures were not placed correctly - in this version I have added DisableTextureOffset property - by default it is true to fix the problems).

Fixed "Object reference not set ..." exception when reading some 3ds files.

Also added support for textures in tif file format.

 

So now if it looks like Reader3ds or Viewer3ds did not correctly read the 3ds file, please try to open the 3ds file in a 3D modeling application. In almost all the cases the problem is in the 3ds file and not in the Reader3ds. Usually the 3ds file was not correctly exported - probably because you used some advanced features like bones animations, but 3ds file is quite old and cannot store those data. I know, many of you are waiting for some other 3D file format readers - I will make some in the next year for sure.

All of the features of the Ab3d.Reader3ds library still work on .Net Framework 3.0. For performance reasons it is highly recommended that you use .Net 3.5 SP1, but if you develop for .Net 3.0 you still can. But probably the next version will alredy require the 3.5 SP1.

 

After reading about all the new features, I am sure you agree that the Reader3ds deserved the increase of the version from 5.3 to 6.0.

I also hope that you agree that programming with 3D was never easier!

 

R2D2 3D model read with Reader3ds

 

As always the new version can be downloaded from my Downloads page.

Tags: , , ,

Reader3ds

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