Here is my blog in which I will describe my experiments with ruby-processing, find out more about ruby-processing at:- http://wiki.github.com/jashkenas/ruby-processing and http://github.com/jashkenas/context_free for the cfdg DSL (context-free-art)
Thursday, 5 May 2011
Exploring modelX in ruby processing
############################
# processing modelX
# examples in ruby processing
###########################
def setup
size 500, 500, P3D
no_fill
end
def draw
background 0
push_matrix
# start at the middle of the screen
translate(width/2, height/2, -200)
# some pseudo random rotation to make things interesting
rotate_y 1.0 # yrot
rotate_z 2.0 # zrot
# rotate in X a little more each frame
rotate_x(frame_count / 100.0)
# offset from center
translate(0, 150, 0)
# draw a white box outline at (0, 0, 0)
stroke 255
box 80
# the box was drawn at (0, 0, 0), store that location
x = model_x(0, 0, 0)
y = model_y(0, 0, 0)
z = model_z(0, 0, 0)
# clear out all the transformations
pop_matrix
# draw another box at the same (x, y, z) coordinate as the other
push_matrix
translate(x, y, z)
stroke(255, 0, 0)
box 80
pop_matrix
end
Labels:
modelX,
ruby processing
Subscribe to:
Post Comments (Atom)
Blog Archive
-
►
2010
(73)
-
►
September
(15)
- Basic Hair Example SunflowAPIAPI just using jruby
- Basic Hair Example SunflowAPIAPI in ruby processin...
- SunflowAPIAPI in ruby processing
- A Staffordshire Knot Using Ruby Processing and A C...
- An Infinity Loop? With My 3D Context Free Library
- Revised 3D Context Free DSL Sketch, with Mouse Whe...
- A Mouse Wheel Listener in Ruby Processing
- 3D Context Free DSL Screen Saver?
- Translating the default.es to ruby processing DSL
- Testing the cube primitive in my context free DSL
- Experimental 3D Context Free DSL in ruby-processin...
- Using the control panel and Toxi Processing Libra...
- Tone map example of Gray-Scott diffusion using tox...
- Another Example of Using Toxi Processing Libraries...
- Using the Toxi Processing Libraries in ruby proces...
-
►
June
(6)
- Cesàro fractal using ruby processing context free ...
- Exploring Dynamic Randomness in ruby-processing co...
- Towards an Escher Bird Tiling (Ruby processing con...
- Weird Flower Ruby Processing Context Free DSL
- Alhambra Tiling Ruby Processing Context Free DSL
- Red Dwarf (Ruby Processing Context Free DSL)
-
►
September
(15)
About Me
- monkstone
- Consolidating my online identity as monkstone. I am a 64 bit linux user and advocate of open source software, you can sometimes find me on the processing forum.
0 comments:
Post a Comment