Silverlight 3DSMax Exporter – Update

The exporter is coming along nicely.  I’m really happy with the results.  So much so that I decided to create a Q*Bert scene.  Click on the image blow for the full sized image.

qbert

In the image you have 3DSMax in the background with all it’s wireframe goodness.  The render on the right, and as you can see, the Silverlight output in Firefox on the left.

Features in the short term will be more .NET features, as full scene rotation would give fantastic interactivity, and open up the door for useful Silverlight transitions.  Texture mapping is another one I want to look at, mainly focusing on texture scaling and offset.

Read More

Silverlight 3DSMax Exporter

Silverlight 3 comes with the new shiny Projection and PlaneProjection for perspective 3D effects.  One issue is to create rich 3D environments, you need a good toolset, and although Blend is a great tool, it’s not a 3D authoring environment.

Enter 3DSMax.  3D Studio has an awesome scripting capability in the form of MaxScript.  Writing 3DSMAX exporters is a past time of mine, and having had a conduit to John Wainwright (aka Mr MaxScript) at that time I became very fond of 3DSMax and MaxScript.  But here ends the history lesson.

The main aim of the Silverlight 3D Studio Max exporter is to create a pipeline for 3D authoring, through to Silverlight in browser, and convenient stops in between.  It shouldn’t ignore or outcast Visual Studio or Blend (or Photoshop etc), and should not replace them.  But where as Visual Studio is a coding environment, Blend an awesome behavioural and layout authoring environment, neither are good 3D authoring environments.  The Silveright 3DSMax Exporter hopefully will fill that gap.

So first up, lets take the following image.

blue

In the screenshot below I’ve taken the above image, applied it as a textures to planes (rectangles), replicated them helix/spiral paths in various directions, textured, translucent, with a blue environment background.  This process took about 2 minutes.

3dsmax_and_render

You can see in the image above the front perspective wireframe, the render, and an angled perspective view showing the planes along the various paths.

But with a click of a button, this 2 minutes of work gets exported to XAML in a second.  Alt tab to Blend (Visual Studio doesn’t like ImageBrush for some reason) and voila, instant 3D.

blend

Note that the background is actually blue, but Blend doesn’t stretch it to the full view by default.  A quick stop over in Visual Studio and every object is named and available in Intellisense.

intellisense And the real test, taking it to the the browser.  Firing up Firefox gives us…

firefox

So in 2 steps, 1) Export, 2) Build, we have a 3D Studio scene in Firefox.

Currently in v0.001 pre alpha, but I thought I’d post some information about what I’ve been working on.  But it truly is 1 click, 1 build.  No smoke, no mirrors.

So what features does it currently have?  For the time being I’m focusing on only 1 shape, being a rectangle.  Simple shape rotation can be done in Blend.  Max is for full scene creation.  Shapes are the easy part, and the hard part is getting coordinate transformations, texturing, and full scene rotation.  These are the real features that I’m currently working on, and I’ll let you all know when it’s ready to get your dirty mitts on.  Stay tuned.

Read More

Ahoy! – Silverlight Virtual Earth MapControl

johnny depp pirates of the caribbeanWhat does a developer do when exploring the possibilities of the new Silverlight MapControl.  Create a pirate map of course!

australia

Yarr!  So how do you get the paper look and feel on the map?  It’s a simple, and doesn’t require any C#, you can do it purely via the XAML.

<grid x:name="LayoutRoot" background="#FF000000">
      <img x:name="Paper" source="images/ye_atlas.jpg" />
      <m:map x:name="MainMap" opacity="0.5" />
</grid>

Yes, that’s how easy it is.  The aged paper look doesn’t zoom, I played around with having the paper scroll and zoom with the map, and it gave me a headache.  One of those times when you spend an hour or so finding that your cool idea wasn’t as cool as you thought.  When you zoom in, what does it look like?

sydney_close

But what is missing from the map?  Treasure of course!  YARRR!  Pushpin marks the spot!  So add a few custom pushpins, a bezier path later, and the map shows you the way.  How do you add a pushpin?  The best way is to create a layer to put all your pushpins, that way you can hide/show them all together quite easily.  So your XAML becomes…

<Grid x:Name="LayoutRoot" Background="#FF000000">
    <Image x:Name="Paper" Source="images/ye_atlas.jpg" />
    <m:Map x:Name="MainMap" Opacity="0.5" >
        <m:Map.Children>
        <m:MapLayer x:Name="PushpinLayer"/>
        </m:Map.Children>
    </m:Map>
</Grid>

… and by adding the following function which takes the position, the pixel size to resize your image/pushpin icon, and the title text of the pushpin …

