Re: Assigning different colors



Andy V wrote:
Joris Deboris wrote:
Hi group,


I have a bunch of gluSpheres that I randomly place in an environment. Now I want to do the following: spheres that are closer to the 'camera' should have a different color than those that are further away. Is there any way to do this?

Example: spheres that are closest to the camera are assigned a red color and that color changes to green for spheres that are further away...


Look into glFog and friends.

OK, thanks!


--
Andy V
.



Relevant Pages

  • Assigning different colors
    ... I have a bunch of gluSpheres that I randomly place in an environment. ... Now I want to do the following: spheres that are closer to the 'camera' should have a different color than those that are further away. ... spheres that are closest to the camera are assigned a red color and that color changes to green for spheres that are further away... ...
    (comp.graphics.api.opengl)
  • Re: software rasterizer for 3d pool/billiard balls
    ... Thanks Andy, that article looks usefull but it seems to only work for ... perspective a that you would ever see on the balls, ... thousands of spheres, to many to use triangles but perspective has to ...
    (comp.graphics.algorithms)
  • Re: Assigning different colors
    ... I have a bunch of gluSpheres that I randomly place in an environment. ... Now I want to do the following: spheres that are closer to the 'camera' should have a different color than those that are further away. ... spheres that are closest to the camera are assigned a red color and that color changes to green for spheres that are further away... ...
    (comp.graphics.api.opengl)
  • Pixels not occluding
    ... camera around, translating the spheres, etc. ... private void DrawSphere1(float radius, float X, float Y, float Z) ... Mesh mesh = Mesh.Sphere; ...
    (microsoft.public.win32.programmer.directx.managed)