Exemple #1
0
 public Cube(CubeModel mdl, Vector3 lc, Vector3 axis, float angle, float sc = 1)
 {
     orientation = Matrix4.CreateFromAxisAngle(axis, angle);
     location    = Matrix4.CreateTranslation(lc);
     scale       = Matrix4.CreateScale(sc);
     model       = mdl;
     ownModel    = false;
 }
Exemple #2
0
 public Cube(Vector3 lc, Vector3 axis, float angle, float sc = 1)
 {
     orientation = Matrix4.CreateFromAxisAngle(axis, angle);
     location    = Matrix4.CreateTranslation(lc);
     scale       = Matrix4.CreateScale(sc);
     model       = new CubeModel();
     ownModel    = true;
 }
Exemple #3
0
 protected override void OnLoad(EventArgs e)
 {
     base.OnLoad(e);
     this.Title = "Hello OpenTK!";
     model      = new CubeModel();
     cube1      = new Cube(model, new Vector3(-1.1f, 0f, -10f), new Vector3(0, 1, 0), 0);
     cube2      = new Cube(model, new Vector3(2f, 1f, -25f), new Vector3(-0.2f, -0.3f, -0.5f), 0);
     GL.Enable(EnableCap.DepthTest);
     GL.Enable(EnableCap.Texture2D);
     GL.Hint(HintTarget.PerspectiveCorrectionHint, HintMode.Nicest);
     GL.ClearColor(Color.CornflowerBlue);
 }