[osg-users] Smoothing camera movements from HMD's input

alessandro terenzi a.terenzi at gmail.com
Tue Sep 30 14:08:21 PDT 2008


I understand what you said.

I'm experiencing with HMDs and trackers just from few days and, as far as I
understood from my HMD's API, I can adjust the tracking rate and, in my
example, the polling period was set to 30 msec.
I didn't do anything to synch with actual rendering framerate because the
API didn't mention such problem at all, the documentation just talked about
synch for stereo vision.

Basically the logic of my application is:

1) one thread poll the tracker every 30msec and stores data in a global
struct

2) another thread run the application loop during which:
    2.1) an update callback reads the global struct ad update the
orientation of my virtual camera (osg::PositionAttitudeTransform) with that
data
    2.2) I update the osg::Camera's viewmatrix
    2.3) I call viewer.frame()

At runtime, actually, it looks like that my app is acquiring tracker's data
quite fast, because the orientation of my head is correctly set also in the
virtual environment and without delays (at least it seems so), but it just
looks like that when rotating a little bit, some 'radians/degrees' are
missing, and the overall movements is not so smooth. Maybe I used the wrong
word (jerky) to describe my problem?

Regards.
Alessandro


On 9/30/08, Fuesz, Matthew <matthew.fuesz at lmco.com> wrote:
>
>  How fast does your HMD tracker update its orientation, and how are you
> retrieving these values?
>
>
>
> If you're not getting the values in realtime at least as fast as OSG is
> refreshing, then you would definitely have some jerky movements. And if
> you're not getting them this fast, then what are you interpolating between?
> If your HMD device is only operating at a fraction of the OSG update rate,
> then you need to be using predictive values, based on the last known trend
> deltas. You need to be careful here, as you are approaching territory where
> the view (OSG) lags noticeably behind the actual movement (HMD), which I
> would think would be rather undesirable. That is, the only way to
> interpolate between actual data is to wait after the fact; the only other
> alternative is to use predicted values to interpolate between until actual
> data is available – and this could also cause jerks, if the prediction
> period is too long, causing the actual position at the next timestep to be
> significantly different than the predicted one used for "smoothing".
>
>
>
> I find it highly unlikely that your hardware would be returning values at
> less than 60 Hz (the typical "target" framerate for graphical applications),
> and that it is probably capable of much higher data rates. Thus, through a
> combination of efficient access to this data stream (orientations) and
> possibly capping the OSG framerate (think v-sync), I would expect that your
> HW/SW combination would be able to maintain a smooth motion without any
> trouble or additional "smoothing".
>
>
>
> *Matthew W. Fuesz*
>
> Software Engineer Asc.
>
> Lockheed Martin STS
>
> 1210 Massillon Road
>
> Akron, OH 44315
>
> matthew.fuesz at lmco.com
>
>
>  ------------------------------
>
> *From:* osg-users-bounces at lists.openscenegraph.org [mailto:
> osg-users-bounces at lists.openscenegraph.org] *On Behalf Of *alessandro
> terenzi
> *Sent:* Tuesday, September 30, 2008 1:53 PM
> *To:* OpenSceneGraph Users
> *Subject:* Re: [osg-users] Smoothing camera movements from HMD's input
>
>
>
> Yes, indeed I have a PositionAttitudeTransform node that represent my
> virtual camera, and whose attitude is set by HMD's data and later used to
> set the camera's view matrix just before calling viewer.frame().
>
>
>
> So I thuoght to 'animate' the attitude instead of just setting values from
> HMD' tracker.
>
> On Tue, Sep 30, 2008 at 7:12 PM, Jim Brooks <jimblist at gmail.com> wrote:
>
> >In order to solve this problem, I was thinking about creating an animation
> >path (on the fly) from a previously stored orientation to current head
> >orientation. Is this the correct way to proceed? Or there is some other
> >technique to smooth the resulting camera movements?
>
> osg::AnimationPath interpolates across rotations and positions (for
> smoothing).
> See examples/osganimate.
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20080930/74e79d8d/attachment-0003.htm>


More information about the osg-users mailing list