|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
I want to have a series of points which are a helix wrapped around a
circle.
If I had a series of objects, the operations in pov would be easy,
because I could translate them as per sin & cos in one plane and then
ROTATE the objects around another axis. However, I need these to be
POINTS which I declare.
How can this be done? Can declare a point, then rotate it later, then
later on use it as the position of an object?
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
One solution :
1. fill an array with the <x,y,z> positions P[n]
2. transform every point by whatever transformation (liberal use of
vector functions needed) P[n] -> Q[n]
3. apply the points : object{Toto translate Q[i]}
This can be a little more difficult if you have to reorient the object,
but a similar logic can be used.
Gilles
"Greg M. Johnson" wrote:
> I want to have a series of points which are a helix wrapped around a
> circle.
>
> If I had a series of objects, the operations in pov would be easy,
> because I could translate them as per sin & cos in one plane and then
> ROTATE the objects around another axis. However, I need these to be
> POINTS which I declare.
>
> How can this be done? Can declare a point, then rotate it later, then
> later on use it as the position of an object?
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"Greg M. Johnson" wrote:
>
> I want to have a series of points which are a helix wrapped around a
> circle.
>
> If I had a series of objects, the operations in pov would be easy,
> because I could translate them as per sin & cos in one plane and then
> ROTATE the objects around another axis. However, I need these to be
> POINTS which I declare.
>
> How can this be done? Can declare a point, then rotate it later, then
> later on use it as the position of an object?
If you want to apply a translation to a point all you have to do is add
the translation vector. For the rotation, you might want to take a look
at the vrotate and vaxis_rotate functions.
Jerome
--
*******************************
* they'll tell you what can't * mailto:ber### [at] inamecom
* be done and why... * http://www.enst.fr/~jberger
* Then do it. *
*******************************
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Another solution:
I hope this can help you. The whole helix is created at once. At the end
you can reorient it as you wish.
cut here
-------------------------------------------------
#default{pigment{ rgb 1}}
camera{location 2*<0,5,-5> look_at 0}
light_source{<2,5,-5> rgb 1}
#declare R1 = 3; // the size of the circle
#declare R2 = 1; // the "size" of the helix
#declare R3 = .1;// point size
#declare Omega = 4*pi; //the speed of the helix
// around the circle
#declare n = 320 // number of points
#declare k = 0;
union{
#while(k < n)
#declare s = 2*pi*k/n;
sphere{
<
(R2*cos(Omega*s) + R1)*cos(s),
R2*sin(Omega*s),
(R2*cos(Omega*s) + R1)*sin(s)
>,
R3
}
#declare k = k + 1;
#end
} // here you can reorient your helix
-------------------------------------------------
Alberto
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Greg M. Johnson <gre### [at] my-dejanewscom> wrote:
: How can this be done? Can declare a point, then rotate it later, then
: later on use it as the position of an object?
You can apply to a vector all the tranformations you can apply to an
object:
object { MyObject translate Amount }
#declare MyVector=MyVector+Amount;
object { MyObject scale Amount }
#declare MyVector=MyVector*Amount;
object { MyObject rotate Amount }
#declare MyVector=vrotate(MyVector,Amount);
--
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
|
|