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.
IndexProgramming Questions & HelpSyntax Questions › Point Light doesn't look good...
Page Index Toggle Pages: 1
Point Light doesn't look good... (Read 417 times)
Point Light doesn't look good...
Oct 28th, 2009, 12:52pm
 
I made a flat surface in processing and added a point light on the top of it. But it doesn't look good at all. I mean, in all other programs Point lights look like in the following image.  bit.ly/3Qcbbw . This screenshot was taken in Blender, but the point lights in other programs like AE, motion look the same too. But in processing, the best i can get is like the following screenshot bit.ly/20OngA . Any suggestions are highly appreciated. Thank you in advance.
P.S.: Couldn't post complete links because this is my first post.
Re: Point Light doesn't look good...
Reply #1 - Oct 28th, 2009, 1:24pm
 
i had the problem too... you can get some much better results if you divide your surface into a mesh...

see this sketch and press mouse button to see the difference

void setup(){
size(500, 500, P3D);
background(255);
noStroke();
sphereDetail(35);
}

void draw(){

//lights();
pointLight(151, 202, 226, 235, 440,   80);
pointLight(251, 22, 226, 205, 240,   80);
pointLight( 151, 222,  6,  305,  140,   80);

fill(215,220,210 );
translate(100,100);
int res = 100;
if(mousePressed)res=1;
for(int i = 0; i<res; i++){
 beginShape(QUAD_STRIP);
for(int j = 0; j<=res; j++){

vertex(i*300/res,j*300/res);
vertex((i+1)*300/res,(j)*300/res);

}endShape();
}}

Re: Point Light doesn't look good...
Reply #2 - Oct 28th, 2009, 1:40pm
 
Awesome! Subdivision did the trick! It definitely looks a lot better now..
Page Index Toggle Pages: 1