WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 04-07-2008, 03:01 PM
Uttama_vizard Uttama_vizard is offline
Member
 
Join Date: Sep 2007
Posts: 60
Timing issue

While working with avatars moving dynamically on the virtual screen, I want to record the x,y,z coordinates of say 'head' of an avatar. For this, I am using

print "male1_head_position:", head1.getPosition(viz.AVATAR_WORLD)

This is giving me the coordinates.

In addition, I want to record the system time instantaneously, so that I can correlate the 3D coordinates of say, head of an avatar at a particular instant with some tracking data. From the "help" coming with Vizard, I am getting the elasped time, but, I am not getting the particular instant associated with a particular 3D position of an object.

Can any one suggest me a solution to this?

Thanks in advance.

Uttama
Reply With Quote
  #2  
Old 04-07-2008, 03:03 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Use viz.getFrameTime() to get the current absolute time of the frame.
Reply With Quote
  #3  
Old 04-07-2008, 03:17 PM
Uttama_vizard Uttama_vizard is offline
Member
 
Join Date: Sep 2007
Posts: 60
Timing Issue

Thank you so much.

But, I am getting this display as output

male1_head_position: [0.0054466063156723976, 1.7178937196731567, -1.9990379810333252]
79.6599115251
2
male1_head_position: [0.0054466063156723976, 1.7178937196731567, -1.9990379810333252]
158.816147862

'2' indicates my second looping of the program. In fact, it shows that the frame time is doubled in the second looping of the program.

What, I wanted is to display the system time in hrs:mins:secs format.

Your suggestions are very helpful.

Thanks

Uttama
Reply With Quote
  #4  
Old 04-07-2008, 03:30 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
The viz.getFrameTime() function returns the current time in seconds. You can use the time module to format it for display. The following code will format the time to hrs:min:secs:
Code:
import time
print time.strftime('%H:%M:%S',time.gmtime(viz.getFrameTime()))
Reply With Quote
  #5  
Old 04-07-2008, 03:38 PM
Uttama_vizard Uttama_vizard is offline
Member
 
Join Date: Sep 2007
Posts: 60
Timing Issue

I am getting the output as

male1_head_position: [0.0054466063156723976, 1.7178937196731567, -1.9990379810333252]
00:01:19
2
male1_head_position: [0.0054466063156723976, 1.7178937196731567, -1.9990379810333252]
00:02:39
3

But, this is the elasped time. I wanted the system time in hrs:mins:secs format.


Thanks

Uttama
Reply With Quote
  #6  
Old 04-07-2008, 03:40 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Have a look at the Python documentation for the time module. It describes all the functionality you need. In this case you would use the time.localtime() function:
Code:
time.strftime('%H:%M:%S',time.localtime())
Reply With Quote
  #7  
Old 04-07-2008, 03:44 PM
Uttama_vizard Uttama_vizard is offline
Member
 
Join Date: Sep 2007
Posts: 60
Timing Issue

Your suggestions are really valuable. It works great.

Lots of thanks

Uttama
Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Timing jaclyn.bill Vizard 2 10-19-2007 03:34 AM
stereo projection issue asimbh Vizard 3 10-05-2007 10:22 AM
cal3d exporter issue reiverlass Vizard 4 07-18-2007 12:08 PM
viewing issue. cantwelljm Vizard 3 03-29-2006 12:03 PM
vizard 2.5 compatability issue shai Vizard 3 08-10-2005 04:35 PM


All times are GMT -7. The time now is 12:06 AM.


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