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 & HelpOpenGL and 3D Libraries › gradient background in 3D space
Page Index Toggle Pages: 1
gradient background in 3D space (Read 1005 times)
gradient background in 3D space
Apr 14th, 2008, 5:05am
 
hi, currently i have some particles flying around in 3D space with the camera following one of the particles.

im trying add a gradient background like a light source in space.  this i hope will give the camera some orientation.

ive tried enclosing the scene in a sphere and shinning a spotlight onto the inside of its faces. this worked to some degree but had some limitations like, i couldn't get the gradient to work over the entire sphere, only for one of its hemispheres. also, i had no control over how much the light dissolved over distance.

im not convinced with my approach and id love to hear of other techniques people have used.
Re: gradient background in 3D space
Reply #1 - Apr 14th, 2008, 5:23pm
 
use multiple spotlights and play with the light cutoff angle, and  falloff. Another alternative would be to use a texture on the sphere.
Re: gradient background in 3D space
Reply #2 - Apr 14th, 2008, 5:50pm
 
I've been thinking about doing this too.

I thought that I could just create a big flat vertex shape with a gradient texture applied to it and then pushed right to the back (with all the z-sorting stuff). This is sort of like mixing 2D with 3D though and apparently hint(DISABLE_DEPTH_TEST) - can't remember exactly - should enable you to do this (but i can't get it working, but haven't spent much time on it).
Re: gradient background in 3D space
Reply #3 - Apr 14th, 2008, 10:51pm
 
I use textured spheres myself.  Working on a piece now that needs to have a subtle but animated background so I am using a few nested spheres with slightly different textures and rotation speeds.  Works fairly well.  Its not ideal but it gets the job done.
Re: gradient background in 3D space
Reply #4 - Apr 15th, 2008, 12:26pm
 
just tried the textured sphere approach and it looks great!
thx very much for all ur help.
Re: gradient background in 3D space
Reply #5 - Apr 17th, 2008, 5:34am
 
got excited too soon.

im using the TexturedSphere example that comes with processing. problem is, I can't find a way to deform my image in the same way as in "world32k.jpg". i've tried spherical mapping filters in photoshop but it still leaves the image bulging on the sphere.

i think the reason for this is, the sphere in the TexturedSphere example is rendered using two parts, the spherical caps and the cylidrical middle section.

need to work out a way to distort my image to match this render.

or does anyone have any other approach.

cheers in advance.
Page Index Toggle Pages: 1