POV-Ray : Newsgroups : povray.advanced-users : Normal vector deformation : Re: Normal vector deformation Server Time
29 Jul 2024 20:24:32 EDT (-0400)
  Re: Normal vector deformation  
From: Chris Huff
Date: 13 Jan 2001 17:36:49
Message: <chrishuff-6A6177.17382013012001@news.povray.org>
In article <3a60d0eb@news.povray.org>, "Rune" <run### [at] inamecom> 
wrote:

> Say the macro Deform(V) will return a deformed version of V.
> If I have the point P I can find the deformed point dP:
> #declare dP = Deform(P)
> 
> If I have the normal N, how can I find the deformed normal dN?

Try something like:
#declare SmallValue = 0.01;
#declare dN = vnormalize(Deform(P+V*SmallValue) - dP);

In other words, deform the point and a second point a short distance 
along the normal from it, and use the direction from dP to the new point 
as your normal. This should work in most circumstances, and you could 
decrease SmallValue for more accuracy.

-- 
Christopher James Huff
Personal: chr### [at] maccom, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tagpovrayorg, http://tag.povray.org/

<><


Post a reply to this message

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