[x3d-public] Playback controller

Max Limper max.limper at igd.fraunhofer.de
Thu Mar 19 03:28:28 PDT 2015


Hi,

my colleague Pasquale (CC) did something similar in one of his X3DOM 
projects - let me forward his message to this list (see below).

Regards,
Max



We have a basic html slider. Slider movement triggers a function that 
manipulates the time source.

The basic idea is to set a new start time which lies in the past. The 
elapsed time since the start is the given fraction of one cycle interval.


var currentInterval = timeSource.getAttribute("cycleInterval");

var timeElapsed = fraction * currentInterval;

var currentTime = (new Date()).getTime()/1000;

var newStartTime = currentTime - timeElapsed;

timeSource.setAttribute("enabled","false");

timeSource.setAttribute("startTime", String(newStartTime));

timeSource.setAttribute("enabled",”true”);




On 19.03.2015 00:42, Mike McCann wrote:
> Hello,
>
> I have an hour's worth of platform orientation data that I can play 
> back with a TimeSensor. I'd like to give the viewer a slider to be 
> able to "scrub" through the data.
>
> I can route in a PlaneSensor to control the OrientationInterpolators, 
> but when the PlaneSensor is not active the TimeSensor resumes with its 
> value not being changed.
>
> What I'd like to do is to route a value into a 'set_fraction' field of 
> TimeSensor, but that is not in the X3D specification.
>
> Are there any other ideas on how to accomplish this? (I'd think that 
> this would be a common use case: basically a video playback controller 
> for any sort of time dependent data.)
>
> -Mike
>
> --
> Mike McCann
> Software Engineer
> Monterey Bay Aquarium Research Institute
> 7700 Sandholdt Road
> Moss Landing, CA 95039-9644
> Voice: 831.775.1769  Fax: 831.775.1736 http://www.mbari.org
>
>
>
> _______________________________________________
> x3d-public mailing list
> x3d-public at web3d.org
> http://web3d.org/mailman/listinfo/x3d-public_web3d.org

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20150319/3cd322b5/attachment-0001.html>


More information about the x3d-public mailing list