We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexDiscussionExhibition › voronoi+processing+p5sunflow
Pages: 1 2 3 
voronoi+processing+p5sunflow (Read 9875 times)
Re: voronoi+processing+p5sunflow
Reply #15 - Nov 16th, 2009, 9:09am
 
does this help?

http://www.java-tips.org/other-api-tips/jogl/several-spheres-are-drawn-using-different-material-characteri-2.html

specifically these bits:

   gl.glMaterialfv(GL.GL_FRONT, GL.GL_AMBIENT, no_mat, 0);
   gl.glMaterialfv(GL.GL_FRONT, GL.GL_DIFFUSE, mat_diffuse, 0);
   gl.glMaterialfv(GL.GL_FRONT, GL.GL_SPECULAR, mat_specular, 0);
   gl.glMaterialfv(GL.GL_FRONT, GL.GL_SHININESS, low_shininess, 0);
   gl.glMaterialfv(GL.GL_FRONT, GL.GL_EMISSION, no_mat, 0);
   //glut.glutSolidSphere(1.0f, 20, 20);
   // YOUR SHAPE HERE
Re: voronoi+processing+p5sunflow
Reply #16 - Nov 16th, 2009, 9:31am
 
rats, am answering the wrong question there.

i don't think i've seen anything rendered in sunflow that didn't have the same matt look that yours has. and the website doesn't give any hints. have had a quick look through the javadoc but nothing jumped out at me.

http://sunflow.sourceforge.net/docs/javadoc/

edit: oh, this looks promising

http://sunflow.sourceforge.net/docs/javadoc/org/sunflow/core/Shader.html
Re: voronoi+processing+p5sunflow
Reply #17 - Nov 16th, 2009, 1:27pm
 
The current P5sunflow does not support shaders or lights, i think. http://hipstersinc.com/p5sunflow/ for details.
I really hope that wrapper gets further developing... such potential!
Re: voronoi+processing+p5sunflow
Reply #18 - Nov 16th, 2009, 8:04pm
 
I totally agree with fdevant, p5sunflow has so much potential.

I rendered these sketches recently using p5sunflow

-Flower+vase-

www.openprocessing.org/visuals/?visualID=191
http://vimeo.com/7653744

-Face-

www.aetos.it.teithe.gr/~mgiakobi/p5/obj/
http://vimeo.com/7652584


http://www.openprocessing.org/visuals/?visualID=1920
Vid download from --> http://www.mediafire.com/download.php?notzmg4wni2
Re: voronoi+processing+p5sunflow
Reply #19 - Nov 17th, 2009, 5:36am
 
koogy wrote on Nov 16th, 2009, 9:09am:
does this help
...

YES, it does help.
Thank you very much, but i'll do some tests to rendere in 'pure' opengl since now i know that p5sunflow doesn support anything else than its default render.
Re: voronoi+processing+p5sunflow
Reply #20 - Nov 17th, 2009, 5:48am
 
@andrewowaun your vids are privat
Re: voronoi+processing+p5sunflow
Reply #21 - Nov 17th, 2009, 2:34pm
 
http://www.vimeo.com/7670654

My first test animation using the p5sunflow library Smiley
Re: voronoi+processing+p5sunflow
Reply #22 - Nov 17th, 2009, 2:52pm
 
hmm looks all the same http://www.punyblog.com/2009/10/sunflow-output-from-processing.html Smiley

come on guys Smiley be more creative! just nice rendering doesnt do the job...

Re: voronoi+processing+p5sunflow
Reply #23 - Nov 18th, 2009, 6:03am
 
amnonP5 wrote on Nov 17th, 2009, 2:34pm:
http://www.vimeo.com/7670654

My first test animation using the p5sunflow library Smiley


nice first attempt. sometimes simple is all you need. 8)

some problems with the front clipping plane though - sometimes a cube gets too close to the front and you lose the near wall and you can see its innards (which are much darker as they are all in shadow - big purple box at 0:22 for instance)
Re: voronoi+processing+p5sunflow
Reply #24 - Nov 18th, 2009, 8:57am
 
amnonP5 wrote on Nov 17th, 2009, 2:34pm:
http://www.vimeo.com/7670654

My first test animation using the p5sunflow library Smiley


Jaden, can you post your code
Re: voronoi+processing+p5sunflow
Reply #25 - Nov 18th, 2009, 3:51pm
 
Thanks guys. I promise to be harder, better, faster, stronger and more creative from now on Wink The clipping issues appeared in the sunflow version (not in opengl) so they became apparent after rendering... I guess the boxes z-location could be used to solve this if needed?

andrew, here's the code I used. It may not be the most efficient or anything, but I'm just learning so... Anyway, I added a lot of comments so it's clear for everyone. Hope it helps some people.

Code:
// import libraries for using OPENGL, P5Sunflow and MovieMaking
// OPENGL for preparing, P5Sunflow for rendering
// in the code below sunflow and moviemaking are commented out
// 'camera' movement = everything moving towards the camera :-)

import processing.opengl.*;

