I’ve been working lately on a demo that is for gaming a lot more realistic than the spinning teapot or box that one sees in the sample browser for Balder. A friend of mine Peter Rosenlund, an excellent graphics artist, gave me a 3D model of a city that I can use for that (thanks a lot!!).
In the 3D model, he had applied static lighting manually in 3DSMAX by painting the Vertex colors – a feature I had not implemented in Balder. After a few hours yesterday and this morning, I got it all up and running and I must say it looks kinda nice.
Balder, rendering city without vertex colors applied:
Balder, rendering same city with the vertex colors applied:
Thanks for all your hard work! I appreciate the "generating meshes programatically" tutorial and I used it to display a geodesic dome in Silverlight. Can you do a tutorial on setting materials programatically. When I redraw my dome it turns flat.
Here is my XAML and at first the dome looks good:
<execution:Game Grid.Column="1" Grid.Row="1" Height="600" Width="700">
<execution:Game.Camera>
<view:Camera Position="0,0,-7" />
</execution:Game.Camera>
<lighting:OmniLight Diffuse="Blue" Position="0,7,-8" />
<my:DomeModel x:Name="theDome" Position="0,0,0" >
<my:DomeModel.Material>
<materials:Material Specular="White" Ambient="Black" Diffuse="Cyan" Shade="Flat" />
</my:DomeModel.Material>
</my:DomeModel>
</execution:Game>
But after I call this code the dome goes flat.
theDome.InvalidatePrepare();
I tried adding materials with this code but it doesn’t help:
Balder.Materials.Material mat = new Balder.Materials.Material();
mat.Shade = Balder.Materials.MaterialShade.Flat;
mat.Ambient = Balder.Color.FromSystemColor(Colors.Black);
mat.Specular = Balder.Color.FromSystemColor(Colors.White);
mat.Diffuse = Balder.Color.FromSystemColor(Colors.Cyan);
theDome.GeometryContext.SetMaterialForAllFaces(mat);
Thanks!
Hi,
this has been fixed. Its a bug in the 0.8.8.8 release. You can either go and download the source and compile it (run build All from command line in the root of the source), or you’ll have to wait till the next release comes out – shouldn’t be too long.