POV-Ray : Newsgroups : povray.advanced-users : Normal vector deformation : Re: Normal vector deformation Server Time
30 Jul 2024 02:14:41 EDT (-0400)
  Re: Normal vector deformation  
From: Chris Huff
Date: 14 Jan 2001 09:44:52
Message: <chrishuff-7859A9.09461714012001@news.povray.org>
In article <3a6190d0@news.povray.org>, "Rune" <run### [at] inamecom> 
wrote:

> It doesn't work, but I can't understand why.
> 
> ( Perpendiculize(A,B) adjusts A so it is perpendicular to B. The 
> adjusted A is returned. )

I think you need to make two vectors perpendicular to the normal, deform 
those, and find a vector perpendicular to those. It looks like this 
might have been what you are doing...cross products give me a headache. 
Maybe something along the lines of:

#local Small = 0.001;

#macro mezz_deform_dir(P, DP, N) (mezz_deform(P + N*Small) - DP) #end

#macro DeformNormal(Point, deformedPoint, Normal)
    #local N1 = Perpendiculize(Normal, y);
    #local N2 = Perpendiculize(Normal, N1);

    #local N1 = mezz_deform_dir(Point, deformedPoint, N1);
    #local N2 = mezz_deform_dir(Point, deformedPoint, N2);

    #local deformedNormal = Perpendiculize(N1, N2);
    (deformedNormal)
#end

I don't think a third point will be necessary, because the normal 
shouldn't change if the surface moves perpendicularly to it...but I may 
be wrong, it may be something to try.

-- 
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.