POV-Ray : Newsgroups : povray.general : Re orientation help request : Re: Re orientation help request Server Time
1 Aug 2024 10:14:11 EDT (-0400)
  Re: Re orientation help request  
From: Anthony D  Baye
Date: 5 Nov 2005 02:33:54
Message: <436c6062$1@news.povray.org>
Norbert Werner Kern wrote:
> If Norm is your normal vector, you have to rotate your traced object like
> this in order to orient it:
> 
> rotate <degrees (atan2 (Norm.z,Norm.y)), 0, -degrees (atan2
> (Norm.x,Norm.y))>
> 
> 
> Norbert Kern
> 
> 
Personally, I'd let POV do the work.

#include "Transforms.inc"
#include "maths.inc"

#declare N = <0,0,0> // Initial Normal Vector
#declare S = some_location // The initial position of the object to drop

trace(ENV, S, -y, N)

#if(vlength(N)!= 0)
object {
      YourObject
	texture { whatever }
	     Reorient_Trans(y,N)
	     translate S
      }
#end

Here's a good tutorial http://povray.tirnalong.com/ow.asp?DropOnSurface

And I'd be glad to post my macro, simple though it is, upon request.

Regards,

A.D.B


Post a reply to this message

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