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: Mark Weyer
Date: 23 Sep 2003 05:01:56
Message: <3F700D09.5080102@informatik.uni-freiburg.de>
> What I'm trying to do for my Worm is the following:
> I know the position of the neck, so to speak the
> point where the head will be attached. I know the
> distance between the neck and the eyes.
> And finally, I know a position where the Worm
> should look at.

What you need is not the point where the eyes are, but the point
straight up from the neck that is the same height as the eyes
(if the head itself is upright). Lets call that the brain point,
or in the case of a worm the ganglion point.

> 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.

Fine. First calculate the angle for eyes sitting on the neck.
Now consider the real solution. You have three points: neck,
ganglion and object. That the ganglion looks at the object
(which is equivalent to the eyes looking at the object) means
that these points form a triangle rectangluar at the ganglion.
The angle which you need to correct the above angle is the
angle at the object. Now for the correct ganglion point (which
we still do not know), the sine of the correction angle is
   |ganglion-neck| / |object-neck|,
which we can calculate. So you can determine the correction
angle as well.


-- 
merge{#local i=-11;#while(i<11)#local
i=i+.1;sphere{<i*(i*i*(.05-i*i*(4e-7*i*i+3e-4))-3)10*sin(i)30>.5}#end
pigment{rgbt 1}interior{media{emission x}}hollow}//  Mark Weyer


Post a reply to this message

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