POV-Ray : Newsgroups : povray.text.tutorials : Re: Yeaah! I got it to work!! Server Time
15 Oct 2024 05:39:58 EDT (-0400)
  Re: Yeaah! I got it to work!! (Message 1 to 1 of 1)  
From:
Subject: Re: Yeaah! I got it to work!!
Date: 6 Mar 2002 10:51:14
Message: <5mdc8ukvplcavtnekp4f0cvtebe8rtlbob@4ax.com>
On Wed, 6 Mar 2002 09:32:35 -0600, "Shay" <sah### [at] simcopartscom> wrote:
> Thank you again, ABX. It seems that you are always waiting in a dark corner
> ready to jump out with a formula the way Ken is with a link.

but.... I have posted link too

> I never went to college, so most of the math I know is self tought. This
> leaves BIG holes in my math knowledge.

I love math. That's why 8th birthday of my dayghter will be 08.08.08 :-)

> The formula you supplied will help a lot, because I will henceforth be
> adding a "weighted" switch to all of my vertex normalizing macros.

I strongly suggest to implement it as function to speed it up:

#include "functions.inc"
#local triangle_area_engine=function{(x+y+z)*(y+z-x)*(x+y-z)*(x+z-y)/16}
#local triangle_area=
  function(x1,y1,z1,x2,y2,z2,x3,y3,z3)
    {sqrt(triangle_area_engine(
        f_r(x2-x1,y2-y1,z2-z1),
        f_r(x3-x2,y3-y2,z3-z2),
        f_r(x3-x1,y3-y1,z3-z1)
    ))};

all you need is to call this function with coordinates of vertices
(be careful - not tested)

it is general advice so I'm crossposting this to text.tutorials with
follow-ups to p.b.i as previously

ABX


Post a reply to this message

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