This is a Repost
This is my first post on MDX, but i am hoping it will not be my last. I’m witting an app which relies heavily on it for the presentation layer, it’s all very new to me, and there is little documentation, either from the Microsoft Help or on the web, so I have decided that anything I learn I will post on my blog.
Now, this is actually incredibly simple to use, but there is next to no documentation outlining how to use it so here is some sample code which should be called during the render loop.
Vector3 vertexList = new Vector3;
vectorList.X = 100; vectorList.Y = 100; vectorList.Z = -20;
vectorList.X = 200; vectorList.Y = 100; vectorList.Z = -20;
vectorList.X = 200; vectorList.Y = 200; vectorList.Z = -20;
vectorList = vectorList;
Matrix lineMatrix = worldMatrix * viewMatrix * projectionMatrix;
Line line = new Line();
line.width = 2;
line.DrawTransform(vectorList. lineMatrix, System.Drawing.Color.Red);
this will draw the outline of a rightangle triangle of width ‘2’, the important bit being to know that the matrix you need to use with this method is the ‘worldViewProjection’ matrix.