POV-Ray : Newsgroups : povray.advanced-users : rotating parallel to surface normal : rotating parallel to surface normal Server Time
28 Jul 2024 22:28:23 EDT (-0400)
  rotating parallel to surface normal  
From: Doug Eichenberg
Date: 25 Jul 2003 19:48:13
Message: <3f21c1bd$1@news.povray.org>
Let's say I have an object "A" at the origin, and a known surface normal
<x,y,z>.  I want to find the rotation vector <Rx,Ry,Rz> of the surface
normal <x,y,z>, such that when I rotate "A":

object{ A rotate<Rx,Ry,Rz> }

it lies along the surface normal.

I tried doing this as follows:

object{ A rotate<atan2d(Norm.y,Norm.z), atan2d(Norm.x,Norm.z),
atan2d(Norm.x,Norm.y)>

but I seem to be getting strange results.

Anyone have code they used for doing this?  Or know how in general?
Thanks for the help.

--
Doug Eichenberg
www.getinfo.net/douge
dou### [at] nlsnet


Post a reply to this message

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