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

three.js static scene, detect when webgl render complete


Comments

Popular posts from this blog

node.js - Using Node without global install -

How to access a php class file from PHPFox framework into javascript code written in simple HTML file? -

java - Null response to php query in android, even though php works properly -