POV-Ray : Newsgroups : povray.general : Getting a normal from trace() : Re: Getting a normal from trace() Server Time
29 Jul 2024 16:32:57 EDT (-0400)
  Re: Getting a normal from trace()  
From: StephenS
Date: 27 Jan 2011 18:05:01
Message: <web.4d41f9fcb0805ae9e0c440280@news.povray.org>
Stephen <mcavoys_at@aoldotcom> wrote:

> it perpendicular to the tangent.
> I tried tracing against a sphere for simplicity and even that is beyond
> me, to get the objects aligned to the normal.
>
> Some sample code would be helpful.
>
> TIA
>
> --
> Regards
>      Stephen

From: \scene\language\trace2.pov
Add: #include "transforms.inc" // at the top of the scene
about line 64

    //cylinder {iPt, iPt + iNorm*PinHeight, 0.01}
    cylinder {0,<0,PinHeight,0>, 0.01
     Reorient_Trans(<0,1,0>, iNorm)
     translate iPt   //<iPt.x,iPt.y,iPt.z>
    }

I have replaced the original cylinder{} with one defined at the origin and
rotated to match the normal, then translated into place.

Is this what you where looking for?

Stephen S


Post a reply to this message

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