# 3D Theory - Joint Constraints Forum Discussion

 By: Danske - danske Joint Constraints   2006-07-30 11:55 Okay, I've been playing with joints and have some preliminary findings.    Physically we have a structure which transmits forces to prohibit acceleration in certain directions. Mathematically we have a constraint function that evaluates to zero when the constraint is satisfied. In a simulation we have to translate between the physics and the mathematics.    For simplicity, I'll go through constraining an object in global coordinates. The global coordinates are just standing in for the coordinates of another object on the "other side" of the joint, and it makes it easier to visualize with just one object instead of two.    Translational constraints:    0 DOF: a point on the object is constrained to be at a particular point in global coordinates. Mathmatically (pa = pb). The constraint function would be (C = pa - pb = 0). When that is zero the constraint is satisfied. Consider an object's center of mass being constrained to the global origin. Any force which would accelerate the object's CoM away from the origin needs to be counteracted by a force at the origin cancelling that acceleration. Mathematically the force vector would be opposite to the acceleration vector of the CoM.    1 DOF: a point on the object is constrained to a line in global coordinates. The constraining force vector would be opposite to the acceleration of the point away from this line. Any acceleration along this line is allowed. For example, the object's CoM could be constrained to lie on a line along the global x-axis, (C = pa x <1, 0, 0> = 0).    2 DOF: a point on the object is constrained to a plane in global coordinates. The constraining force vector will be normal to the plane, and opposite to the acceleration away from the plane. Example: CoM constrained to the x-y plane (C = pa * <0, 0, 1> = 0).    3 DOF (unconstrained): a point on the object is free to move in global coordinate space.    Thinking of the DOF as the dimensions of the shape of allowed positions makes it easier to mathematically model the constraint. The point on the object is constrained to either a point, a line, a plane, or a volume. Now for simple mechanical joints the lines are straight and the planes are flat, but we could also mathematically model curving lines and curved surfaces to constrain the point on the object to.    The lines, planes, and volumes could be bounded as well, but I think that's harder to solve forces for. A spherical shell is technically not bounded, so you could constrain a point to a sphere in global space, but a spherical volume is trickier. I'm not sure how you'd come up with a simple function that evaluates to zero at all points inside the spherical volume but non-zero outside of that volume.    Rotational (trickier):  Since an object's orientation is determined by two non-coaxial vectors we need to examine the constraints on two vectors at once. For the examples I'll use the object's x and y axes.    0 DOF: Both of the object's axes are constrained to point in particular directions. For example: the object's x-axis is constrained to <1, 0, 0> (C1 = ax x <1, 0, 0> = 0) and its y-axis to <0, 1, 0> (C2 = ay x <0, 1, 0> = 0). No rotation of the object is allowed at all, and a constraining torque is applied to negate any angular acceleration.    1 DOF: One of the object's axes is still constrained to one direction, but the other is not. For example, the object's x-axis must still point along the global x-axis (C = ax x <1, 0, 0> = 0). With the y-axis unconstrained the object may still spin about the x-axis. A constraining torque is applied to keep the object's x-axis from acclerating in global coordinates. This has the effect of constraining the y-axis to the global y-z plane, so it may be easier to model that constraint and resulting torque mathematically.    2 DOF: One of the object's axis is constrained to a plane, but the other is unconstrained. Example: object's x-axis is constrained to the x-y plane (C = ax * <0, 0, 1> = 0). Its x-axis must lie in the x-y plane, but it is still free to rotate about its x-axis, wherever in that plane it may lie. A constraining torque is applied to keep the x-axis in the global x-y plane.    3 DOF: Neither axis is constraint, free rotation.    Again, the planes could be curved surfaces instead, and possibly bounded, but that's a little trickier to implement.    Anyway, that's not a complete discussion, but it's a start on figuring out the equations to solve for the forces/torques necessary to satisfy the constraints of joints between two objects.    1. Find the equation for the allowed states of the joint.    2. Find the equation for the direction of forces/torques needed to maintain that state.    3. Find the equation for how the objects respond to forces/torques in that direction, and how that response affects the joint constraint condition.    4. Solve the whole thing for the magnitude of the force/torque to maintain the allowed state.    Simple. ;)
 By: Martin Baker - martinbaker  RE: Joint Constraints   2006-07-30 23:34 Can I suggest a slightly different structure (or perhaps the same thing in different words). An object starts with 6 degrees-of-freedom. As you say, a joint constrains or takes away some of these degrees-of-freedom which may be linear, rotational, or both.    For example, a screw thread or a rack-and-pinion steering, these objects would have 1 degree-of-freedom, at least for the screw thread, (which is both linear and rotation at the same time) so I guess the joint removes 5 degrees-of-freedom?    I find this interaction of linear and rotational motion very difficult to work out. This seems even more so when we combine joints, for example, a robot arm (or human arm). This has only rotational joints, the shoulder removes any translational movement. But it moves the elbow in a linear way, this linear motion is part of sphere as you discuss.    Or linear motion seems to cause rotational movement, for instance the car suspension, each wheel spring/damper allows linear movement. If one wheel hits a bump then the whole car rotates.    So the first joint takes away degrees-of-freedom, but further joints put degrees-of-freedom back? A difficult subject!    Martin
 By: Danske - danske RE: Joint Constraints   2006-07-31 11:02 The problem is how to mathematically describe the geometry of the allowed motion so that you can determine the direction of the forces/torques to maintain the joint constraints. I think it's easier mathematically to start with the "joint" that allows no translational or rotational movement between the two objects so joined. Once you have defined how to do that with force/torques in the appropriate directions then you can allow movement by removing some of those mathematical constraints.    Just saying "remove one DOF" doesn't help you geometrically define the forces/torques needed to do so, but saying "a point/vector on the object is confined to lie in/parallel-to a plane defined in another object's coordinates" does. ;)    Chaining objects does give more complex behavior but it's even more complex than a mathematical constraint on position. Your hand is constrained to a volume of space relative to yourself, but its movement is constrained by the configuration of your whole arm. You can touch your thigh, but if your elbow is above your head you have to first rotate your upper arm to bring your elbow down. If your hand were mounted on an extensible shaft attached to the ball-joint of your shoulder then that would give you the same volume of space but with fewer constraints on the motion of your hand.    I think one should avoid thinking too much about chains of jointed objects though. A joint is only between two objects. The joint constraints determine the allowed configuration between the two objects, positional and orientational. A simple revolute joint at a fixed point on both objects allows no translational movment and only one DOF in rotation. Point A on one object must always occupy the same point in global space as Point B on the other object, and Vector A in one object must always point in the same direction in global space as Vector B in the other object.    If the two points are accelerating away from each other you need to apply a force at those points to counteract that acceleration. If the two vectors are angularly accelerating away from each other you need to apply a torque to counteract that. Annoyingly, applying a force at the joint point may also apply a torque which may violate the rotational constraint, and applying a torque to the objects may violate the translational constraint. So the simple joint has already created a set of equations to solve.
 By: Martin Baker - martinbaker  RE: Joint Constraints   2006-08-02 09:22 I've been thinking this over and I was wondering what mathematical type we could use to specify the allowed movements. Just taking the simple cases of straight movement for now.    If movement is constrained to a straight line through the origin, this could be specified by a 3D vector. Possibly with 2 scalars to define the limits/endpoints of movement along this line.    If movement is constrained to a flat plane through the origin, this could be specified by a 3D vector which is the normal to the plane. (or in Geometric Algebra terms a bi-vector) i.e. the cross product of any two lines on the plane. If we want to specify limits we could use 4 scalar or 2 two dimensional vectors.    What about rotation? although matrices or quaternions are very good for specifying finite rotations, the don't seem very good for specifying a range of rotations (please correct me if I'm wrong).    In the case of a hinge joint the axis-angle notation seems better. In fact just the axis would do, so again we only need a 3D vector. We could use 2 scalar values to represent the angular limits if required.    Is there a 2 DOF version for rotation in the same way that there is for linear joints/constraints?    I was thinking of something like a universal joint as used in the transmission of trucks, which is like two hinges at right angles, could this be represented by a 3D vector to complete the set?    If we could specify the joints in this way then perhaps deriving the overall equations might be a bit easier?    Martin
 By: Danske - danske RE: Joint Constraints   2006-08-02 13:19 It seems to me so far that using normal vectors of planes is the way to go. This provides both a nice scalar constraint function by using the dot-product of the normal and the point/vector we are confining to the plane, and necessarily the direction of the force to maintain the constraint (it will be parallel to the normal vector of the plane). This is nice because we're only solving for the magnitude of the force vector, not its direction. The constraint force should also never have a component along the allowed direction of movement, and defining it as normal to the plane of allowed movement insures this.    Adding a second planar constraint in the form of a second normal vector creates a line at the intersection of the two planes. Adding a third creates a point constraint at the intersection of the three planes.    For example, constraining a point on the object to the global x-y plane would just require dotting the acceleration of the point with <0,0,1> (the confining plane's normal vector), and applying a force with a direction of <0,0,1> and magnitude sufficent to cancell the point's acceleration along the normal vector. Constraining the point to lie along the x-axis would require simultaneously solving with a constraning plane defined by <0,1,0>. Constraining it to the origin would entail adding a third constraining plane defined by <1,0,0>.    In the general case, the normal vectors of the planes would be defined in an object's coordinate space, and we would be dotting the vector difference between two points on the two objects with those normal vectors.    We can also use normal vectors to constrain rotation. Requiring that an objects x-axis lie parallel to the global x-y plane is requiring that dotting the x-axis vector with <0,0,1> be zero. The restoring torque will in the direction of the cross product of the two vectors, the magnitude of which must be solved to counteract and angular acceleration away from parallel to the plane. Using the cross product to determine the direction of the constraining torque also insures that it is perpendicular to the normal vector, which is required as we don't want any constraining torque along the allowed direction of rotation.    That would also be the two DOF rotational joint. The object could still have its x-axis point in any direction parallel to the global x-y plane, and can still rotate about its x-axis.    Constraining two vectors on the object to the same plane would allow only one rotational DOF, allowing rotation only about the axis parallel to the normal vector. If both the x-axis and y-axis of the object were constrained to the gloabl x-y plane then it could still rotate about its z-axis.    It may seem inefficient to use multiple planes and normal vectors, but the using the dot product creates a scalar constraint function which is easy to check for satisfaction, and normal vectors provide us with the direction of force/torque vectors only the magnitude of which we must solve for.    There's a little overlap, in that you can create a hinge joint with either two 0-DOF translational "joints" and six constraints (three dimensions for each point), or one 1-DOF translational joint with two constraints plus one 0 DOF translational joint with three constraints. You can see that creating two fixed contact points on two objects creates two vectors which must always point in the same direction. Using the rotational constraint saves you one redundant constraint function and also having to calculate torque from the forces at the two points of contact. If we use unit vectors for rotational constraints we may also save some multiplication. ;)    Now mathematically solving all the simultaneous force/torque equations is a whole 'nother kettle of fish, even if we know the directions of each force/torque vector. The nice thing is that I think by consistently using scalar constraint functions and dot products with normal vectors to evaluate those functions we can incrementally build the necessary matrixes with "universal" functions. We can systematically evaluate the acceleration of the constraints along the normal vectors, and the effect on the constraint functions by applying forces/torques along those vectors, all the time working with scalars which are the magnitudes of vectors we know the direction of. The grand unified equation may be messy, but the parts may be tractible.    That may not actually be a solution, but I like only solving for the magnitude of vectors in known directions.
 By: Danske - danske RE: Joint Constraints   2006-08-02 14:08 Oh, it occurs to me that complex joints may not be that simple. ;) However, I think we can still use vectors to define the prohibited directions of movement, and thus the directions of constraining forces, even if those vectors are derived by some equation instead of just being constant. If we can't define the direction of movement a joint prohibits then we're lost anyway.    Limits to the movment of joints would seem to be to produce a collision like any other collision between objects. To instantaneously stop the motion of a joint to not proceed beyond its "stops" would need application of an impulse. Modelling this physically would be easier to assemble because you could just put stops for the object to naturally run into to stop the movement, but it seems likely to be computationally intensive as the bounding boxes might be continously overlapping depending on the joint. Writing special "joint collision code" would execute faster, but would obviously require specialized code and extra work.
 By: Danske - danske RE: Joint Constraints   2006-08-02 20:04 Oh, and the big equation we're primarily dealing with is the linear acceleration of points on an object, since we're trying to keep points on two different objects from acceleration away from each other. The equation is:    p'' = a + (I^-1(L x w + T) x r) + (w x (w x r))    Where (all in global coordinates ;) ):    p'' = second derivative wrt time of the point's position  a = the acceleration of the object (from sum of forces divided by its mass), ignored for rotational constraints  I^-1 = the inverse of the inertia matrix  L = angular momentum vector  T = sum of torques on the object  r = the point's offset from the object's center of mass, ( = [Rlg]pl ), or the constrained vector's direction for rotational joints  w = angular velocity of object    Some explanation:    I^-1(L x w + T) = the angular acceleration of the object, crossing with (r) gives the linear acceleration the point is experiencing from that angular acceleration    (w x (w x r)) = the centripetal acceleration the point is experiencing from the objects rotation    Now some of the forces and torques on the object may be known, from force-producing objects like springs and dampers (linear and rotational), motors or force fields (gravity included), while the other forces and torques are the ones we're solving for to maintain joint and other contact constraints.    Oh, and some of the forces and torques may be supplementary spring/damper combinations we've added to the joint to combat numerical drift. Even if we start with the position and velocity of the joined objects satisfying the joint constraints, and meticulously solve to prohibit and acceleration in prohibited directions, some numerical drift will occur from numeric integration. Some slight spring/damper forces/torques added-in will pull the joint back to where it's supposed to be.    We can take that accleration of a point on an object and dot-product that with the unit vector giving the prohibited direction of acceleration for the joint to see if the point is accelerating in a prohibited direction. For example, if we create a simple pendulum by constraining one end of a rod to the global origin, then we solve for forces which keep the end of the rod from accelerating away from the origin, i.e. the acceleration vector of a point at the end of the rod dotted with each of the three constraining vectors is zero. Obviously, applying forces to the end of the rod will also provide a torque to be factored into the acceleration of the point in that equation.    In the case of a joint between two objects, we take the difference between the accelerations of points on both objects, and that is the vector we're dotting with the "prohibited acceleration" constraint vector. The equal-and-opposite nature of the force will also affect the two objects differently, depending on their masses, moments of inertia, and angular momentums. (We can consider the global coordinates as an object having an inverse mass of zero and an inverse moment of inertia of zero such that no force or torque accelerates it in any manner, and we can also create other immovable objects similarly).    This I think gives the basis for the simultaneous equations that need to be solved for joints. I've read a paper ("Fast Contact Force Computation for Nonpenetrating Rigid Bodies", Baraff, 1994) for solving contact force constraints that uses forces along contact normal vectors which seems very applicable to this problem. Next I just have to figure out what it means. ;)
 By: Martin Baker - martinbaker  RE: Joint Constraints   2006-08-03 02:54 Do you think it would be practical to analyse the kinematics first (analyse possible movements), use this to make any simplifications, then do the dynamics (relate the forces to accelerations)?    For example: imagine that we have a door connected to a frame by a ball & socket joint at the top and also connected to the frame by a ball & socket joint at the bottom. The overall result is equivalent to a hinge. So we only need to work out the dynamics equations for a simple hinge rather than working out the equations for two ball & socket joints in parallel.    In some ways there seems to be a sort of pattern here:  2 ball & socket joints in parallel = 1 one hinge.  2 hinges in series (at 90 degrees) = 1 ball & socket joint (provided it cant turn along its axis)    In other words, connecting joints in series increases the DOF, connecting joints in parallel decreases the DOF.    What would be really good would be a way to do this using vector representations of the joints. Such as "for joints in series use cross product, for joints in parallel use dot product" Unfortunately, as you point out, its a lot more complicated than that. But it must be possible to define these kinematics relationships as opposed to only the dynamics equations?    When we get to the dynamics equations, then for the linear case, we can also combine the forces or impulses depending on whether they are in series or parallel. For example, if we have two weighing scales, and we put one foot on each then our weight is the total of the two scales (parallel case). If we put the scales, one on top of the other, then the both read out total weight (series case). I think this would also work for impulses (if we jumped on the scales).    Just a thought, Thanks,    Martin
 By: Danske - danske RE: Joint Constraints   2006-08-03 20:55 How about an example of constraining a billiard ball to the surface of the table? That's just removing one DOF from the ball. So we can formulate that as follows:    rb = ball's position vector  n = normal vector of the table's surface  p0 = point on the table which is a legal position for the ball, i.e. the ball's CoM is one ball-radius above the table surface    Position constraint (C):  C = (rb - p0)*n = 0    Velocity constraint (C'):  C' = (rb' - p0')*n + (rb - p0)*n' = 0    Assuming the table isn't moving, that's:  p0' = 0  n' = 0  C' = (rb' - 0)*n + (rb - p0)*0 = 0  = rb'*n = 0    Meaning the legal velocities of the ball are parallel to the plane of the surface of the table.    Acceleration constraint (C''):  C'' = rb''*n = 0    Meaning the ball is constrained from accelerating toward or away from the surface of the table, i.e. along the normal vector defining the plane.    Now if the table were moving, then:    Velocity constraint:  C' = (rb' - p0')*n + (rb - p0)*n' = 0    Accleration constraint:  C'' = (rb'' - p0'')*n + 2*(rb' - p0')*n' + (rb - p0)*n'' = 0    Obviously, if the table is free to move too, as we have to assume two generic conjoined objects will be, it's a bit trickier. However, we can't simplify the constraint of keeping the ball in a plane relative to the table beyond having just the normal vector of the plane and a point on that plane; it doesn't get much simplier than defining a plane in space and saying the ball's CoM is in that plane. If the plane has linear and angular velocity and acceleration then the equations in global coordinates are necessarily going to be a little messy.    And I didn't mention constraining forces once, but they will be in the direction of (n) in order to keep the acceleration of the ball legal and also to avoid a force along the allowed directions of movement (in the plane).    Ah, now one nice thing about using two 0 DOF translational joints to create a hinge or pin joint is that the normal vectors can be defined in global coordinates, so no rotation of them is needed; a point is a point.    On the other hand, that requires four vectors to the joint points, two for each object which are rotating, and six forces being solved for. A hinge joint may require two vectors for the one 0 DOF translational joint between the two objects, and three axis vectors, with three forces and two torques to solve for total.    On the third hand, eliminating torques and handling it all with forces unifies the way we're solving joint constraints.    On the fourth hand, using translational joints to simulate rotational joints doesn't model a real physical joint. I'm thinking you can model the 2 DOF rotational joint of two revolute joints in series as one 0 DOF translational joints (fixed ball joints) attaching the objects together plus one 2 DOF translational joint "magically" keeping a point on one object in a plane relative to the other.    Yes, there is an overlap between translational and rotational joints. Two points on an object define an axis. Using translational joints to define and constrain that axis can achieve the same results as a rotational joint. It might be a little tricky to not set up an unsolvable mathematical condition, and if you want to have user interaction being "snapping together" physically-modelled joints then this is not the way to go.
 By: Martin Baker - martinbaker  RE: Joint Constraints   2006-08-04 10:43 I was OK until the table started moving! Then I got a bit lost. In fact this seems to go back to an earlier discussion we were having about measuring things relative to other things.    Are we saying that:  the ball is constrained relative to the table so that it cant move in the vertical direction.  the table is constrained relative to the ground so that it can only move in the vertical direction.  therefore if we combine them there are no linear constraints of the ball relative to the ground?    Martin
 By: Danske - danske RE: Joint Constraints   2006-08-05 08:50 Actually, since (n) is just a direction vector, then (n') is how the plane of the table is *rotating* in space. So what we're saying is that as the table bounces and flips through space the ball is still constrained to lying in the defined plane. The constraints on the ball depend entirely on the position/orientation, velocity and acceleration of the table.    Or I should say are being defined in terms of the table's state. The table is also being constrained by the ball, but since we're envisioning a large table and a small ball it doesn't seem that way. If the ball were a large spherical boulder and the table a sheet of wood, then we can see that the constraint of keeping the sheet of wood in contact with the boulder is symmetric to keeping the billiard ball in contact with the table.    Just to make things more simple, let's say the plane the ball must lie in intersects the table's CoM, and we use the table's CoM as the reference point for defining the plane. We'll also put the table at the global origin, free to rotate but not translate, so that we have no offsets to worry about. ;)    r = ball's position vector  n = normal vector for plane  w = angular velocity of table  n' = w x n    C = r*n = 0  C' = r'*n + r*n' = 0  = r'*n + r*(w x n)  = r'*n + (r x w)*n  = r'*n - (w x r)*n  = (r' - (w x r))*n  = 0    That sheds some light on the constraint equation for velocity. If the point of the plane the ball is at has any motion from the rotation of the table in the direction of the normal vector then the ball's velocity along the normal vector must (is constrained to) also be equal to that. The difference between the two velocities along the normal vector is constrained to be zero. Easy. ;)
 By: Martin Baker - martinbaker  RE: Joint Constraints   2006-08-06 11:19 Do you think we can use this to infer any relationship between linear and rotational constraints?    So far we have a ball which is constrained to be in a given plane (which is a linear constraint) r.n=0.    and we can rotate the whole system (which implies a constraint such as a hinge) I guess we could define the direction of the hinge as |r x n| .    But I can't see how we could relate these constraints in any useful way- that implies some general relationship between these types of constraints?    Martin
 By: Danske - danske RE: Joint Constraints   2006-08-06 18:22 I said before, I think, that any two points on an object create a direction vector, which is one-half of the two direction vectors needed to specify the complete orientation of an object. By constraining two different points on an object through translational constraints you are also creating a rotational constraint.    It's kind of hard for an object to rotate without moving any of its points through space (unless it's a point object), so there is overlap between the two types of constraints. In the billiard ball example the ball can still rotate in any direction as long as its CoM stays on the plane, so there is no constraint between the relative orientations of the table and the ball; the ball is effectively on a mobile 3 DOF ball-joint with the ball-joint confined to the plane.    If we constrained a second point on the ball to the plane then it's connected to a 2 DOF rotational joint that can move in the plane. The ball can rotate about the axis defined by its two points lying in the plane, and that axis can point anywhere in the plane. However, now there are some forbidden relative orientations between the ball and the plane. The ball can't be oriented in any manner such that those two points defining the axis are not lying in the plane.    If three points on the ball were confined to the plane then the ball could only rotate about an axis perpendicular to the plane, a 1 DOF rotational constraint.    Ah, there is one artifact in mathematic constraints, though. Even if three points on the ball were confined to the same plane, there are two sets of solutions to that equation. The ball could either be rightside-up or upside-down in the plane. It can't transition from one to the other while maintaining the constraint, but either is a solution to the three points-lying in the plane constraint. For a door on a hinge, mathematically the constraint is similarly satisfied if we flip the door 180-degrees so that the "top" hinge is at the bottom and the "bottom" hinge at the top of the door frame. The vector pointing along the vertical edge of the door is parallel to the door frame either way.

By: Martin Baker - martinbaker  RE: Joint Constraints
2006-08-07 11:23

Based on you last message I thought I would make one last attempt at defining simple categories of joint/constraint which could be combined in a program to build up more complex mechanisms.
How about a system where the first object has 1,2 or 3 independent points and these map to either points, lines or planes on the second object as follows:

First Object Second Object Joint Type
3 points 3 points Objects locked together 0 DOF
2 points 2 points Revolute joints 1 DOF
3 points 2 lines Prismatic joints 1 DOF
? ? Helical joints 1 DOF
2 points line Cylindrical joints 2 DOF
1 point 1 point Spherical joints 2 DOF
3 points   plane Planar joints 3 DOF

This seems to work for some types of joint better than others, but there might be some scope to develop it further?

For a more general case, I guess I have to agree with you, that we have to define the links between the objects with equations.

One thing I would like to hold out for though, do you think its possible to do the problem in two stages, kinematics first, then dynamics. In other words, define how the objects can move, then apply forces and accelerations?

Martin

 By: Danske - danske RE: Joint Constraints   2006-08-07 19:44 That looks about right to me, although I think the spherical joint is 3 DOF; rotation isn't constrained at all.    A helical joint would be constraining one point (the axial point) to a line and another point to a helix around that line, I think. I'm having a little trouble coming up with a definition that doesn't over or under-constrain the points, though. I think one plane would be perpendicular to the axis and with the axial point lying in it, moving along the axis with the axial point; this plane would keep the second point perpendicular to the axis as well and the object aligned with the axis. The second plane would be inclined relative to the axis and rotate as the points move along the axis or as the second point rotates about the axis; this plane provides the helix.    That's the least constraining version, I think. The two points on the one object can be any distance apart and will be constrained to lie perpendicular to the axis. Maybe the second point could instead be additionally constrained to a particular distance from the axis with a cylinder, but you'd have to make sure the radius of the cylinder was less than or equal to the distance between the two points on the object. One might also try to constrain the second point to a particular helix, but that's not needed to make the joint behave properly unless you really need a particular distance between the objects to give a particular rotation.    I guess you don't *have* to define the allowed movement with a scalar function that evaluates to zero for allowed movment and non-zero for prohibited movement, but if you do then you're going to have to translate to a scalar function later. Maybe for some more complex behavior it would be better that way, though.    Now I'm off to displaying 3D objects. ;) I'm looking at just using the angle between the camera view-direction vector and the vector between the camera position and vertex position as the distance from the center of the display. It's got some funny distortion for large angles, but there's no clipping problems for lines drawn from a point in front of the camera to a point behind the camera, and for normal fields of view I don't think the distortion is significant.

 metadata block see also: Correspondence about this page Open Forum discussion Book Shop - Further reading. Where I can, I have put links to Amazon for books that are relevant to the subject, click on the appropriate country flag to get more details of the book or to buy it from them.       Robot Dynamics Algorithms (Kluwer International Series in Engineering and Computer Science, 22) Commercial Software Shop Where I can, I have put links to Amazon for commercial software, not directly related to the software project, but related to the subject being discussed, click on the appropriate country flag to get more details of the software or to buy it from them.

This site may have errors. Don't use for critical systems.