POV-Ray : Newsgroups : povray.advanced-users : How do you rotate an object to face the origin? : Re: How do you rotate an object to face the origin? Server Time
28 Jul 2024 22:24:40 EDT (-0400)
  Re: How do you rotate an object to face the origin?  
From: David Wallace
Date: 30 Dec 2003 17:27:34
Message: <3ff1fbd6$1@news.povray.org>
"Rich" <SrP### [at] ricoswebcom> wrote in message
news:Xns### [at] 204213191226...
> "David Wallace" <dar### [at] earthlinknet> wrote in
> news:3fdf5798@news.povray.org:
>
> > The initial axis in the Reorient macro is the initial direction your
> > object is pointing.  Assuming that your object is created to point in
> > the +z direction, this should work:
> >
> > #object {
> >     thing
> >     Reorient( z, <-x1, -y1, -z1> )
> >     translate <x1, y1, z1>
> > }
>
>
> Hmm.  I guess what I didn't understand about the Reorient macro was how to
> determine the values it wanted.  I never would have thought to put
negative
> versions of the object's position, for example.  ChrisB's help solved the
> problem, and I actually understand a bit of why it worked!  Thanks for
your
> help, now that I have the problem solved I can look into the reorient
macro
> code more  closely to see if I can figure out what it does and needs.
>
> Rich

Your object is meant to be placed at <x1,y1,z1>.  For the object to point
back at the origin you need the direction vector <-x1, -y1, -z1>.  If you
use <x1, y1, z1> then your object would point away from the origin.  Try
both and see.  Also try Reorient(-z, <x1, y1, z1>), which points the rear of
the object away from the origin, hence the front at it.
-- 
David Wallace
TenArbor Consulting
"Just in Time Cash"
http://www.tenarbor.com


Post a reply to this message

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