|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Hello everyone,
I've got 2 changing points in space, A and B. I want to construct and
texture a cylindrical type object at 0 and then move it between A and B
(using A and B as its endpoints). Point A will never equal point B but
their relation to each other can be anything. Either point can be in any
quadrant. Later A and B could even swap positions.
I can already determine the length of AB and construct my cylinder at
y*-Len/2 to y*Len/2. I can translate it to the correct location using the
midpoint of my cyl (0) to the midpoint of AB. I have graphed the normal of
AB at the origin which seems to match a dummy cylinder drawn at AB. I
cannot however get the correct rotation at the origin before my translation
I've spent hours reviewing Calc, Trig and Vectors but was never an Ace at
any of them. I've attempted calculating "theta and phi" then later "pitch
and yaw" using a different method and have applied multiple combinations of
rotate commands using their values. I have then tried using vcross, vdot
and then vaxis-rotate but to no avail .... I've tried to compensate for the
difference in the y and z axis from my old math books but may have missed
something there. I'm beginning to feel ... well ... discouraged.
Is there an easy trick to this?
Thanks in advance,
Michael
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Look up VAngle() in the docs. Just handle the axis separately. Let's look
at the XZ angle, i.e. Y rotation first. It's late and it's been a long day
so this is not guaranteed mistake free but... If AB is a vector idenifier
then:
#local Swing_angle = VAngleD( x, <AB.x, 0,AB.z>);
#if (AB.z > 0)
#local Swing_angle = Swing_angle * -1;
#end
//eliminate the Swing_angle so we can soon look at the Tilt_angle:
#local AB_tmp = vaxis_rotate(AB,y, -1*Swing_angle);
#local Tilt_angle = VAngleD( x, AB_tmp);
#if (AB_tmp.y < 0)
#local Tilt_angle = Tilt_angle * -1;
#end
//ok now add rotate commands to your cylinder:
//rotate z by Tilt_angle and then rotate y by Swing_angle
"MichaelC" <nomail@nomail> wrote:
> Hello everyone,
>
> I've got 2 changing points in space, A and B. I want to construct and
> texture a cylindrical type object at 0 and then move it between A and B
> (using A and B as its endpoints). Point A will never equal point B but
> their relation to each other can be anything. Either point can be in any
> quadrant. Later A and B could even swap positions.
>
> I can already determine the length of AB and construct my cylinder at
> y*-Len/2 to y*Len/2. I can translate it to the correct location using the
> midpoint of my cyl (0) to the midpoint of AB. I have graphed the normal of
> AB at the origin which seems to match a dummy cylinder drawn at AB. I
> cannot however get the correct rotation at the origin before my translation
>
> I've spent hours reviewing Calc, Trig and Vectors but was never an Ace at
> any of them. I've attempted calculating "theta and phi" then later "pitch
> and yaw" using a different method and have applied multiple combinations of
> rotate commands using their values. I have then tried using vcross, vdot
> and then vaxis-rotate but to no avail .... I've tried to compensate for the
> difference in the y and z axis from my old math books but may have missed
> something there. I'm beginning to feel ... well ... discouraged.
>
> Is there an easy trick to this?
>
> Thanks in advance,
> Michael
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
MichaelC <nomail@nomail> wrote:
> Is there an easy trick to this?
Yes. Look at the functions at:
http://povray.org/documentation/view/3.6.1/488/
Especially Reorient_Trans() or Point_At_Trans().
--
- Warp
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"MichaelC" <nomail@nomail> wrote:
> Hello everyone,
>
> I've got 2 changing points in space, A and B. I want to construct and
> texture a cylindrical type object at 0 and then move it between A and B
> (using A and B as its endpoints). Point A will never equal point B but
> their relation to each other can be anything. Either point can be in any
> quadrant. Later A and B could even swap positions.
Thanks for the responses Charles and Warp!! I'll grind at it a little
longer. Perhaps my little spider Triggy will walk some day thanks to you
guys!! : )
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Warp <war### [at] tagpovrayorg> wrote:
> Especially Reorient_Trans()
I thought about this one after the fact, just as I was falling asleep last
night, but I couldn't quite remember the name of it.
Charles
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
WOW Point_At_Trans(Normal) is a God Send
Thanks again Charles and Warp ... You can be the proud God Parents of
Triggy.
Triggy was born an hour ago. His conceptual baby pictures can be found
here.
http://home.bluemarble.net/~mcoons/POVRay/POVRay.htm
Michael
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |