POV-Ray : Newsgroups : povray.newusers : Another newbie question Server Time
1 Nov 2024 05:22:38 EDT (-0400)
  Another newbie question (Message 1 to 4 of 4)  
From: A C C
Subject: Another newbie question
Date: 26 Mar 2006 14:20:01
Message: <web.4426e919e46c0111ee4c493c0@news.povray.org>
Hello, it's me again.

Is there any way to place objects in a circle so they are not evenly placed?




Antonio


Post a reply to this message

From: Chris B
Subject: Re: Another newbie question
Date: 26 Mar 2006 15:03:55
Message: <4426f3ab$1@news.povray.org>
"A_C_C" <nomail@nomail> wrote in message 
news:web.4426e919e46c0111ee4c493c0@news.povray.org...
> Hello, it's me again.
>
> Is there any way to place objects in a circle so they are not evenly 
> placed?
>

> and

>
> Antonio
>
>

Hi Antonio,

You can specify any rotation angles you like. The easiest is to rotate 
around the origin, so in the example I've defined 4 spheres 1 unit away from 
the origin in the +z direction. Then rotating around the +y axis gives what 
you've asked for.
You could also do a #while loop and if you want random rotations you can use 
the seed() and rand() functions.

camera {location <0,2,0.1> look_at <0,0,0>}
sphere {<0,0,1>, 0.01 rotate 267*y pigment{rgb <1,0,0>} finish {ambient 1}}
sphere {<0,0,1>, 0.01 rotate 270*y pigment{rgb <1,0,1>} finish {ambient 1}}
sphere {<0,0,1>, 0.01 rotate 271*y pigment{rgb <1,1,0>} finish {ambient 1}}
sphere {<0,0,1>, 0.01 rotate 320*y pigment{rgb <0,0,1>} finish {ambient 1}}

Regards,
Chris B.


Post a reply to this message

From: Warp
Subject: Re: Another newbie question
Date: 26 Mar 2006 16:41:33
Message: <44270a8c@news.povray.org>
Chris B <c_b### [at] btconnectcomnospam> wrote:
> You can specify any rotation angles you like.

  Note that if you rotate the object with the 'rotate' keyword, it will
not only translate the object to that place but also rotate it.

  In some cases you just want to place the object on the circumference
but you don't want to rotate the object. In that case you just need to
calculate the location of the object and 'translate' it there from the
origin (instead of putting it at a certain distance from the origin and
then using 'rotate').

  This can be achieved for example like this:

object
{ YourObject // assuming your object is centered at <0,0,0>
  translate vrotate(<1, 0, 0>, y*267)
}

  This will translate 'YourObject' to that location without rotating it.

-- 
                                                          - Warp


Post a reply to this message

From: A C C
Subject: Re: Another newbie question
Date: 27 Mar 2006 05:35:01
Message: <web.4427bf60817d84dd1f59794c0@news.povray.org>
> Hi Antonio,
>
> You can specify any rotation angles you like. The easiest is to rotate
> around the origin, so in the example I've defined 4 spheres 1 unit away from
> the origin in the +z direction. Then rotating around the +y axis gives what
> you've asked for.
> You could also do a #while loop and if you want random rotations you can use
> the seed() and rand() functions.
>
> camera {location <0,2,0.1> look_at <0,0,0>}
> sphere {<0,0,1>, 0.01 rotate 267*y pigment{rgb <1,0,0>} finish {ambient 1}}
> sphere {<0,0,1>, 0.01 rotate 270*y pigment{rgb <1,0,1>} finish {ambient 1}}
> sphere {<0,0,1>, 0.01 rotate 271*y pigment{rgb <1,1,0>} finish {ambient 1}}
> sphere {<0,0,1>, 0.01 rotate 320*y pigment{rgb <0,0,1>} finish {ambient 1}}
>
> Regards,
> Chris B.

Thanks, Chris. I am modelling a Trek ship in POV-Ray, and I didn't know how
to do the windows right.

Antonio


Post a reply to this message

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