August 23, 2009

Function vs Class























In the beginning it was not clear for me what are the differences between "function" and "class" -given that both are sort of like a package that gives me a certain output depending on variables-.

Both look fairly similar to me as long as I'm working on a certain frame, but now I see that -as some professionals have told me- "class" can deal with more complex procedure. It is still hard to keep track with where I should assign variables.

In this case, world calls "class vein" multiple times in loop, and each "class vein" calls "class leaf" in loop. For example, color of leaves are defined in "class leaf" and number of leaves per vein is defined in "class vein."

Here is the source code comparison.
processing CLASS vs processing FUNCTION

Parametric Processing























Those graphic reminds me of IKEA pillowcase...

Going through a processing tutorial book, "Processing -A Programming Handbook for Visual Designers and Artists."

Those veins are constructed only using "function." I'll try the similar graphic using "class" to see the difference next time.

July 24, 2009

Spirograph Ver.2












完成っ!

ダイヤルの数増やしてみました。親ダイヤル、子ダイヤル、孫ダイヤル、ひ孫ダイヤル... もちろん user が数決められますよ。

java で書いてscreensaver にでもすればかわいいと思うけど、これは Rhino vb です。そろそろobject 思考に挑戦したいと思っています。Rhino Main 職人は卒業しましょう。

Spirograph with multiple generation of dials. Not possible in the original toy. Hope you enjoy :)

June 24, 2009

Dial Animation













Still messing around with Spirograph...

What if I had multiple generations of dial drawing patterns? Well in that case, I cannot rely on math functions for Spirographing. Basically I have to employ recursion function in VB, which confused a good chunk of my brain. Drawing diagrams and breaking code into a little tasks definitely helps and here is what I came up with.























image1:
(left) Dials rotate along each parent's perimeter by an user defined angle. (right) User defines a dbl revolution for the first dial. The following dials rotate according to the arc length.

image2:
dblRev = 1 for 360deg. Initial dial revolution (dblRev) changes from 0.1 to 0.5. These steps become animation frames.

June 7, 2009

Spirograph













spirograph function を使えばパターンはすぐ描けましたが、ダイヤルに思いのほか苦戦してしまいました。なんだか和菓子みたいです。


Spirograph ♪♪ I have been wanting to try this out for a while.

It should have been my personal java project, but got impatient letting my skill catch up with ideas. So ended up doing it in vb.

Gray circles and lines that overlap with colored patterns are the dials and offset points (wholes for pencils). Spirograph function takes care of the offset points that are outside the moving dial. Users have an option whether inside circle or outside one moves. I placed line color in a loop and had a lot of fun!