POV-Ray : Newsgroups : povray.general : Calculating normals : Re: Calculating normals Server Time
10 Aug 2024 11:19:43 EDT (-0400)
  Re: Calculating normals  
From: Nieminen Juha
Date: 1 Jan 2000 11:24:33
Message: <386e2a41@news.povray.org>
Remco de Korte <rem### [at] xs4allnl> wrote:
: I know how to normalize a vector (as you describe), i _don't_ know hot
: to calculate VCROSS (I mistook it for caclulating the average).
: So, again: how to calculate a normal?

  The cross-product of two vectors <x1,y1,z1> and <x2,y2,z2> can be
calculated this way:

|  i  j  k |
| x1 y1 z1 | = (y1*z2-y2*z1)i + (x2*z1-x1*z2)j + (x1*y2-x2*y1)k
| x2 y2 z2 |

ie:

  <y1*z2-y2*z1, x2*z1-x1*z2, x1*y2-x2*y1>

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

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