From 259fbf180b231751bef479780401414a94b62fe1 Mon Sep 17 00:00:00 2001 From: codeanticode Date: Wed, 9 Feb 2011 14:59:52 +0000 Subject: [PATCH] Updated Planets example to make it look better in landscape orientation --- java/libraries/opengl2/examples/Planets/Planets.pde | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/java/libraries/opengl2/examples/Planets/Planets.pde b/java/libraries/opengl2/examples/Planets/Planets.pde index 9ada4719d..e99f6bec5 100644 --- a/java/libraries/opengl2/examples/Planets/Planets.pde +++ b/java/libraries/opengl2/examples/Planets/Planets.pde @@ -21,7 +21,7 @@ PShape planet2; PImage surftex2; void setup() { - size(480, 800, OPENGL2); + size(800, 480, OPENGL2); starfield = loadImage("starfield.jpg"); suntex = loadImage("sun.jpg"); @@ -42,7 +42,6 @@ void setup() { // Using 3D Perlin noise to generate a clouds texture that is seamless on // its edges so it can be applied on a sphere. - println("Generating clouds texture. It takes some time, please wait..."); cloudtex.loadPixels(); Perlin perlin = new Perlin(); for (int j = 0; j < cloudtex.height; j++) { @@ -61,7 +60,6 @@ void setup() { } } cloudtex.updatePixels(); - println("Done."); textureMode(NORMAL); noStroke(); @@ -103,9 +101,9 @@ void draw() { p.texcoords[2 * i + 0] = u; } p.updateTexcoords(); - + pushMatrix(); - translate(width/2, height/2, -100); + translate(width/2, height/2, -300); pushMatrix(); rotateY(PI * frameCount / 500); @@ -121,9 +119,8 @@ void draw() { popMatrix(); noLights(); - pointLight(255, 255, 255, 0, 0, 100); + pointLight(255, 255, 255, 0, 0, -150); - translate(0.75 * width, 0.6 * height, 350); + translate(0.75 * width, 0.6 * height, 50); shape(planet1); } -