|
![](/i/fill.gif) |
In article <3d9b20ac@news.povray.org>, Micha Riser <mri### [at] gmx net>
wrote:
> If the string remains taut the part of the force that is colinear with the
> string will get compensated. In other words the particle will always move
> in the plane perpendicular to the string! This means that all you have to
> do is to project your force into this plane.
Not quite...if you move it along a straight line in the direction of
force, the "string" will get longer and longer with time. You need to
move it along a curved path:
strLen is the "string" length.
strOrig is the pivot point, the non-moving end of the string.
1: Figure out the force as you said.
2: Compute the distance (partDist) and direction (partDir) the particle
would move for this time step without any restrictions.
3a: The particle moves the same distance along the surface of a sphere
with radius == the string length. Compute the angle (angDist) of an arc
segment with a length == partDist and a radius == strLen. This is the
angle between the start and end positions from the string origin.
3b: Find a vector perpendicular to the plane of the string and the
particle direction vector (rotAxis): vcross(partPos - strOrig, partDir)
4: Rotate the particle around strOrig by angDist around the axis
rotAxis. Use vaxis_rotate() or the Axis_Rotate_Trans() macro.
--
Christopher James Huff <cja### [at] earthlink net>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tag povray org
http://tag.povray.org/
Post a reply to this message
|
![](/i/fill.gif) |