POV-Ray : Newsgroups : povray.advanced-users : Vector to Angle : Re: Vector to Angle Server Time
24 Apr 2024 20:54:04 EDT (-0400)
  Re: Vector to Angle  
From: dick balaska
Date: 31 May 2017 02:06:43
Message: <592e5d73$1@news.povray.org>
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.

-- 
dik


Post a reply to this message


Attachments:
Download 'test.inc.txt' (3 KB) Download 'animtest.ini.txt' (1 KB)

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