POV-Ray : Newsgroups : povray.binaries.images : Realistic bricks : Re: Realistic bricks Server Time
7 Aug 2024 07:10:39 EDT (-0400)
  Re: Realistic bricks  
From: Bill Pragnell
Date: 2 May 2006 11:15:01
Message: <web.44577647782f552a731f01d10@news.povray.org>
Bill Hails <bil### [at] europeyahoo-inccom> wrote:
> generating the normals isn't all that hard.
>
> Each vertex is touched by three or more triangles.
>
> For each triangle you take a vector perpendicular to it's plane,
> of length proportional to the length of that triangle's two edges that
> intersect with the point in question (I think that's vcross() not sure
> now because it's been a while).
>
> Then you average those vectors to give you the normal at that point.

It wasn't the actual calculation that was putting me off, just the amount of
thought and coding required to implement it! It would indeed be vcross(),
and there's VPerp_To_Plane(v1,v2) in math.inc, although I fail to see the
difference between them to be honest.

Each vertex is touched by eight triangles, although I could probably get
away with averaging the normals to the four non-planar quadrilaterals
touching each vertex (which amounts to the same thing, at least in my
head). I'm going to have to re-write my main loop...

Well, I've thought about it now, so obviously I'm not going to be happy
until I've done it! :)

To be continued...

Bill


Post a reply to this message

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