Getting updated position
Hi all,
I am new to Vizard and still learning.. So, I am trying to move point of view from one position to another position using fluid movement (vizact.goto) and after the view point is moved to a new location, I need to get the the new coordinate of the view. I wrote the following code: viz.MainView.setPosition([10,2,3]) view = viz.MainView #grab the coordinate of main view seq1 = vizact.goto([10,2,15]),3,viz.SPEED, pivot = [0,2,0], ori_mask = viz.BODY_ORI) #execute action on key down vizact.onkeydown(' ', view.runAction, seq1) #get the current position after movement of view point x,y,z = view.getPosition() print "Your current position is", x,y,z The problem is, instead of getting the position of view after the goto command ([10,2,15]), the getPosition always return the original position. Is there any way that I can update the coordinate of the variable 'view' each time after an action is executed. Thank you very much for all your help. |
Hi Anastaggra,
There is a simple solution for your problem. The problem is that with the code you provided, your variables x,y, and z are set once the code runs, and not updated when the position of the viewpoint is updated. What you need to do is to update x,y, and z after you have pressed the spacebar. So instead of running only the action, you also need to update x,y, and z. See below for an example using a sample environment that comes with Vizard: Code:
import viz Frank |
All times are GMT -7. The time now is 11:09 PM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC