Tie Interceptor

Okay, many of you are Trekkies and not Star Wars fans, however there is no bias being shown by me here in this entry. Being a little bored at times and in need of some mental exercise, I decided to have a look at a product which I purchased a while back but still had not found time to have a look at – XAM3D from ERain.

The goal then of this blog is to create a 3D model of a Tie Interceptor without having to resort to writing any code. The full goals are:

  1. Gain experience in using 3D models within WPF and Silverlight.
  2. Provide an application with an interactive, fluid, and simple application that involved static and dynamic elements and utilised many of the dynamic features of WPF such as triggers and storyboards

To do this I required the following tools:

  1. ZAM 3D (here)
  2. Blender 3D Modelling (here)
  3. Inkspace (here)
  4. Expression Design
  5. Expression Blend

Of course I had to go and find a good 3D model in 3ds format, but there are plenty to choose from on the web. I went to a specific Star Wars site (James R. Bassett here) to get my Tie Interceptor.

Let us now have a look at the tools involved in the project.

ZAM 3D

Rather than write my text about ZAM3D I will quote a far better description from ERain themselves:

“ZAM 3D is a 3D modelling and animation product for developers leveraging Microsoft Corp.’s Windows Presentation Foundation (WPF) for Windows XP and Windows Vista.

 

ZAM 3D increases developer and designer productivity when building and customizing 3D interface elements for WPF-based applications by automatically generating the XAML markup necessary to create a WPF 3D scene. ZAM 3D enables easy creation, customization, and animation of 3D UI components and controls without the need to understand the XAML code that makes up a WPF 3D scene/control.

 

XAML files created with ZAM 3D can be directly integrated into your application development environment. ZAM 3D created XAML files use the WPF ‘Viewport3D’ class structure to draw and animate the 3D model or scene within the WPF, which is intended for simple 3D modelling and use. ZAM 3D is not intended for the creation of intense 3D modelling such as gaming.”

Blender 3D Modelling

 

Expression Design

This tool is becoming more and more a favourite of mine. It has been used here to prepare the paths for each of the selection items on the TIE Interceptor as well as processing the Sienar logo. The selection items were built on the same 2D models and copied out of Design for use in Blend for the finalised 2D models.

Expression Blend

The major work horse of this project and the one that pulls together all the artefacts together into the application. This is the tool where I do most of my work.

2D Model Production

Blender, although also a 3D modelling tool, was primarily used to produce the two 2D views, front and rear, of the TIE Interceptor. Here the TIE Interceptor 3ds model was read into Blender and, after rotating the model as desired, two raster images were produced. These images are shown below.

Front

Rear

Once produced these images had their backgrounds removed and replaced each with a transparent background. Rather than adding the star field backgrounds here I decided that cutting the indication shapes would be better achieved if I could better differentiate the TIE Interceptor from its background. Once that had been complete I then had an easier job when defining the selection items for the static 2D models. The above views were used

3D Model Production

Now is the time to fire up ZAM3D. The 3DS model can be directly using “File” -> “New from 3DS”. My model now appears similar to what is shown below.

To export the XAML use “File” -> “Export scene to XAML…” and the following export configuration dialog appears:

With a little bit of surgery on the resultant XAML file the ViewPort3D details can be extracted. These details can then be placed inside

Visual Styles and Fonts

I experimented with a number of font faces before I got the one I liked the best. The fonts were found here. The ones that I used here are “Sergeant TechnicFont 2” for the text and “Cyberspace” for the title.

I experimented a little with restyling Buttons, ToggleButtons and CheckBoxes. I settled for CheckBoxes as they would provide the grouping needed as well as a toggle for driving the two-state Storyboards for displaying the description and the selection paths. The off and on states are:

OFF

ON

 

Putting it all together

Using the styles and colours as well as the SVG Sienar Logo has really set the whole project off. BTW I got the logo from one of the Star Wars Wiki sites in SVG format. I loaded in Inkscape and exported the SVG as an XAML canvas and associated path. I then allowed myself the license to enhance the logo using Expression Design in line with my colour scheme.

The final rendered front and rear static views are:

Front

Rear

Now for a screenshot of the application:

Application Startup

Selecting the twin ion engine (this is where the TIE comes from by the way) the following is displayed:

 

Wrap-up, tips and tricks

I am very pleased with the way this project turned out. However, there are a number of things that need a better solution for if this was to be production code.

Firstly, there is no simple and easy way to control the 3D model using a keyboard and mouse. A better solution would be to use some sort of 3D-ball-mouse. I did not research too far but I am sure that there are some on the market and at a reasonable price.

A second device that might have been helpful would have been a drawing tablet of some sorts. As I am using Design more and more I should look into purchasing one of these.

Oh, by the way, those with keen eyes amongst you will have noticed there must have been one line of code written – the application close button in the top right corner has an event handler associated with the click event with in turn calls Application.Current.Shutdown(0). Alas, my goal was not reached….

That’s all folks…

Advertisements

~ by Intelligence4 on March 22, 2011.

 
%d bloggers like this: