public static RectNode Create(int x, int y, int width, int height) { var model = new RectModel(); var vs = new VertexShader(vertexCode); var fs = new FragmentShader(fragmentCode); var array = new ShaderArray(vs, fs); var map = new AttributeMap(); map.Add("inPosition", RectModel.strPosition); var builder = new RenderMethodBuilder(array, map); var node = new RectNode(x, y, width, height, model, builder); node.Initialize(); return(node); }
private void FormMain_Load(object sender, EventArgs e) { var position = new vec3(5, 3, 4) * 0.5f; var center = new vec3(0, 0, 0); var up = new vec3(0, 1, 0); var camera = new Camera(position, center, up, CameraType.Perspecitive, this.winGLCanvas1.Width, this.winGLCanvas1.Height); int width = this.winGLCanvas1.Width, height = this.winGLCanvas1.Height; this.rectNode = RectNode.Create(0, 0, width, height); var scene = new Scene(camera); scene.RootNode = rectNode; this.scene = scene; var list = new ActionList(); var transformAction = new TransformAction(scene.RootNode); list.Add(transformAction); var renderAction = new RenderAction(scene); list.Add(renderAction); this.actionList = list; }