WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   Transforming coordinate systems. (https://forum.worldviz.com/showthread.php?t=1222)

v-Salik 09-19-2007 07:24 PM

Transforming coordinate systems.
 
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:
Code:

bone.getPosition(viz.AVATAR_WORLD)
Does this give you what you want?


All times are GMT -7. The time now is 07:15 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC