POV-Ray : Newsgroups : povray.advanced-users : Vector Math : Re: Vector Math Server Time
30 Jul 2024 06:28:39 EDT (-0400)
  Re: Vector Math  
From: Michael Andrews
Date: 10 Jan 2000 08:06:25
Message: <3879D8F8.D40B42C0@reading.ac.uk>
Hi Darcy,

Darcy Johnston wrote:
> 
> Say I have a cylinder which goes from 0, to <0, h, 0> and I want to
> transform it so that it runs from <a,b,c> to <x,y,z>. How do I go about
> figuring out that transformation?
> 
> Thanks,
> Darcy

Well, I wouldn't try to re-invent the wheel, so ...

Given S == vlength(<a,b,c>-<x,y,z>)

1) Scale your object by S/h or <1,S,1>/h depending whether you want to
keep the proportions consistent.
2) Apply one of the reorientation macros to the object. The two I can
remember are in John VanSickle's Thoroughly Useful Macros and Gilles
Tran's tree generator, either of which should do the trick.

Hope this helps,
	Mike Andrews.


Post a reply to this message

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