Multiple Plane Grid lines ??

May 21, 2012 at 4:26 PM

I am very new at the Helix 3D Toolkit, and I'm excited to learn more about it.

I would like to have multiple sets of gridlines. Currently I'm just trying to get 2 sets to show, but it seems like it will only register one.  I'm trying with 1 grid in the X-Y Plane and 1 in the X-Z plane.  Is it possible to include multiple GridLinesVisual3D elements in the view?  What is an easy way to do it?  

Currently I have this declared in the MainWindow method ...

var model = new ModelVisual3D();
model.Children.Add(new GridLinesVisual3D() { Center = new Point3D(-0.5, -0.5, -0.5), Normal = new Vector3D(1, 0, 1), Width = 20, Length = 20, MinorDistance = 1, MajorDistance = 10, Thickness = 0.04, Fill = Brushes.Green });
model.Children.Add(new GridLinesVisual3D() { Center = new Point3D(-0.5, -0.5, -0.5), Width = 20, Length = 20, MinorDistance = 1, MajorDistance = 10, Thickness = 0.04, Fill = Brushes.Red });
view1.Children.Add(model);

But it seems to only show the second Grid.  Thanks for your help.

Coordinator
May 26, 2012 at 6:55 AM

Try to set LengthDirection = new Vector3D(0,1,0) on your first set of grid lines.

The 'WidthDirection' is calculated as the cross product of Normal and LengthDirection. In your code you end up with the same length and width directions in both cases.

See the GridLinesVisual3D.Tessellate method how it works.

May 28, 2012 at 11:39 PM

Thanks very much.  Setting the Normal and LengthDirection attributes got exactly the desired result I needed.