POV-Ray : Newsgroups : povray.general : translation / rotation query : Re: translation / rotation query Server Time
20 Apr 2024 09:59:41 EDT (-0400)
  Re: translation / rotation query  
From: Bill Pragnell
Date: 18 Sep 2019 17:40:02
Message: <web.5d82a3904dd2969c1b6c6b3a0@news.povray.org>
Bob Frew <bob### [at] ntlworldcom> wrote:
> For any line with p1 and p2 as the end points to translate/rotate as
> necessary to put
>          p1 at <0,0,0> and p2 on the x axis
> I need to then know necessary translate/rotate to be able to put them
> back.

transforms.inc has some useful macros for this sort of thing (see
http://www.povray.org/documentation/3.7.0/r3_4.html#r3_4_9_1_29).

For example, you could do

translate -p1 Reorient_Trans(p2-p1, x)

then

Reorient_Trans(x, p2-p1) translate p1

It would be useful to know the wider context of what you're trying to do. There
might be a larger elegant solution that helps even more!

Bill


Post a reply to this message

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