POV-Ray : Newsgroups : povray.advanced-users : Normal vector deformation : Re: Normal vector deformation Server Time
26 Sep 2024 17:44:44 EDT (-0400)
  Re: Normal vector deformation  
From: Tor Olav Kristensen
Date: 13 Jan 2001 23:56:11
Message: <3A613022.B2D49A20@online.no>
Tor Olav Kristensen wrote:
> 
> Chris Huff wrote:
> >
> > In article <3A61158D.9D409B1B@online.no>, Tor Olav Kristensen
> > <tor### [at] onlineno> wrote:
> >
> > > Hmmm ... Are you sure about this ?
> >
> > The normal to the -x side of a box is -x. The top of the box is then
> > sheared +x so the -x and +x faces are at a 45 degree angle...but points
> > still remain in the same xz plane as they were before, the -y and +y
> > faces remain perpendicular to the y axis. The normal should be at a 45
> > degree angle now, <-sqrt(2)/2, sqrt(2)/2, 0> to be precise, but since
> > the two sample points were in the same xz plane, their position relative
> > to each other is the same, and the normal is still -x.
> 
> I see.
> 
> Then would this work ?
> 
> #declare dP = Deform(P);
> #declare vN = vnormalize(N);
> 
> #declare AA = 0.01;
> #declare BB = 0.1;
> 
> #declare dNpx = vnormalize(Deform(P + AA*(vN + x*BB)) - dP);
> #declare dNmx = vnormalize(Deform(P + AA*(vN - x*BB)) - dP);
> 
> #declare dNpy = vnormalize(Deform(P + AA*(vN + y*BB)) - dP);
> #declare dNmy = vnormalize(Deform(P + AA*(vN - y*BB)) - dP);
> 
> #declare dNpz = vnormalize(Deform(P + AA*(vN + z*BB)) - dP);
> #declare dNmz = vnormalize(Deform(P + AA*(vN - z*BB)) - dP);
> 
> #declare dN = vnormalize(dNpx + dNmx + dNpy + dNmy + dNpz + dNmz);

I see now that this will probably not work either.

I'll think of it while I sleep.  :)


Goodnight from Tor Olav
-- 
mailto:tor### [at] hotmailcom
http://www.crosswinds.net/~tok/tokrays.html


Post a reply to this message

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