 |
 |
|
 |
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
"Warp" <war### [at] tag povray org> wrote in message news:3d359a2b@news.povray.org...
>
> On the other hand, it would sometimes be useful to be able to rotate
> a point/object around an axis *not* going through the origin. Is there
> a standard macro for this?
>
Ooo, great minds think alike!
(now, who else can I insult?).
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
> Okay, how about someone writes a nice vaxis_rotate_extra(A,B,C,D)
function
> where A is the point to rotate, around an axis defined by B and C, and D
being
> the amount. I suspect that this is what Rob B-B wanted....
#macro vaxis_rotate_extra(A,B,C,D)
(B+vaxis_rotate(A-B,C-B,D))
#end
-tgq
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
In article <3d359a2b@news.povray.org>, Warp <war### [at] tag povray org>
wrote:
> On the other hand, it would sometimes be useful to be able to rotate
> a point/object around an axis *not* going through the origin. Is there
> a standard macro for this?
Well, it isn't hard, just:
Orig + vaxis_rotate(Pt - Orig, Axis, Amt)
Since there is a Rotate_Around_Trans() macro and an Axis_Rotate_Trans()
macro, I guess a Axis_Rotate_Around_Trans() macro wouldn't be out of
place, though I'm not sure how useful it would be. How about:
#macro Axis_Rotate_Around_Trans(Orig, Axis, Amt)
transform {
translate -Orig
Axis_Rotate_Trans(Axis, Amt)
translate Orig
}
#end
--
Christopher James Huff <chr### [at] mac com>
POV-Ray TAG e-mail: chr### [at] tag povray org
TAG web site: http://tag.povray.org/
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Christopher James Huff <chr### [at] mac com> wrote:
> Orig + vaxis_rotate(Pt - Orig, Axis, Amt)
I was thinking more in the lines of "rotate around the axis which goes
through these two points". However, it's rather easy to modify that
expression to do that.
--
#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
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
In article <3d35d481@news.povray.org>, Warp <war### [at] tag povray org>
wrote:
> I was thinking more in the lines of "rotate around the axis which goes
> through these two points". However, it's rather easy to modify that
> expression to do that.
Ax1 + vaxis_rotate(Pt - Ax1, Ax2 - Ax1, Amt)
I prefer a point and direction, because it more clearly specifies the
direction of the axis. With two points, the direction depends on the
order of the end point vectors, which is workable but possibly more
confusing. Also, I was making it similar as possible to the
vaxis_rotate() function.
--
Christopher James Huff <chr### [at] mac com>
POV-Ray TAG e-mail: chr### [at] tag povray org
TAG web site: http://tag.povray.org/
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|
 |