WPF/3D

TANKS - a Silverlight Game with C# and Farseer Physics

I introduce to you TANKS - a web-based game built on Silverlight with C# and the Farseer Physics engine: http://www.kindohm.com/tanks Here are a few screen shots: Some highlights and facts of the game: Single player, real-time.  The enemies shoot at you while you shoot at them. You score points by making hits and kills.  You get more points for shooting efficiently and flipping over enemies. You can shoot down powerups and increase your ability to destroy enemies or stay alive.  Powerups stay with you as you progress through the game. The game has...

Farseer Physics Engine in Silverlight + Data

This week I picked up the Farseer Physics Engine, which Neil showed me a while back.  In my efforts to create an interesting data visualization experience (e.g. Connectable Lines, Radial Network Graph), I've wanted a UI that could "distribute itself" on the screen.  I wanted something that looked natural that could space itself out.  I needed the ability to introduce forces (attraction and repulsion) between UI elements. By picking up Farseer I was able to accomplish what I wanted and created what looks like a "molecule" of UI elements: http://www.kindohm.com/sl/molecules/molecules.htm This may sound a little surprising - but...

Click-n-Drag Functionality Improved

In my last post about connectable nodes in Silverlight, my code had an annoying problem where if you moved the mouse too quickly the selected shape would fall behind and stop moving.  I corrected this problem by moving the move logic to the containing Page rather than keep it inside the shape user control.  The containing Page is aware of mouse movement outside of each shape, and therefore can control shape movement when the mouse speeds ahead outside of a shape while dragging it around.  New code and example app are available: Source: nodeconnect2.zip Example App: http://www.kindohm.com/sl/nodeconnect/testpage.html Technorati Tags: code silverlight programming

Connectable lines and shapes in Silverlight

This is strictly just a UI concept at this point, but it's a very simple Silverlight implementation of drawing some shapes on the screen, connecting them with lines, then clicking and dragging the shapes around while maintaining the line connections.  UPDATE 1/6/2009: The demo page and source code have been updated and compiled for Silverlight 2. Source Code: nodeconnect2.zip [12 kb] Example App: http://kindohm.com/sl/NodeConnect/TestPage.html It's hard to explain the highlights with only small code snippets (I don't want to paste the entire source code into this post), but here is a shot at some of the key features... The nodes/shapes were implemented...

Radial Network Graph in Silverlight

Download Source Code: SilverlightRadialGraph.zip [582 KB] Recently I've been looking into some challenges with data visualization - particularly with viewing relationships between a large number of entities.  Social Networking is a classic example.  A great example of how to visualize a large network of "friends" on Facebook is to use the Nexus application (developed by Ivan Kozik): Click to enlarge This is very close to what I know as a "radial graph".  I couldn't find a good definition of a radial graph anywhere, but here is an academic publication that at...

DevConn Day 0 [pre-con] ARP302: How to create rich Silverlight applications

I attended a pre-conference session on Silverlight almost immediately after getting off the plane.  Unfortunately it wasn't a very good session for me.  I'm finding that most Silverlight sessions are about XAML - not the fine details about Silverlight.  This session covered the basics of setting up a Silverlight project in Visual Studio from scratch, which was good.  So far I've only seen Silverlight projects created from project templates.  I like being able to see stuff get set up without any smoke and mirrors and to see the raw code.  But after about 10 minutes of that, it was nothing but creating...

SharePoint Search Bench Initial Release

Download SharePoint Search Bench from www.codeplex.com/SPSearchBench SharePoint Search Bench is a WPF application used to run full-text SQL and keyword queries against Microsoft Office SharePoint Server (MOSS) search.   This project is something I've had in the works for a little while.  Extending MOSS search is a common task among SharePoint developers, yet there aren't really any tools available to test, try, or develop queries against MOSS search.  Unlike SQL Server, MOSS doesn't ship with a "Query Analyzer".  On projects where I was extending MOSS search, I found myself writing my own app to write and test queries.  Here...

Augmented Reality in WPF

Check out this amazing WPF 3D app that interactively places 3D elements on the screen given a video/visual input. This opens a few doors :) In fact, here is an example of a real world application of the technology in use by an auto mechanic: Technorati Tags: wpf 3d augmented reality video

Complex ModelVisual3D Composition and Hit Testing in WPF

I posted a new article last night on how to handle complex model interaction in WPF 3D: http://www.kindohm.com/technical/ComplexVisuals.htm I also added a new table of contents page since the number of articles is growing.  I feel a little bad that Google adsense is all over those articles, but I can't deny that the ads help pay for keeping kindohm.com up and running. Technorati Tags: wpf 3d programming

Use of Normals in WPF 3D

Download the source code for this post: Normals3D.zip (100 KB) One of the questions brought up during my WPF 3D talk at the Code Camp this weekend was what happens when you don't use normals in your meshes. The answer is that it depends. When you use a complete, discrete set of points for each flat surface in your mesh, the the effects of not using normals isn't that significant. However, if you are "lazy" and use the fewest amount of points possible for all triangles in your mesh, then the effects of not using normals is more...

Code Camp - WPF 3D - Slides, Code, and Resources

Thanks to everyone who attended my talk at the Twin Cities Code Camp. Here is a list of stuff related to the talk that you can download: The PowerPoint slide deck: TCCC-WPF3D-slides.zip (contains both Office 2007 and Office 2003 versions) The demo code: CodeCamp.Wpf3D.zip (1 MB) The "Moving Camera" application: MoveCamera.zip (8MB - includes media files) The Cartography application (USA states map): Cartography3D-v2.zip (500 kb) The Cartography database in SQL backup form: CartographyDB.zip (37 MB) I uploaded the entire Cartography database so that you can actually execute the code against the real data. You...

