Question about postScale while linking two objects
Hello all,
here is what I want to achieve: Link an object (destination) to the viewpoint (source), so that it moves with the viewpoint BUT at a different speed. E.g. if the viewpoint moves 10m, the linked object should only move 2m. I managed to do that with the postScale command. However, the scaling is also applied to the inital offset of the destination object. This is a problem, because I want to destination object to start out at a certain offset, independent of the speed scaling. I tried to manually set a transformation matrix but failed so far. I included a small sample script. Here, the pigeon starts out at an offset of [3,0,3] from the viewport. I want it to move with the viewport, but at a different speed. If I apply a postScale, the pigeon will NOT start out at an offset of [3,0,3], but at the offset multiplied by the scale. Code:
import viz |
I think you need to apply the offset after the scale. Try the following:
Code:
pigeonlink = viz.link(viz.MainView, pigeon, mask = viz.LINK_POS) |
That worked wonderfully, thanks!
I the meantime, I also managed to fix it by manually correcting the offset by the scaling factor * initial offset. Your solution is much more elegant, thanks again! |
EDIT: fixed.
|
All times are GMT -7. The time now is 11:30 PM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC