PDA

View Full Version : Transforming coordinate systems.


v-Salik
09-19-2007, 07:24 PM
I have a problem, I can solve this using some linear algebra but I'm a little lazy (actually we have already solved it but it was long and cumbersome to implement) and want to know how to do this with viz.functionality

I have a hierarchical skeleton I want to calculate the position of the end effector in global space when a parent joint is moved. I don't want to actually move the skeleton. I know the lengths of each bone, and I know the coordinates of each bone, getting the angles is also trivial.
What's the best way to accomplish this calculation?
It is easy to calculate these in local space, but the problem is transforming it back into world space ... does viz have functionality for this.

I had an idea of using a temp object then setting it's transform to the same as the bone, rotating it to the new angle then measuring it's global coordinates... is there any object that would be suitable for this type of intermediate calculation?
Thanks
-Salik

farshizzo
09-19-2007, 07:45 PM
You can get the position of a bone in world coordinates using the following code:bone.getPosition(viz.AVATAR_WORLD)Does this give you what you want?