Bizarre Japanese WPF App

This is quite something. It's a complete WPF 3D model using real images (I'm assuming image brushes ?? ) and is animated and sync'd to music and voiceovers. The animations themselves are pretty cool but the best part is that you can control the camera while it plays. Link: Dominoken (Internet Explorer will be your friend in this instance) tags: japan wpf 3d programming code

Use 3DTools for Generating Texture Coordinates in WPF

I've always struggled with (or have completely blown off) generating texture coordinates for WPF 3D meshes. Texture coordinates are what allow you to map 2D resources (images, videos, or any visual WPF element) on to a 3D surface. 3DTools out on CodePlex takes care of this for you. Included with 3DTools is a mesh utilities class that will generate texture coordinates for a variety of basic surfaces, including planes, spheres, and cylinders. 3DTools also contains a bunch of other goodies (to be discussed at a later point in time). I can't mention 3DTools for the first time without stating...

Animate a PerspectiveCamera in WPF

This app started out as an experiment with animating a PerspectiveCamera in a WPF 3D scene. Basically, I wanted to achieve the effect of "flying" through a model. WPF's 3D animations are just too tempting to me though, and after achieving the camera animation I couldn't help but busy-up the app with rotating videos, a background Edgey track and some extra keyboard commands to have fun with. I haven't done anything useful in a WPF app yet :) Anyway, here's the source code: MoveCamera.zip (8MB). The zip file is big because the media files are included. And here's...

Lots of WPF at MIX '06

Tim Sneath just posted an blurb about a WPF project he's been working on with a customer. This full demo of the project shows off how WPF integrates 2D, 3D, animation, music, and video. There's a lot of WPF stuff out there that shows off its 3D capabilities, but most of it either isn't very pleasing to the eye (think simple 3D objects on a bright yellow background) or is too simple/abstract to give perspective on how it would be used to solve real problems. This demo presents what looks like a very pleasing, polished product that...

Fun with WPF 3D Animations

This week I've been integrating a Trackball component (found in the WinFX examples on Robert Hogue's site) and playing with 3D animations in WPF apps. So, you're probably wondering what it looks like when you have a multi-colored matrix of bouncing, spinning cubes. Well you're in luck: Download the code here. In the words of Raymond: "Necessary? No. Cool? Absolutely." But seriously... I'm glad I was able to find some time to get to this little exercise. While my final product doesn't really provide much value, the knowledge gained in the process can be...

Some WPF 3D resources

This is just a repost from a comment left on my site, but the resources in the link are pretty good so I wanted to bump it into the main feed. Lots of tutorials and sample code: http://blogs.msdn.com/tims/archive/2006/02/08/527850.aspx

Improving 3D performance in WPF

I was able to significantly improve the performance of the USA 3D model by reducing the number of discrete 3D models being rendered in the vieport. Originally, I was using the approach in my 3D Tutorial, which involves creating a 3D triangle model for each triangle in the mesh. While this approach makes it very easy to build composite 3D models (by...

3D Performance

Early this morning I played around a bit with the 3D USA model and I wasn't happy at all with the performance. The performance appears to depend on how many discrete 3D geometries are loaded into the entire viewport. For example, when I increase the granularity step when I'm looping through latitude/longitude points then fewer points are used. Increasing the granularity makes the model perform faster when panning, zooming, and angling the camera. If I decrease the granularity step, more points are used, and the camera moves more slowly because the screen takes longer to re-draw. In...

USA in 3D

Since all of the hard work with creating 3D geometries has already been done in my 3D Tutorial, it didn't take much work to obtain the cartographic data of the 50 states and plug it into the trackball model. Here are some screenshots (click on them for a larger image): View from above: See how thick, see how cool: View from below Perhaps a little bit of code will follow soon...

3D Trackballs in WPF

The next thing I want to accomplish in my demographics project is to build a nice clean 3D viewing UI. What I mean by that is that the user (me) should be able to easily pan, zoom, and change the viewing angle of the camera inside the 3D space. In my initial experimentation a few months ago I was using slider controls to accomplish this. It was a quick approach, but was annoying to use because I needed a slider for each direction or "degree of freedom" that I wanted to move. At minimum I needed six sliders - a...

Cartographic data import progress

My cartographic file parser is working the way I want it to now. There are four total files that describe states and counties for all 50 states, and two files for each state that describe cities and two files for each state that describe zip codes. I've parsed all of the state and county data, and have parsed 13 states worth of cities and zip codes. Those 14 states include Minnesota, Wisconsin, Michigan, North Dakota, South Dakota, Iowa, Montana, Idaho, Washington, Illinois, Missouri, Indiana, Ohio, and Nebraska. Some interesting stats so far: 21,018 unique boundaries have been...

Back to Demographics

The demographics project has been revived. In between attending to Eva and working on the basement, I've been digging in to code. I haven't actually gotten in to any WPF stuff yet - I've been focusing on parsing the cartographic files from the US census bureau. In my earlier experimentation with 3D in Avalon, I gave the cartographic data just barely enough attention to make things work. This time around, I want the data to be complete, which means parsing many, many files and having a faster parsing process. The files break down like this: Two files...