Scaling movement through the virtual environment
Hello,
I am working on an experiment that requires relative motion through the environment to change under different conditions. However, it seems that when I try scaling the motion, it messes up rotation. When I turn to a certain point, it moves back several degrees. Also, when I set the scaling higher, forward motion is noticeably offset. This is what I'm using to change the relative motion: Code:
self.link.postScale([self.walkSensitivity,1,self.walkSensitivity],viz.LINK_POS_OP) Any suggestions are appreciated. Thanks, miles. |
Can you post all the code related to the link and the other operations?
|
The project I'm working on is very large, but I'll try to post every snippet I can find...
Also, I don't believe I explained the problem very well, so let me try to concisely re describe. When we set walkSensitivity to anything other than 1, and we try to rotate in the virtual environment, it gets to a certain angle and then "snaps" to another position. Here is some code: Code:
# init class |
To keep your postTrans from getting scaled by the later postScale, create the postScale first or change its priority argument. The order you create the pre/post operations matters.
Not sure what you mean by Quote:
|
When the subject turns his/her body, the degree of rotation in the real world does not match the degree of rotation in the virtual world. At a certain degree of rotation, the rotation in the virtual world instantly shifts several degrees forward or backward.
Example Scenario: Facing Forward, 90 degrees in the virtual and real world Begin Rotating Clockwise, 90... 75... 60... 45... Reach 45 degrees, virtual world jumps back to 60 degrees Continue Rotating Clockwise, 60... 45... 30... 15... 0 Halt, Now facing 0 degrees in virtual environment Rotate Counter Clockwise, 0... 15... ... 60 Reach 60 degrees, virtual world jumps back to 45 degrees Continue Rotating Counter Clockwise, 45... 60... 75... 90 Halt, Facing Forward in both real and virtual worlds Thanks for your assistance. |
Your description is good, but I don't know why you would see that. :confused:
If I was you, I would re-write the movement code using vizmat.Transform or with a system of 3D nodes with parent/child relationships. That way we can see what is going on and not have all that action buried in a link object. Probably not what you want to hear. Hopefully I'm just missing something. |
Thank you for the response. I did not write the original transformation code, so I don't fully understand it. I'll continue to play around with it, hopefully I can understand it better.
Anyone else have any ideas? |
It appears the only relevant lines are
Code:
# Walk sensitivity is also applied as a scalar matrix transformation |
You are using the .postScale() command incorrectly. If you look at the docs, the target option is the third parameter, not the second. I recommend passing the value as a keyword argument:
Code:
self.link.postScale([self.walkSensitivity,1,self.walkSensitivity],target=viz.LINK_POS_OP) |
Wow! I cannot thank you enough, what a silly mistake! It has been baffling our team for weeks, I can't believe it was so simple. It works fully now, please mark as solved. Our team extends warmest thanks.
-miles |
All times are GMT -7. The time now is 08:56 AM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC