Node

Objects that are visible on the screen or somehow influence the scene, such as Camera or Lights, all inherit from something called Node. The node is top of the hierarchy and contains a set of properties, the most important properties found in the Balder node has been exposed as so called DependencyProperties in the Silverlight specific Node. That means one can databind or animate these properties and their content with Storyboards.

Position is probably the most used property of a node, it is of type Vector that has the properties X,Y and Z, also exposed as DependencyProperties. In addition there are something known as TypeConverter attached to the type of Vector that allows you to work in a more natural way with these kind of properties.

Setting the Position of a mesh could be done like this:
<balder:Mesh AssetName="teapot.ase">
   <balder:Mesh.Position>
      <balderMath:Coordinate X="0" Y="0" Z="0"/>
   </balder:Mesh.Position>
</balder:Mesh>

Notice the XML namespace prefix of balderMath, it would need to be defined to refer to the Balder.Math namespace in the Balder component.

Since there is a TypeConverter for Vector, there is a more convenient way of doing the same operation:
<balder:Mesh AssetName="teapot.ase" Position="0,0,0"/>

Last edited Jul 26, 2010 at 10:21 PM by adept, version 3

Comments

No comments yet.