Archive for the ‘XAML’ Category

You Don’t Need A Meaningful API If You’ve Got Meaningful Error Messages

Wednesday, February 14th, 2007

Woo, long time no update.

Anyhoo, in my WPF explorations today, I managed to trigger this little gem:

System.ArgumentOutOfRangeException : '100' is not a valid
Percent value for a KeyTime. The Percent value must be a number
from 0.0 to 1.0.

What the hell were they thinking?

Updated the Lexicon

Monday, September 11th, 2006

Just made a quick update to the Lexicon page. In a nutshell, it turns out that you can animate PerspectiveCameras in exactly the same way as Model3Ds, because they support a Transform property. I haven’t had a chance to play with it properly yet, but it means no more fiddling with Vector3DAnimations to change LookDirection any more. Woohoo!

Oh, and it looks like the same applies to Lights. More Woohoo!

Confused about Normals

Monday, August 28th, 2006

For some reason, the Normals property on a MeshGeometry3D is per vertex. Who ever heard of a point having a normal? It’s weird. Just thought I’d point that out.

We got flayed!

Wednesday, August 16th, 2006

The post is here.

Mapping Video

Saturday, August 12th, 2006

So, I’m trying to map a video texture onto a Xaml surface. So far, so easy. Except I want to apply the diffuse data to the emissive channel, because that’s closer to the way LightWave works. This is fine with static textures, but there’s a problem with videos. I generate as much as possible in a ResourceDictionary, and the relevant Xaml looks a little like this:

<VisualBrush x:Key="media_element" Opacity="1.0">
  <VisualBrush.Visual>
    <MediaElement Source="#filename#" />
  </VisualBrush.Visual>
</VisualBrush>
<DiffuseMaterial Brush="{StaticResource media_element"} />
<EmissiveMaterial Brush="{StaticResource media_element"} />

The problem is that even when I specify that the DiffuseMaterial and EmissiveMaterial brushes point to the same element, they get their own players which don’t start in sync, so you get ghosting and funky audio ringing. I can’t see an obvious way around this… Anyone?

Entries (RSS)