Charles Petzold on writing books, reading books, and exercising the internal UTM

Recent Entries
< PreviousBrowse the ArchivesNext >
Subscribe to the RSS Feed

Another Rotating 3D Figure for Silverlight 3

August 7, 2009
Roscoe, N.Y.

This is much like the rotating cube for Silverlight 3 I posted yesterday except (1) this one's a square cuboid rather than a cube; (2) I'm using a perspective camera rather than an orthographic camera so portions of the figure in the distance appear smaller; (3) an ImageBrush is used to display a picture of my face on all six sides; (4) the Opacity of the ImageBrush is faded in and out so you can see through the figure to the backs of the opposite sides; and (5) it will suck your CPU completely dry.



Following along your latest 3D SilverLight posts, among the (too few) people who have read your 3D WPF book, I now know where we need the next Petzold book - XNA! Think of all the math you would get to discuss - vector cross products, quaternion, vertex normals, etc - and I know you're a fan a math. And it doesn't end at math, there is also the low level shader programming language - critical to any game. Plus, as a new XNA developer, I would finally be reach for the "Petzold book" again!

Michael C. Neel, Fri, 7 Aug 2009 14:15:56 -0400 (EDT)

I'm not a gamer myself, so I'm probably not the best person to write about XNA. However, if I believed for a second that such a book would sell 20,000 copies — the point at which writing a book ceases to be a charitable exercise — I'd quickly become an expert. (For comparison purposes, 3D Programming for Windows, which goes into detail on 3D vectors, transforms, and quaternions, has so far sold 4,000 copies.) — Charles

I am not sure but are you running the silverlight plugin with gpu enabled.

    <asp:Silverlight ID="Silverlight1" EnableGPUAcceleration="true" runat="server" Source="~/ClientBin/MyApp.xap" MinimumVersion="3.0.40307.0" Width="100%" Height="100%" />

I am asking because I saw the same issue with some work I was doing and offloading some of it to the gpu made some diffrence in the cpu utliziation.

Bill Moore, Fri, 7 Aug 2009 14:29:34 -0400 (EDT)

Thanks! That is certainly a feature I missed. (However, it doesn't seem to have any effect on this particular program.) — Charles

hi Sir

i want to order your book "Applications = Code + Markup" from amazon and i wonder if i can use vs 2008 express or i have to get the $$$ version of vs.

thank u sir

— sami, Fri, 7 Aug 2009 21:31:56 -0400 (EDT)

C# Express 2008 is fine for developing WPF applications. — Charles

tell me the tattoo is real

Todd Brannam, Fri, 7 Aug 2009 22:25:35 -0400 (EDT)

It's not a tattoo. It's a scar I acquired from doing Windows programming since 1985. — Charles

Here is a bit more on what it takes to enable GPU in SL3

"By default this option is disabled and to use it you must enable it both on your Silverlight control/plug-in as well as any of the controls you want to leverage it."

    EnableGPUAcceleration="true" - Silverlight


    CacheMode="BitmapCache" - Control

Wow only 4000 copies? Not very many apps being developed in WPF? I for one am very grateful for your charitable contribution.

randy george, Mon, 10 Aug 2009 10:57:23 -0400 (EDT)

Thanks! I'll play around and see if I can detect a difference in performance. — Charles


Here is some more on some of the new analytics is Silverlight 3. I got this from

This is a new Silverilght 3 feature that enables you to report the overall computer CPU usage (Analytics.AverageProcessorLoad), as also CPU usage with respect to the current Silverlight Application (Analytics.AverageProcessLoad).

You can also collect GPU device information.

bill moore, Tue, 11 Aug 2009 18:53:19 -0400 (EDT)

Thanks! — Charles

Recent Entries
< PreviousBrowse the ArchivesNext >
Subscribe to the RSS Feed

(c) Copyright Charles Petzold