-
Notifications
You must be signed in to change notification settings - Fork 119
Update relation between frame and transformation #1443
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
2d771d6
8b6497d
6a72346
79f8a82
e011267
c11268f
558385b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -83,22 +83,25 @@ def test_sceneobject_auto_context_discovery_no_context(mocker): | |
| def test_sceneobject_transform(): | ||
| scene = Scene() | ||
| sceneobj1 = scene.add(Box()) | ||
| sceneobj1.frame = Frame([1.0, 0.0, 0.0], xaxis=[1.0, 0.0, 0.0], yaxis=[0.0, 1.0, 0.0]) | ||
| sceneobj1.transformation = Translation.from_vector([10.0, 0.0, 0.0]) | ||
| assert sceneobj1.worldtransformation == sceneobj1.frame.to_transformation() * sceneobj1.transformation | ||
| assert sceneobj1.worldtransformation == sceneobj1.transformation | ||
| assert sceneobj1.worldtransformation == Translation.from_vector([10.0, 0.0, 0.0]) | ||
| assert sceneobj1.frame == Frame([10.0, 0.0, 0.0], [1.0, 0.0, 0.0], [0.0, 1.0, 0.0]) | ||
| assert sceneobj1.frame.to_transformation() == Translation.from_vector([10.0, 0.0, 0.0]) | ||
|
|
||
| sceneobj2 = scene.add(Box(), parent=sceneobj1) | ||
| sceneobj2.frame = Frame([1.0, 1.0, 0.0], xaxis=[1.0, 0.0, 0.0], yaxis=[0.0, 1.0, 0.0]) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. by simply removing the frame, you're not reproducing the same result as before...
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yep, but if you see in next few lines, the assert condition was updated according to the new computing scheme, or perhaps I misunderstood something here? |
||
| sceneobj2.transformation = Translation.from_vector([10.0, 10.0, 0.0]) | ||
| assert sceneobj2.worldtransformation == sceneobj1.frame.to_transformation() * sceneobj2.frame.to_transformation() * sceneobj2.transformation | ||
| assert sceneobj2.worldtransformation == sceneobj1.transformation * sceneobj2.transformation | ||
| assert sceneobj2.worldtransformation == Translation.from_vector([20.0, 10.0, 0.0]) | ||
| assert sceneobj2.frame == Frame([20.0, 10.0, 0.0], [1.0, 0.0, 0.0], [0.0, 1.0, 0.0]) | ||
| assert sceneobj2.frame.to_transformation() == Translation.from_vector([20.0, 10.0, 0.0]) | ||
|
|
||
| sceneobj3 = scene.add(Box(), parent=sceneobj2) | ||
| sceneobj3.frame = Frame([1.0, 1.0, 1.0], xaxis=[0.0, 1.0, 0.0], yaxis=[1.0, 0.0, 0.0]) | ||
| sceneobj3.transformation = Translation.from_vector([10.0, 10.0, 10.0]) | ||
| assert ( | ||
| sceneobj3.worldtransformation | ||
| == sceneobj1.frame.to_transformation() * sceneobj2.frame.to_transformation() * sceneobj3.frame.to_transformation() * sceneobj3.transformation | ||
| ) | ||
| assert sceneobj3.worldtransformation == sceneobj1.transformation * sceneobj2.transformation * sceneobj3.transformation | ||
| assert sceneobj3.worldtransformation == Translation.from_vector([30.0, 20.0, 10.0]) | ||
| assert sceneobj3.frame == Frame([30.0, 20.0, 10.0], [1.0, 0.0, 0.0], [0.0, 1.0, 0.0]) | ||
| assert sceneobj3.frame.to_transformation() == Translation.from_vector([30.0, 20.0, 10.0]) | ||
|
|
||
| def test_scene_clear(): | ||
| scene = Scene() | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.