GraphicalBeauty

Shaunt Keshishian
Andrew Ambrosino
December 4, 2014

Overview

Graphical Beauty is a GUI for graphing and implementing physics based particle effects to display beautiful looking graphs. The graph emits physics-backed particles that rise and fall according to the tangent of the graph.

Screenshot

Concepts Demonstrated

  • Mapping
  • Hash Maps
  • Vertices

External Technology and Libraries

  • C-Style OpenGL Library
  • GUI

Favorite Lines of Code

  • Shaunt:
(draw-graph 1 10 0 .25)
(draw-graph2 1 10 0 .25)

(define max 10)
(define min (-  max (* 2 max)))
(define size 1)

(define ratio (/(* 2 max )))

(define (draw-graph start finish fx min)

  (cond ((> min max)0) 
        ((glVertex2d  (+(/ size 2) (* ratio min)) (+(/ size 2) (* ratio fx)) )
         (draw-graph start finish (* min min min) (+ min .01))))
  )

(define (draw-graph2 start finish fx min)
(set! min (-  max (* 2 max)))
  (cond ((> min max)0) 
        ((glVertex2d  (+(/ size 2) (* ratio min)) (-(/ size 2) (* ratio fx)) )
         (draw-graph start finish (* min min min) (- min .01))))
  )

Andrew

(define my-canvas%
  (class canvas% 
    (inherit with-gl-context swap-gl-buffers)

   (define/override (on-paint)

      (with-gl-context
        (lambda ()
          (draw-opengl)
          (swap-gl-buffers)
        )
      )
    )

This is a piece of code that glues together the GUI and the OpenGL canvas and intercepts on-paint to do some OpenGL initiation.

Technology Used Block Diagram

Additional Remarks