private void AddPushpin(double latitude, double longitude, double size, string title)
{
    // Grab our map layer
    MapLayer ml = MainMap.FindName("PushpinLayer") as MapLayer;

    // Create the title for the pushpin
    TextBlock t = new TextBlock();
    t.Text = title;
    t.SetValue(MapLayer.MapPositionProperty,
                    new Location(latitude, longitude));
    t.SetValue(MapLayer.MapPositionMethodProperty,
                    PositionMethod.Center);

    // ... and the Pushpin image
    Image img = new Image();
    img.Width = size;
    img.Height = size;
    img.Source = new BitmapImage(new Uri("images/skull.png",
                                                UriKind.Relative));
    img.SetValue(MapLayer.MapPositionProperty,
                        new Location(latitude, longitude));
    img.SetValue(MapLayer.MapPositionMethodProperty,
                        PositionMethod.TopCenter);
    ml.AddChild(img);
    ml.AddChild(t);
}

Note the use of the PositionMethod to have the bottom of the title aligned with the top center of the image.  Having this makes life so easy when plotting pushpins on a map around a particular coordinate.

Call AddPushpin in your public Page() constructor, and play around with adding pushpins.  Lots of fun to play around with.  Then by simply adding a bezier path method (which I’m still not happy with yet) and vary the pushpins and voila, there be treasure! YARR!

new_yaark_treasure

If only the sailors of yesteryear had zoomable pannable treasure maps!  Features to come are some pirate ships that float around in the water… and I’d love to add a little mini-canon fight, but time is of the essence.

So why is this exciting?  Well, aside from our privateering friends out there, what it does open up is a great way to communicate hiking trails, cycling tracks, walks.  Feed in a heap of map data and you can overlay anything!  Add a custom map data source and you can really start to expand the possibilities.

Read More

MIX09 Day 3 – Silverlight, Virtual Earth, and Pigmaps

Day 3 of MIX09. I head to a few sessions, all of which are interesting.Don't Shag the Pinball Machine

Virtual Earth integration from Silverlight was the highlight. Once again a nice clean API allows developers to pick it up, with fully integrated customised maps in Silverlight developed faster than previously possible. Video and media asset integration, scaling/zooming/”deep zoomesque” capabilities, and the ability to feed in your own map data.

So how easy is it?  Well, first up you need the control DLL.  And once you’ve done that, you’ll need the following XAML…

<UserControl x:Class="MapControlInteractiveSdk.Tutorials.Tutorial1"
     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
     xmlns:m="clr-namespace:Microsoft.VirtualEarth.MapControl;
                assembly=Microsoft.VirtualEarth.MapControl"
>
   <Grid x:Name="LayoutRoot" Background="White">
     <m:Map />
   </Grid>
</UserControl>

BAM!  Map with controls in Silverlight in 3 seconds.  Even more impressive is all the small tweaks you can do in only a few lines of code.  Chris Pendleton has a wrap up and other posts over at the Virtual Earth Evangelist’s Blog, so check out further details.

Another session I found interesting was Pigmap. All I could ascertain is that the translated meaning behind the brand could probably translate to ‘cash cow’, and although the presentation had a lot to be desired, the Korean markets tend to push online community concepts many years before the western world picks them up.

Pigmap will be a social networking site.  It leverages Virtual Earth, flickr, and other services (OpenID, Live ID etc). To provide users with mapping, it searches Virtual Earth for certain locations and venues. So search for Las Vegas NV, and BAM, Las Vegas turns up on the map. But then type in ‘Venetian’ as a point of interest, and the platform searches Flickr for photos matching Venetian, grabs their geo coordinates, and drops thumbnails on the map (“The End of Theory” theory strikes again).

The questionable feature of the site is the ability to set “Missions” for people using the product. To be able to go “Dear X, I challenge you to go to this location” doesn’t really appeal to me, but “Dear X, you want to head here tonight?” might work, but many other services provide that functionality. Possibly Korea is too far ahead culturally with social networking that it zips over my head.

And that’s a wrap from MIX09. There is just so much more to talk about, and many of that will come with some of the posts that grow out of playing with the new toys. Head on over to the downloads page to grab your favourite preview/beta/CTP/SDK… and remember to check out the sessions at sessions.visitmix.com.

MIX oh-ten has been announced, and I’m excited to see where the designer and developer community has taken these tools by then. 

Catch you online when I land back in Australia. 

Don't Shag the Pinball Machine

Read More

Playboyarchive.com! … and Day 2 at MIX09

