Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource


Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource


Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.


Auto Save

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.


                <script src="//" type="text/javascript"></script>
<script src="//" type="text/javascript"></script>




                  $ -> new Renderer

  class Renderer
    constructor: ->
      @width = $(window).width()
      @height = $(window).height()

      @stats = new Stats()
      @stats.setMode(0) = 'absolute'; = '0px'; = '0px';

      @canvas = $("<canvas width='#{@width}' height='#{@height}' style='width: #{@width}px; height: #{@height}px' />").appendTo 'body'

      @ctx = @canvas[0].getContext('2d')

      # create a canvas 2D point for pixel view world
      point = new obelisk.Point(200, 200)

      # create view instance to nest everything
      # canvas could be either DOM or jQuery element
      @pixelView = new obelisk.PixelView(@canvas, point)
      # create shadow primitive
      colorShadow = new obelisk.SideColor(0x66666677, 0x66666677)
      dimensionShadow = new obelisk.BrickDimension(20, 20)
      @brick = new obelisk.Brick(dimensionShadow, colorShadow)
      #create cube primitive
      colorCube = new obelisk.CubeColor().getByHorizontalColor(obelisk.ColorPattern.PURPLE)
      dimensionCube = new obelisk.CubeDimension(20, 20, 20)
      @cube = new obelisk.Cube(dimensionCube, colorCube, true)

      @nodes = []

      for i in [0..50]
        @nodes.push {
          x : Math.random()
          y : Math.random()
          t : Math.random() * 0xFFFF
      setInterval @tick, 1000/60

    tick: =>


      for node in @nodes
        t = (node.t + new Date().getTime()) / 1000.0

        x = Math.sin(t * node.x) * @width
        y = Math.sin(t * node.y) * @height

        # Location
        pointCube = new obelisk.Point3D(x, y, 0)
        pointShadow = new obelisk.Point3D(x, y + 20, 0);

        # render shadow
        @pixelView.renderObject(@brick, pointShadow)
        # render cube primitive into view
        @pixelView.renderObject(@cube, pointCube)