POV-Ray : Newsgroups : povray.newusers : Local Co-ordinates Server Time
5 Nov 2024 01:24:12 EST (-0500)
  Local Co-ordinates (Message 1 to 7 of 7)  
From: insomniac
Subject: Local Co-ordinates
Date: 19 Sep 2002 18:15:11
Message: <web.3d8a4bb0ae2b17b330411fcf0@news.povray.org>
Is there a way to change the local co-ordinates of an object or grouped
objects so that when you rotate that object it moves around that point. Like
how you can do it in Moray. But when I use the pov. scene Moray emits it
hasn't converted the co-ordinates.

Thank you,
          your help will be greatly appreciated.


Post a reply to this message

From: KalleK
Subject: Re: Local Co-ordinates
Date: 19 Sep 2002 18:37:26
Message: <3d8a51a6$1@news.povray.org>
"insomniac" <lee### [at] hotmailcom> schrieb im Newsbeitrag
news:web.3d8a4bb0ae2b17b330411fcf0@news.povray.org
> Is there a way to change the local co-ordinates of an object or
> grouped objects so that when you rotate that object it moves around
> that point. Like how you can do it in Moray. But when I use the pov.
> scene Moray emits it hasn't converted the co-ordinates.
>
> Thank you,
>           your help will be greatly appreciated.

You have to move your object into the origin, rotate it, and move it back.

Maybe a little macro will do:

#macro Rotate_around (RotVector, Position)
    translate -Position
    rotate RotVector
    translate Position
#end

Maybe such a macro is already in the includes which are shipped with POV-Ray,
but I don't know.

Kalle


Post a reply to this message

From: insomniac
Subject: Re: Local Co-ordinates
Date: 19 Sep 2002 19:15:06
Message: <web.3d8a598449510b1030411fcf0@news.povray.org>
KalleK wrote:
>
>You have to move your object into the origin, rotate it, and move it back.
>
>Maybe a little macro will do:
>
>#macro Rotate_around (RotVector, Position)
>    translate -Position
>    rotate RotVector
>    translate Position
>#end
>
>Maybe such a macro is already in the includes which are shipped with POV-Ray,
>but I don't know.
>
>Kalle
>
************************************************

Hello Kalle,
            I've only been using povray a few weeks and don't know very
much,
could you please elaborate "move your object into the origin, rotate it, and
move it back" how do you move it into the origin? I'm sorry, i'm still
learning all the ins and outs. Thank you for your response.


Post a reply to this message

From: insomniac
Subject: Re: Local Co-ordinates
Date: 19 Sep 2002 19:50:02
Message: <web.3d8a618e49510b104afeda730@news.povray.org>
What i've got is a grouped object (a Table Lamp), it rotates around the
world coordinates and I want it to rotate around the edge base of the lamp
so I can animate it falling over.


Post a reply to this message

From: Warp
Subject: Re: Local Co-ordinates
Date: 19 Sep 2002 20:08:48
Message: <3d8a66e1@news.povray.org>
insomniac <lee### [at] hotmailcom> wrote:
> What i've got is a grouped object (a Table Lamp), it rotates around the
> world coordinates and I want it to rotate around the edge base of the lamp
> so I can animate it falling over.

translate -edge_base_of_the_lamp
rotate whatever
translate edge_base_of_the_lamp

-- 
#macro M(A,N,D,L)plane{-z,-9pigment{mandel L*9translate N color_map{[0rgb x]
[1rgb 9]}scale<D,D*3D>*1e3}rotate y*A*8}#end M(-3<1.206434.28623>70,7)M(
-1<.7438.1795>1,20)M(1<.77595.13699>30,20)M(3<.75923.07145>80,99)// - Warp -


Post a reply to this message

From: Fidel viegas
Subject: Re: Local Co-ordinates
Date: 19 Sep 2002 21:32:07
Message: <B9B03842.4D4C%fidel.viegas@artrecognition.co.uk>
> Hello Kalle,
> I've only been using povray a few weeks and don't know very
> much,
> could you please elaborate "move your object into the origin, rotate it, and
> move it back" how do you move it into the origin? I'm sorry, i'm still
> learning all the ins and outs. Thank you for your response.
> 

Suppose your object is place at <4, 5, 1>. What you do is this

object {
  yourobject
  translate -<4, 5, 1> // place the object at the origin <0, 0, 0>
  rotate <45, 0, 0> // just an example
  translate <4, 5, 1> // move the object back to where it was
}

Basicallly, you first move the object to the origin, by translating it by
the negation of its current position. You then rotate it, and after rotating
it, you just move the object to where it was before by translating the same
amount without the '-' sign.

Hope that helps.

Fidel.


Post a reply to this message

From: insomniac
Subject: Re: Local Co-ordinates
Date: 19 Sep 2002 22:25:04
Message: <web.3d8a86a349510b10dd2c03fb0@news.povray.org>
Fidel viegas wrote:
>Suppose your object is place at <4, 5, 1>. What you do is this
>
>object {
>  yourobject
>  translate -<4, 5, 1> // place the object at the origin <0, 0, 0>
>  rotate <45, 0, 0> // just an example
>  translate <4, 5, 1> // move the object back to where it was
>}
>
>Basicallly, you first move the object to the origin, by translating it by
>the negation of its current position. You then rotate it, and after rotating
>it, you just move the object to where it was before by translating the same
>amount without the '-' sign.
>
>Hope that helps.
>
>Fidel.
************************************************
Hey that worked! Thanks a lot for your help.

insomniac.


Post a reply to this message

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