POV-Ray : Newsgroups : povray.advanced-users : Vector to Angle : Re: Vector to Angle Server Time
20 Apr 2024 04:12:43 EDT (-0400)
  Re: Vector to Angle  
From: scott
Date: 31 May 2017 12:07:48
Message: <592eea54$1@news.povray.org>
On 31/05/2017 07:06, dick balaska wrote:
> Am 2017-05-29 15:42, also sprach dick balaska:
>> I'm trying to master converting a vector to an angle in 3D with no luck
>
> Help, Math wizards, you're my only hope.
>
> Ok. I'm stuck. I'm missing something.
>
> My goal is to position an object in a fixed position on the screen, like
> carrying a flashlight. Or a gun, like in a video game.
>
> So I need to calculate the angle of Lookat-Camera and act on that.
>
> My primary macro works, but I'm missing something in determining the
> position of an object that is not exactly on the look_at.  I can't
> figure out if I need to subtract an angle or a vector or from whom.
> For example, in this screen shot,
> http://www.buckosoft.com/tteoac/video/testRenders/test001.png
> the red ball is look_at,
> the cyan ball is the angle correctly derived from (look_at-camera),
> but the green ball is only correctly 1 unit horizontally to the right of
> the cyan ball for this angle <0,0,0>. Otherwise it spins incoherently
> (to me) around the cyan ball. Interestingly, it keeps the correct distance.
> http://www.buckosoft.com/tteoac/video/testRenders/test.mp4
>
> argh. I keep trying to work it out on paper, but I'm not feeling it.

Try the attached.


Post a reply to this message


Attachments:
Download 'test16.pov.txt' (3 KB)

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