POV-Ray : Newsgroups : povray.general : Getting a normal from trace() Server Time
26 Nov 2024 09:51:27 EST (-0500)
  Getting a normal from trace() (Message 1 to 3 of 3)  
From: Stephen
Subject: Getting a normal from trace()
Date: 27 Jan 2011 16:29:37
Message: <4d41e3c1$1@news.povray.org>

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


Post a reply to this message

From: StephenS
Subject: Re: Getting a normal from trace()
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

From: Stephen
Subject: Re: Getting a normal from trace()
Date: 27 Jan 2011 18:32:58
Message: <4d4200aa$1@news.povray.org>
On 27/01/2011 11:04 PM, StephenS wrote:
> 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?

Thanks Stephen, I looked at that scene but missed "Reorient_Trans".


-- 
Regards
     Stephen


Post a reply to this message

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