Re: Newbie Joint question

[email protected] Wed, 24 Nov 2004 12:00:04 -0500 (EST)
Newsgroups gmane.comp.breve
Message-ID <[email protected]>
On Wed, 24 Nov 2004, Jon Kleiser wrote:

> Thanks. I've got the "set-relative-rotation" method working, but it 
> may be somewhat limited as to what it can do with the orientation of 
> the connected parts. I suspect that "set-relative-rotation-matrix" 
> could be a more powerful solution, but I can't find much info on how 
> to figure out the suitable values to use in such a matrix. I've made 
> a web page that describes what I try to do, including a snapshot, if 
> you care to take a look:

The set-relative-rotation should be capable of every rotation that 
the matrix method is capable of, though depending on what you're 
after, one method might be easier than the other.

The way you describe the problem, you're trying to get a structure 
with the image you're showing using only one shape, but with different 
transformations.

I'll give an example by looking looking at the yellow and purple shapes, 
and finding the transformation matrix to build it using only one shape.  
If you're using just the purple shape, you'll see that the shape will 
need to be joined at the points (-1, 5, -1) and (5, -1, -1).  They 
can't both be joined at the same two points (-1, 5, -1), because then the 
z "point" of the shape would be facing the wrong direction.

So if you connect these points together, you'll see that the object is 
not joined at the desired angle -- it's off by 90 degrees.  You'll also 
note that you want the Z face to stay pointed in the same direction, 
while the X and Y axis will both need to be rotated.  In other words, 
you want a 90 degree rotation about the Z axis, using this line before 
joining the links:

	joint set-relative-rotation around-axis (0, 0, -1) by -3.14/2.0. 

If you want to use the rotation matrix, look at the initial uncorrected 
position, and think about the desired rotation: you'll want the X axis 
to point down (0, -1, 0), the Y axis to point to the right (1, 0, 0) 
and the Z axis to remain as it is (0, 0, 1).  These three vectors 
correspond to the columns of the 3x3 rotation matrix, so the result is:

    joint set-relative-rotation-matrix to 
        [ (0, -1, 0), 
          (1,  0, 0), 
          (0,  0, 1) ].

Both of these methods should produce the same results.  You should be 
able to follow the same logic for adding new links to your chain.

- jon klein

ps: foerlaat att det inte gaar att anvaenda norska bokstaver -- de funkar 
inte med glut.  saa faar du skriva saa haer istaellet.

_______________________________________________
breve mailing list
[email protected]
http://lists.spiderland.org/mailman/listinfo/breve