javascript - How to start a timer when a three.js render is visible to the user -
i'm building application performing psychometric visual search tests. example, i'll render bunch of 'l''s on screen and, optionally 't'. challenge measure time moment image has been drawn monitor, until key-press user indicating decision whether "target" present in image or not.
i'm using three.js (rather 2d library) want evaluate search performance when scene rendered orthographically (traditional pyschometric 2d visual search) , when rendered in perspective as, example, educational game might be. targets/distractors 3d cubes, polyhedrons, or text (ie l's , t's) may 50 of them max, not complicated scene @ all.
i did spot prior q/a the goal determine when render finished image saved. adapted needs might this..
function init() {... mesh = new three.mesh (... //build targets , distractors scene.add (mesh); requestanimationframe(starttimerwaitforkeydown); render (); } am correct in understanding starttimerwaitforkeydown function called after initial render () of scene has been synced screen, indication browser ready render second frame, , readiness render second frame implicit evidence first frame finished , has been synced monitor?
i'm never rendering second frame..just trying start timer @ moment first render visible test subject...(or best proxy thereof).
accuracy millisecond or 2 fine...i'm trying avoid 16.66ms of render/frame-sync uncertainty.
thanks!
jd
ps. prior q/a here
Comments
Post a Comment