public void Mul(Matrix3 mat) { double nx,ny,nz; nx = mat._Component[0][0] * x + mat._Component[1][0] * y + mat._Component[2][0] * z; ny = mat._Component[0][1] * x + mat._Component[1][1] * y + mat._Component[2][1] * z; nz = mat._Component[0][2] * x + mat._Component[1][2] * y + mat._Component[2][2] * z; x = nx; y = ny; z = nz; }
public Sphere(Vector3 position, Vector3 scale, Matrix3 rotation) { _Position = position; _Scale = scale; _Rotation = rotation; _Material = new Material(); _IgnoreLighting = false; }
public Circle(Vector3 centre, Vector3 scale, Matrix3 rotation) { _Material = new Material(); _Position = new Vector3(); _Rotation = new Matrix3(); _Position = centre; _Scale = scale; _Rotation = rotation; }
public Sphere() { _Position = new Vector3(0, 0, 0); _Scale = new Vector3(1, 1, 1); _Rotation = new Matrix3(); _Rotation.MakeIdentity(); _Material = new Material(); _IgnoreLighting = false; }
public Matrix3(Matrix3 rhs) { _Component = new double[3][]; for (int i = 0; i < 3; i++) { _Component[i] = new double[3]; _Component[i][0] = rhs._Component[i][0]; _Component[i][1] = rhs._Component[i][1]; _Component[i][2] = rhs._Component[i][2]; } }
public void Mul(Matrix3 arg) { double [][] res; res = new double[3][]; for (int i = 0; i < 3; i++) { res[i] = new double[3]; } res[0][0] = _Component[0][0] * arg._Component[0][0] + _Component[0][1] * arg._Component[1][0] + _Component[0][2] * arg._Component[2][0]; res[0][1] = _Component[0][0] * arg._Component[0][1] + _Component[0][1] * arg._Component[1][1] + _Component[0][2] * arg._Component[2][1]; res[0][2] = _Component[0][0] * arg._Component[0][2] + _Component[0][1] * arg._Component[1][2] + _Component[0][2] * arg._Component[2][2]; res[1][0] = _Component[1][0] * arg._Component[0][0] + _Component[1][1] * arg._Component[1][0] + _Component[1][2] * arg._Component[2][0]; res[1][1] = _Component[1][0] * arg._Component[0][1] + _Component[1][1] * arg._Component[1][1] + _Component[1][2] * arg._Component[2][1]; res[1][2] = _Component[1][0] * arg._Component[0][2] + _Component[1][1] * arg._Component[1][2] + _Component[1][2] * arg._Component[2][2]; res[2][0] = _Component[2][0] * arg._Component[0][0] + _Component[2][1] * arg._Component[1][0] + _Component[2][2] * arg._Component[2][0]; res[2][1] = _Component[2][0] * arg._Component[0][1] + _Component[2][1] * arg._Component[1][1] + _Component[2][2] * arg._Component[2][1]; res[2][2] = _Component[2][0] * arg._Component[0][2] + _Component[2][1] * arg._Component[1][2] + _Component[2][2] * arg._Component[2][2]; _Component = res; }
public static string Matrix3ToString(Matrix3 mat) { return("" + mat._Component[0][0] + ", " + mat._Component[0][1] + ", " + mat._Component[0][2] + ", " + mat._Component[1][0] + ", " + mat._Component[1][1] + ", " + mat._Component[1][2] + ", " + mat._Component[2][0] + ", " + mat._Component[2][1] + ", " + mat._Component[2][2]); }
public void InitialiseTestScene() { Matrix3 identity = new Matrix3(); identity.MakeIdentity(); _Scene.AddRenderObject(_BackgroundScript); _Scene.AddRenderObject(_SceneScript); _Scene.AddRenderObject(_LightingScript); }