/// <summary> /// To construct a mesh, we need to know the size and resolution. /// We also set the texture as a convenience. /// </summary> /// <param name="boundary">The size on the XY plane. The value is not used.</param> /// <param name="res">The resolution determines how many rows and columns of quads will be generated.</param> /// <param name="texture">An optional texture object to be bound to the mesh. /// Normalized texture coordinates will be generated whether a texture object is assigned or not.</param> public XYAxesPointMesh(Vector3D boundary, Resolution res) : base(BeginMode.Points) { fSize = boundary; fResolution = res; CreateMesh(); }
/// <summary> /// To construct a mesh, we need to know the size and resolution. /// We also set the texture as a convenience. /// </summary> /// <param name="boundary">The size on the XY plane. The value is not used.</param> /// <param name="res">The resolution determines how many rows and columns of quads will be generated.</param> /// <param name="texture">An optional texture object to be bound to the mesh. /// Normalized texture coordinates will be generated whether a texture object is assigned or not.</param> public XYAxesPointMesh(GraphicsInterface gi, Vector3D boundary, Resolution res, GLTexture texture) : base(gi, BeginMode.Points) { fSize = boundary; fResolution = res; Texture = texture; CreateMesh(); }
protected override void DrawBegin() { // Start with viewport covering whole window GI.Viewport(0, 0, fViewWidth, fViewHeight); // Create an orthographic view so we can draw // using 2D coordinates and not really worry about the // camera position GI.MatrixMode(MatrixMode.Projection); GI.LoadIdentity(); GI.Ortho(0, fViewWidth, 0, fViewHeight, -1.0, 1.0); // Clear the color buffer to an unlikely color so // that we can see where the drawing is NOT occuring GI.Buffers.ColorBuffer.Color = new ColorRGBA(1, 0, 0, 1); ; GI.Buffers.ColorBuffer.Clear(); // If the resolution of the mesh changed since the last time we were // drawing, recreate the mesh using the newest dimensions. if (fResolutionChanged) { Console.WriteLine("Block Size: {0}", fBlockSize); fResolutionChanged = false; fResolution = new Resolution(fVideoTexture.Width / fBlockSize, fVideoTexture.Height / fBlockSize); fFaceMesh = new XYAxesMesh(fFaceSize, fResolution, fYTexture); } }