Recently I've been looking at Povray, pyprocessing, and cfdg (version 3.0) as tools for creating digital images. I have branched two separate blogs where I mainly explore jruby + processing and processing.py

Sunday, 11 November 2012

Simple object import processing.py

Since processing-2.0 object (wavefront) import is built in. Checkout this sketch, vanilla processing version was a rocket:-
   1 ##
   2 # Load and Display an OBJ Shape. In this a cow
   3 ##
   4 ry = 0
   5 
   6 def setup():
   7   size(640, 360, P3D)
   8   global cow 
   9   cow = loadShape("/home/tux/cow.obj")
  10   
  11   
  12 def draw():
  13   background(0)
  14   lights()
  15   global ry
  16   translate(width/2, height/2, -200)
  17   rotateZ(PI)
  18   rotateY(ry)
  19   scale(50)
  20   shape(cow)  
  21   ry += 0.02

No comments:

Post a Comment

Followers

Blog Archive

About Me

My photo
Pembrokeshire, United Kingdom
I have developed JRubyArt and propane new versions of ruby-processing for JRuby-9.1.5.0 and processing-3.2.2