An NDoc Documented Class Library

MNDevice.ModelMatrix Property

The ModelMatrix plays an important rule. If scene data are going to the device the they wold be transformed first by the modelmatrix and then by the ProjectionMatrix. After this two transformations the data are laying in a cube, which is bounded by (-1, -1, -1) and (1, 1, 1). In the last step the points are posiionned in the screen by expand into the viewport. You see, that the modelmatrix is a very powerful property.

Surface S = new Sphere(4);
Device.DrawSurface(S);
// save the modelmatrix
Device.PushMatrix()
Device.ModelMatrix = Device.ModelMatrix * Translation(new (5, 0, 0);
// this Sphere has the center at (5 /0 /0 ).
Device.DrawSurface(S);
Device.ModelMatrix = Device.ModelMatrix * Translation(new (5, 0, 0);
// this Sphere has the center at (5 /0 /0 ).
Device.DrawSurface(S);
// reset the Modelmatrix
Device.PopMatrix()

public Math.Matrix ModelMatrix {get; set;}

See Also

MNDevice Class | Minais.Drawing3d Namespace