POV-Ray : Newsgroups : povray.off-topic : Rotating vectors in 3D : Re: Rotating vectors in 3D Server Time
6 Sep 2024 21:19:23 EDT (-0400)
  Re: Rotating vectors in 3D  
From: Warp
Date: 12 Oct 2008 13:33:06
Message: <48f234d1@news.povray.org>
Severi Salminen <sev### [at] notthissaunalahtifiinvalid> wrote:
> My head is spinning. I have a fairly simple task:

> V1 = 0,1,0 (this is a vector pointing up along y-axis)
> V2 = user defined unit vector pointing anywhere.

> How do I rotate V1 using rotateX(), rotateY() and rotateZ() so that it
> equals V2?

> This would be intersting, too:

> What is the resulting 4x4 transformation matrix that does the same thing?

> Actually, I'd prefer just the transformation matrix because I guess I
> could avoid using trigonometric functions back and forth.

  You can find it in transform.inc, as the PointAt() macro.

-- 
                                                          - Warp


Post a reply to this message

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