Browse: Home / code

Jared Stanley

Technology + Code. Paragliding + Skiing + Ski Touring.

code

tree ring - processing

tree ring – processing

By admin on June 18, 2012

My wife received this book in the mail: http://media.mintdesignblog.com/2012/05/gill-woodcut-book-print.jpg It’s beautiful, with awesome images of tree rings; I thought I’d try to recreate a tree’s growth procedurally. Here’s my first attempt at recreating a tree ring: I followed these steps: get points distributed evenly around the circumference of a circle get the curveVertex() method in [...]

Posted in personalprojects | Tagged code, math, processing | Leave a response

Getting the color from an image

Getting the color from an image

By admin on January 26, 2010

I started this project that I’ve wanted to work on for a little while. Basically I wanted to simplify the colors in an image down to one color that represents that image, trying the average color as well as the dominant color. I would then drew this color onto the current swatch just below the [...]

Posted in blog | Tagged as3, bitmap, code, flash

scrollwheel (on mac)

By admin on October 7, 2009

I haven’t added scrollwheel functionality to an as3 project yet, I did it the other day, the code looks like this: stage.addEventListener(MouseEvent.MOUSE_WHEEL, onMouseWheel); private function onMouseWheel(e:MouseEvent):void { trace(e.delta); } pretty basic, there’s a delta property that is a positive or negative int based on the direction you’re scrolling. The problem is it doesn’t work on [...]

Posted in blog | Tagged as3, code, flash, javascript, mac, scrollwheel, swfobject

Particles

By admin on July 6, 2009

this is a basic particle system. Particles get created, each with a unique size and speed. Added blend mode / blur. code: function drawDot(e:TimerEvent):void { var p:Dot = new Dot(); } //pick a random # between 50-100 var rw:Number = Math.random() * 50 + 50; var rh:Number = Math.random()*50+50; //draw a circle p.graphics.beginFill(0x3c3c81, .7) p.graphics.drawEllipse( [...]

Posted in blog | Tagged as3, code, flash

GRID

By admin on July 4, 2009

the effect from the post below becomes much cooler when the effect is replicated. this is just a grid of the previous example. There are a couple ways to make a grid: One way is to work with the items as groups of rows/columns. This is probably how the Space Invaders enemies are set up. [...]

Posted in blog | Tagged as3, code, flash

Distance + Rotation

By admin on July 4, 2009

Here”s something that”s not anything new, but showcases some classic flash functionality. this basically uses two functions, one to get the angle of the mouse > center of the arrow, and then one to get the distance from the mouse > center of the arrow. //get the distance between the two x and y positions [...]

Posted in blog | Tagged as3, code, flash

Copyright © 2013 .

Powered by WordPress and Hybrid.