views:

171

answers:

1

How can I make a specific 3d model transparent? Is it as simple as changing the opacity of the model's material?

I tried the following:

SolidColorBrush br = (SolidColorBrush)matDif.Brush; //matDif = DiffuseMaterial
br.Opacity = 0.3;

When it tries setting the opacity it says that it is in a read-only state and cannot be changed?

+1  A: 

On this page (which admittedly is XAML rather than C# it has the following:

<GeometryModel3D.Material>
    <DiffuseMaterial Brush="#8000FFFF" />
</GeometryModel3D.Material>

<GeometryModel3D.BackMaterial>
    <DiffuseMaterial Brush="#80FF0000" />
</GeometryModel3D.BackMaterial>

So it looks like you just set the Brush to an ARGB colour.

This thread on social.msdn has some interesting looking links. I haven't looked at them all, but some of them might be useful.

ChrisF