POV-Ray : Newsgroups : povray.advanced-users : Calculating an angle : Re: Calculating an angle Server Time
28 Jul 2024 22:29:02 EDT (-0400)
  Re: Calculating an angle  
From: Ricky Reusser
Date: 23 Sep 2003 00:56:03
Message: <3f6fd262@news.povray.org>
Tim Nikias v2.0 wrote:

> What I'm trying to do is to calculate an angle for
> neck, so that the eyes, when looking straight-forward,
> will look at the focal-point.
> I somehow can't manage to get my head around
> the problem so that I actually get the correct
> angle. I seem to end up with an angle which would
> point eyes sitting the neck to the object, but eyes
> sitting on the head will actually look too far below
> or above the point.

Are you using degrees instead of radians in the functions?  ;-)  Sorry. 
Maybe I'm misunderstanding, but it sounds like you're using trig to figure
out the position of things.  That's the hard way.  All you need is
something like a macro that puts three orientation vectors and a position
vector into a matrix transformation.  I haven't really worked on this type
of stuff for a while, but I imagine that's in pov's function includes by
now.  If you're already doing this, are you orienting the eyes last?  I
worked on a similar problem with Luxo Jr. a while ago and had a pretty hard
time getting the whole head to orient to the focus without twisting at a
funny angle in special cases, but I never used any trig.

Something like

#macro make_transformation(xv,yv,zv,pv)
        transform{
                matrix
                <        
                        xv.x, xv.y, xv.z,
                        yv.x, yv.y, yv.z,
                        zv.x, zv.y, zv.z,
                        pv.x, pv.y, pv.z
                >
        }
#end

Forgive me if this is nothing new and just let me know if I'm
misunderstanding.

 - Ricky


Post a reply to this message

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