WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 10-08-2013, 03:56 PM
zharuViz zharuViz is offline
Member
 
Join Date: Oct 2013
Posts: 5
Physics engine update rate and display rate

Hello,
I'm programming a virtual racquetball experiment in Vizard. In my experiment, physics engine has to run at a much higher rate than visual display rate (60Hz). But it seems when I decrease the display rate the physics engine update rate goes down as well. So does anyone know how to solve this?
Any insight would be helpful,
Thanks in advance.
Reply With Quote
  #2  
Old 10-09-2013, 02:44 PM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,455
Can you explain why you need the physics engine to run at a faster rate? Physics updates occur in the main Vizard loop and will be in sync with the display rate.
Reply With Quote
  #3  
Old 10-09-2013, 04:23 PM
zharuViz zharuViz is offline
Member
 
Join Date: Oct 2013
Posts: 5
Hi Jeff,
I need to do this because in our racquetball experiment, ball travels really fast so physics engine must be fast to allow collision detection (from my understanding), do you know any way to solve this problem?
Thanks!
Reply With Quote
  #4  
Old 10-10-2013, 12:32 PM
zharuViz zharuViz is offline
Member
 
Join Date: Oct 2013
Posts: 5
Jeff, it is that in our experiment the ball moves really fast. I think I need physics engine to update fast to allow accurate collision detection.
Reply With Quote
  #5  
Old 10-10-2013, 12:59 PM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,455
Is the issue that the ball goes through the paddle? If that's the case you could make the collide shape thicker on the paddle. If you need to record the collision at a precision higher than the framerate I don't think that's possible.
Reply With Quote
  #6  
Old 10-10-2013, 10:52 PM
zharuViz zharuViz is offline
Member
 
Join Date: Oct 2013
Posts: 5
Yes. I guess I can make the paddle thicker. But ball going through the paddle is not the major issue though. We use a phasespace system and need to stream data at 480Hz, is this also restricted by display rate? Is there any way to deal with this?
I appreciate your help, thanks!
Reply With Quote
  #7  
Old 10-11-2013, 02:23 PM
masaki masaki is offline
Member
 
Join Date: Jan 2008
Posts: 63
You can reduce the step size, or the time between each physics calculations, by using the viz.phys.setStepSize command and set it to 1/480.0.
Reply With Quote
  #8  
Old 10-12-2013, 08:36 PM
zharuViz zharuViz is offline
Member
 
Join Date: Oct 2013
Posts: 5
Hi Masaki, thanks. But when actually running the code physics engine is sync with display rate, which is 60Hz, how do I solve this problem?
Reply With Quote
  #9  
Old 10-15-2013, 06:50 PM
mhtong mhtong is offline
Member
 
Join Date: Sep 2012
Posts: 6
Let me see if I can phrase the problem a little differently.

Given ball and racket velocities, 60Hz is too slow. There's a motion capture system (PhaseSpace) running at 480Hz providing the position of the racket. It seems like the physics engine should be running at the same rate to provide the most accurate gameplay. Making the paddle substantially thicker isn't really an option, as they can hit with either side of the paddle.

We had a working version of this written in C++, but are switching to Vizard for a variety of reasons. We have it mostly working in Vizard, but this issue has remained a problem. It seems like others should have bumped into these kinds of problems before as motion capture often runs at faster rates? Or is there a way to have the Vizard main loop run at a faster rate without attempting to render at that rate?
Reply With Quote
  #10  
Old 10-17-2013, 08:00 AM
performlabrit performlabrit is offline
Member
 
Join Date: Oct 2013
Posts: 77
i would also like a solution, for similar reasons. It would be disastrous if the rate of data-polling was capped at the vertical sync rate of 60 hz. Eye-tracking, motion capture, and many other systems must run at rates >60 hz to be effective. I would be grateful if you could post your findings!
Reply With Quote
  #11  
Old 10-18-2013, 11:27 AM
masaki masaki is offline
Member
 
Join Date: Jan 2008
Posts: 63
Again, you can set the step size of the physics calculation to anything you want e.g. 1/480. It is *not* locked to your frame rate.
Reply With Quote
  #12  
Old 10-23-2013, 07:07 AM
performlabrit performlabrit is offline
Member
 
Join Date: Oct 2013
Posts: 77
related issues - physics dependent upon measurement?

Masaki, the issue is not yet resolved. Currently, it seems to me that Vizard can not be used for high-fidelity immersive simulations in which there is a restriction on V-SYnc. The issue is that, although one can update the physics engine rate faster than the V-Sync, this is done independently of any other updates, which may only occur at V-sync (60 hz, in many cases). This is going to be a huge obstacle if one wants physics to be dependent upon a high-rate data-stream, such as motion capture.

Take, for example, my own work, in which I am developing an immersive virtual environment in which the user hits a moving ball using a real-world racquet that is motion-tracked and represented in the virtual world. Because of restrictions placed upon the main loop, the sensed location of the racquet can only be refreshed at 60 hz - a rate that is VERY slow when tracking extremely fast, yet extremely spatially precise human movements. If racquet location is updated at only 60 hz, movement of the racquet will be heavily aliased, no matter the speed at which the physics engine updates. Swings will be inaccurate, and ball-to-racquet interactions even more-so.

You might suggest that movement of the racquet between frames could be predicted using the physics engine. I've tried this before, and have found it to be very inaccurate.

The ideal situation is one in which subroutines could be run at different rates, or the main-loop could be run at a rate faster than vertical sync.

Last edited by performlabrit; 10-23-2013 at 07:17 AM. Reason: edited for clarity
Reply With Quote
  #13  
Old 10-28-2013, 06:52 AM
performlabrit performlabrit is offline
Member
 
Join Date: Oct 2013
Posts: 77
Guys, because our focus has shifted a bit, I have decided to move the last post to a new thread:

"Vsync prevents using fresh motion capture data in physics simulations?"
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


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


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