POV-Ray : Newsgroups : povray.advanced-users : Rotating an object around an arbitrary point? Server Time
29 Jul 2024 18:23:43 EDT (-0400)
  Rotating an object around an arbitrary point? (Message 1 to 3 of 3)  
From: Arie L  Stavchansky
Subject: Rotating an object around an arbitrary point?
Date: 17 Oct 2001 13:31:22
Message: <B7F338A5.17B3%arie@andrew.cmu.edu>
Hi Everybody :)

Is it possible to rotate any object around an arbitrary point, instead of
the origin?

Thanks,
Arie


Post a reply to this message

From: Christoph Hormann
Subject: Re: Rotating an object around an arbitrary point?
Date: 17 Oct 2001 13:50:37
Message: <3BCDC4F7.93435C47@gmx.de>
"Arie L. Stavchansky" wrote:
> 
> Hi Everybody :)
> 
> Is it possible to rotate any object around an arbitrary point, instead of
> the origin?
> 

In Povray 3.5 there is a Rotate_Around_Trans() macro in 'transforms.inc'.

Christoph

-- 
Christoph Hormann <chr### [at] gmxde>
IsoWood include, radiosity tutorial, TransSkin and other 
things on: http://www.schunter.etc.tu-bs.de/~chris/


Post a reply to this message

From: Warp
Subject: Re: Rotating an object around an arbitrary point?
Date: 17 Oct 2001 14:19:09
Message: <3bcdcb9c@news.povray.org>
Christoph Hormann <chr### [at] gmxde> wrote:
: In Povray 3.5 there is a Rotate_Around_Trans() macro in 'transforms.inc'.

  Perhaps it could be good to say how it works. This way he can learn
something and perhaps be able to use this knowledge for other similar
things (such as scale).

  If you want to rotate the object around the point 'ObjCenter', you just
have to translate the object so that this point gets located at the origin,
then you rotate the object, and then you translate it back to its place.
This is very easy to do:

object
{ MyObject
  translate -ObjCenter
  rotate whatever
  translate ObjCenter
}

-- 
#macro N(D,I)#if(I<6)cylinder{M()#local D[I]=div(D[I],104);M().5,2pigment{
rgb M()}}N(D,(D[I]>99?I:I+1))#end#end#macro M()<mod(D[I],13)-6,mod(div(D[I
],13),8)-3,10>#end blob{N(array[6]{11117333955,
7382340,3358,3900569407,970,4254934330},0)}//                     - Warp -


Post a reply to this message

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