void glCanvas1_OpenGLDraw(object sender, PaintEventArgs e) { PrintCameraInfo(); //GL.ClearColor(0x87 / 255.0f, 0xce / 255.0f, 0xeb / 255.0f, 0xff / 255.0f); GL.Clear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT); var arg = new RenderEventArgs(RenderModes.Render, this.camera); if (this.newElement != null) { this.element = this.newElement; this.newElement = null; } { mat4 projectionMatrix = camera.GetProjectionMat4(); //projectionMatrix = glm.translate(projectionMatrix, new vec3(translateX, translateY, translateZ));// mat4 viewMatrix = camera.GetViewMat4(); mat4 modelMatrix = mat4.identity(); this.element.projectionMatrix = projectionMatrix; this.element.viewMatrix = viewMatrix; this.element.modelMatrix = modelMatrix; } this.element.Render(arg); uiLeftBottomAxis.Render(arg); }
private void CreateElement() { var element = new XRayRenderer(factories[currentModelIndex].Create(this.radius)); element.Initialize(); this.newElement = element; }