WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 09-24-2014, 06:31 PM
Melody Melody is offline
Member
 
Join Date: Aug 2014
Posts: 26
How to get pre and current position of a moving object

I tried to get pre and current position of my haptic device with timer.
But I got the pre and current positions are exactly the same.
Could you please let me know how to solve this problem?

Below please see my coding. Thank you in advance.

def getposition():
global currpos
global currposy
global preposy
currpos=mark.getPosition(viz.ABS_GLOBAL)
prepos=currpos
currpos=mark.getPosition(viz.ABS_GLOBAL)

def maintimer():
vizact.ontimer(0,getposition)

viz.callback(viz.KEYDOWN_EVENT,maintimer)
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 05:57 AM.


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