import hipstersinc.sunflow.shape.*;
import hipstersinc.sunflow.*;
import hipstersinc.sunflow.shader.*;
import hipstersinc.sunflow.util.*;
import hipstersinc.*;
import hipstersinc.sunflow.light.*;

import processing.video.*;

// starting location for the 'camera'
float z = -1000;

// number of boxes
int n = 1000;

// count used for resetting boxpositions etc. every once in a while
int count = 0;
// the first time the 'reset' is after 250 frames
int countlimit = 250;
// count used to eventually finish the movie and exit the sketch
int countclose = 0;

// arrays for all boxes stuff, names are pretty obvious
float[] arrayBoxdim = new float[n];
float[] arrayLocationx = new float[n];
float[] arrayLocationy = new float[n];
float[] arrayLocationz = new float[n];
float[] arraySpeed = new float[n];
float[] arrayBoxcolorhue = new float[n];
float[] arrayBoxcolorsat = new float[n];
float[] arrayBoxcolorbri = new float[n];

MovieMaker mm;

void setup() {
 size(1280, 720, OPENGL);
//  size(1280, 720, "hipstersinc.P5Sunflow");
 noStroke();

// setting random values for everything
 for (int i = 0; i < n-1; i++) {
   arrayBoxdim[i] = random(30,250);
   arrayLocationx[i] = random(3*width);
   arrayLocationy[i] = random(3*height);
   arrayLocationz[i] = -10*random(height);
   arraySpeed[i] = random(-10,10);
   arrayBoxcolorhue[i] = random(360);
   arrayBoxcolorsat[i] = random(90,100);
   arrayBoxcolorbri[i] = random(60,100);
 }

//  mm = new MovieMaker(this, width, height, "processing.mov",
//  24,MovieMaker.ANIMATION, MovieMaker.LOSSLESS);

}

void draw() {
 background(255);

// 50% of all the boxes move horizontally (at different speeds)
 for (int i = 0; i < n-1; i+=2) {
   arrayLocationx[i] = arrayLocationx[i] + arraySpeed[i];
 }

// 50% of all the boxes move vertically (at different speeds)
 for (int i = 1; i < n-1; i+=2) {
   arrayLocationy[i] = arrayLocationy[i] + arraySpeed[i];
 }

 translate(-width,-height);

// drawing all the boxes, translating them to their xyz locations
// the z is used for the 'camera' fly-through effect
// filling them with their respective HSB-colors
 for(int i=0; i<n; i++) {
   pushMatrix();
   translate(arrayLocationx[i],arrayLocationy[i],arrayLocationz[i]+z);
   colorMode(HSB,360,100,100);
   fill(arrayBoxcolorhue[i],arrayBoxcolorsat[i],arrayBoxcolorbri[i]);
   box(arrayBoxdim[i]);
   popMatrix();
 }

//  mm.addFrame();

// 'camera' movement speed
 z+=5;

// counter to reset scene every 100 frames (250 the first time)
 count+=1;
 if (count == countlimit) {
   for (int i = 0; i < n-1; i++) {
     arrayBoxdim[i] = random(30,250);
     arrayLocationx[i] = random(3*width);
     arrayLocationy[i] = random(3*height);
     arrayLocationz[i] = -10*random(height);
     arraySpeed[i] = random(-10,10);
     arrayBoxcolorhue[i] = random(360);
     arrayBoxcolorsat[i] = random(90,100);
     arrayBoxcolorbri[i] = random(60,100);
   }
   count = 0;
   countlimit = 100;
 }

// counter for finishing the movie and exiting after 1850 frames
 countclose+=1;
 if (countclose >= 1850) {
//    mm.finish();
   exit();
 }
}
Re: voronoi+processing+p5sunflow
Reply #26 - Nov 19th, 2009, 6:38am
 
Not sure what I'm doing wrong here, very new to processing but not programming - I get this message when I try to run the op's sketch;

hipstersinc.P5Sunflow needs to be updated for the current release of Processing

I have the latest P5Sunflow library from the dev's website, any ideas?

Thanks
Re: voronoi+processing+p5sunflow
Reply #27 - Nov 19th, 2009, 7:01am
 
The library on the host's website is not compatible with 1.07-1.09 however some cool programmers have made a fork that is compatible

There are three (3) available.
www.beigerecords.com/joe/java/P5SunflowIntelForAnimation.zip

http://www.punyblog.com/2009/10/sunflow-output-from-processing.html
http://www.punyblog.com/wp-content/uploads/2009/10/library.zip

http://github.com/hryk/p5sunflow/tree/master

However the original trunk is here
http://github.com/markchadwick/p5sunflow/tree/master



Re: voronoi+processing+p5sunflow
Reply #28 - Nov 19th, 2009, 7:04am
 
Thanks very much
Re: voronoi+processing+p5sunflow
Reply #29 - Nov 20th, 2009, 12:57pm
 
http://draconiansolo.wordpress.com/2009/11/20/3d-test-001/
yee-ha.
sunflow rox.
Pages: 1 2 3