[ODE] An embarassingly basic geometry question

Shamyl Zakariya zakariya at earthlink.net
Wed Jun 11 13:09:02 2003


The behavior is as such:

Let's say there are two ball joints, connected by the cylinder, a & b
If a & b are on a plane that is strictly horizontal, OR vertical, the 
positions are fine. When the plane goes off horizontal or vertical, the 
tube begins to rotate around the midpoint. On the other hand, if the 
plane is horizontal, the cylinder seems to align regardless of rotation 
about z; and I assume the same for vertical planes. I'm going to write 
a testbed later to allow for careful positioning and orienting the 
cylinder so I can track the nature of the error.

My guess is that if I implement something to catch when the angle > 
PI/2 and handle it accordingly, it might fix it. I already tried 
something along these lines, but my current testbed isn't good enough 
for me to do this scientifically.

Anyway, there's no jumping, or sudden 90 degree pivots, as I think 
you're suspecting. Unfortunately, this is hobby work, and as such, I 
banged out this code this morning, at 6am before I went to work. I only 
had time enough to determine the > PI/2 behavior. Unfortunately, I've 
got to take the GF out tonight to look for a new bicycle... so no time 
for hacking.

Harrumph.

On Wednesday, June 11, 2003, at 02:48  PM, Nate W wrote:

> On Wed, 11 Jun 2003, Shamyl Zakariya wrote:
>
>> 	-calculate normal to this triangle, using vectors ba and bc, this is
>> the axis the cylinder will be rotated on
>>
>> For what it's worth, the piston starts misaligning when the calculated
>> angle goes past PI/2.
>
> Your reasoning looks right to be, but if there's a problem, I'd be 
> looking
> at the 'calculate normal' step.  There are to normals to that triangle
> (think 'top' and 'bottom') and I'm not sure which you'll end up with.
> Does the axis change sign unexpectedly?  Or, what happens if you change
> the sign of the rotation angle?  Or change it when the angle goes past
> PI/2?
>
> This is of course the blind leading the blind.  "Tweak this and see 
> what
> happens" is probably not the best way to debug this sort of thing. :-)
>
> -- 
>
> Nate Waddoups
> Redmond WA USA
> http://www.natew.com
>
>
> _______________________________________________
> ODE mailing list
> ODE@q12.org
> http://q12.org/mailman/listinfo/ode
>
>
Shamyl Zakariya
   "this is, after all, one of those movies where people spend a great
   deal of time looking at things and pointing."
	From a review of _Fantastic Voyage_