POV-Ray : Newsgroups : povray.advanced-users : Rotating an object around an arbitrary point? : Re: Rotating an object around an arbitrary point? Server Time
29 Jul 2024 16:25:38 EDT (-0400)
  Re: Rotating an object around an arbitrary point?  
From: Warp
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.