Day 2 at MIX has me talking to too many interesting people. VERTIGO’s presentation of Playboyarchive.com I’ll get to in a second, because yesterday I forgot to mention Sketch Flow. Sketch Flow is, at its heart, a collaboration feature for Blend. And the only way to really discuss it, is if you’ve seen some of the Sketch Flow sessions at MIX09.

Now that you’ve done that, we’ll continue.

The biggest benefit I see for agencies and services companies is the seamless integration, and to close the loop built in streamlined review mechanisms. Although Silverlight is a great technology and the obvious place Sketch Flow would help most, Sketch Flow will be useful for any type of web project. From presales through to design, it opens the door for rapid prototyping, with the cost of finding the best user experience drastically reduced. The documentation and auto data population features are so obvious and simple, yet dream features for developers. So big thumbs up for Sketch Flow.

Yesterday’s Live Services session had me falling off my chair. It was just too easy. If you aren’t looking at Mesh, you are being left behind… the possibilities are huge.

Second on the agenda was the VERTIGO presentation. Lots of sites developed in short periods of time, using some great Microsoft technologies such as Deep Zoom and Silverlight 3. KEXP, Rolling Stone magazine archive, March Madness, and the big one, www.playboyarchive.com. The presentation covered projects of catalogued back issues of magazines, radio station download managers, and interactive live video streaming. Such a broad consumer offering, based on the same core technology stack. The Playboy archive consists of over 2 million individual files that make up the multiscaleimage, coming in at 30GB of data. But what is even truly mind blowing, is the fact all text in the deep zoom is searchable, including the advertisements, the comics, and the articles.

To go over www.playboyarchive.com in a bit more detail (assuming you are still reading and haven’t clicked the link in the first few seconds), from the home page you click through to the DeepZoom based Silverlight application.

Home PageCover View

Then clicking on a cover takes you into an issue. Clicking on pages brings that page into full view.

MultipagePage View

And an example of searching, with full highlighting, deep linked to from the search results below.  (Just don’t ask how they afforded the army of chimps to highlight all the text.)

Search

For those that feel dubious heading over and checking it out, the older 1960’s magazines are generally work safe for the first 60 pages, if not cover to cover.

Read More

@MIX09 Impressive Start

MIX09 LogoI’m at MIX09 in Las Vegas the lone attendee in early waiting for the 2nd session I’m attending to kick off. Day 1 is turning out to be quite impressive. Up early for registration to miss the queues, and to hopefully catch breakfast (a 24 hour meal in Las Vegas). Registration was painless, and with my swag of Microsoft goodies I headed to the keynote.

Bill Burton and Scott Guthri were impressive. Their views were insightful, reinforcing, and the technology announcements presented were just as impressive. I recommend checking out the keynote over at live.visitmix.com. The technology announcements and demos were impressive. From Expression Blend, to IIS administration, the new features are market driving. Some are ‘about time’ and others ‘just in time’, others ahead of their time. The consistency and pipeline Microsoft provide for delivery between developers and designers with Expression, or the ease with which IIS and IIS applications can be managed are needed.

Not only were the Microsoft demos impressive, so were Netflix and BONDI/Vertigo. With Netflix being able to offer to a broader sprectrum of the consumer market, and release fortnightly instead of annually, their business has transformed. Similarly BONDI, specialists in back catalogue magazine capitalisation, created an entire new business, with the entire back catalogue of Rolling Stone magazine indexed, searchable, leveraging Silverlight 3 and deep zoom for a completely new visual experience.

Silverlight is a technology that is moving so fast I find it hard to keep up. The new pixel shader effects are exciting, and so easy it feels like cheating. Being able to splash them around on *any* control is too much fun. Be prepared for gratuitous overload for the first few months/years. Scott Guthri’s demo is worth watching to understand this. Even though Scott jokes, someone will put perspective and ripple effects on forms, and 10 people will copy that, and so on. Impressive features now in Silverlight include the ability to pump videos to FTP/WebDav locations direct from encoding, adaptive streaming over HTTP. Silverlight 3 also brings thick client “out of browser” applications. These also come with auto update features, online and offline synchronisation and data binding, and all out of the box. This isn’t just a Silverlight .NET shell for apps to run under windows, it comes with a full blown API for network connectivity detection. These applications are also running under OSX, as was demo’d in the keynote by KEXP radio. KEXP have an offline player, with online synchronisation and features, single click install (The install was such a non event most people missed it!).

Session 2, Day 1

Lunch consumed, and session 2 is about to start, the room looks empty. With 10 sessions going at the same time, this is a great way to have small intimate groups with audience participation/interaction.


Read More