POV-Ray : Newsgroups : povray.newusers : TRON Game Grid... : Re: TRON Game Grid... Server Time
29 Jul 2024 06:26:05 EDT (-0400)
  Re: TRON Game Grid...  
From: Trevor G Quayle
Date: 10 Jul 2006 10:40:00
Message: <web.44b26678c60ff130c150d4c10@news.povray.org>
"Carl" <car### [at] semisouthcom> wrote:
> I'd like to try and copy the game grid effect as seen in the movie TRON.
> Check out this example for those who aren't familiar with it.
>
> http://www.wwwmwww.com/Matt/Animation1.gif
>
> Here is one of my current POV-Ray renders...
>
> http://www.wwwmwww.com/Matt/hover2.png
>
> However reciently I've been pointed to this work done in Realsoft 3D
>
> http://www.matthias-kappenberg.de/index.php?id=165
>
> Can anyone here tell how he pulled off this effect?  And better yet can it
> be copied in POV-Ray?
>
> Thanks,
> Carl

Have a look at this code I threw together.  The function generates a grid
with a given spacing.  The gridline width varies from the specified GW at a
distance 0 from the camera (or CL) to the full grid spacing at infinity.
The widening is an exponential function and the WF term defines how quickly
the gridlines thicken.


//start
global_settings {assumed_gamma 1.0}

#declare CL=<5,10,-5>;

camera {
  location  CL
  look_at   <0.0,6,  0.0>
}


#declare GS=10;//grid spacing
#declare GW=1;//gridline width (at distance=0), (gridline width = GS at
infinity)
#declare WF=1/500;//gridline widening function (<0 widens)

#declare Cx=CL.x;
#declare Cy=CL.y;
#declare Cz=CL.z;

#declare GLW=function(Dst){GW+(GS-GW)*(1-pow(1/exp(Dst),WF))}//widening
function =GW at 0, =GS at infinity
#declare
G1=function(Dir,Dst){select(GLW(Dst)-abs((GS/2-abs(mod(Dir,GS)))*2),0,1)}//gridline
function
#declare dist=function (x,y,z){sqrt(pow(Cx-x,2)+pow(Cy-y,2)+pow(Cz-z,2))}
//distance from CL

plane {
  y, -1
  pigment { function{max(G1(x,dist(x,y,z)),G1(z,dist(x,y,z)))} }
  finish{ambient 1}
}
//end

-tgq


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.