javascript - Three.JS - Scrolling issues in firefox -
i not sure if else having problem or not three.js. have simple demo of cube spin varying rotational velocity (arrow keys, mouse, or touch input). seems work fantastic in chrome browser. @ work hopped on imac, textures seem splicing , not mapped geometry correctly in safari.
i moved on firefox browser on mac , works, , frame rate decent. seems reason when cube gets rotated @ angles renderer jumps , onscreen hud moves , can't see title @ top , stats widget moves bottom of screen. seems cube's y position jumps @ same time. seem have same problem in android on of mobile browsers. wondering if has had similar issues in firefox (on mac?) or in mobile browsers rendering jumping, moving onscreen hud, etc
edit: have figured out problem. still not have ideal solution. created copy of demo , tried commenting out keyboard handling code , surprise issue still existed. apparently firefox scrolling window , down , keyboard handler included in threex library not disable default behavior of , down arrow keys in firefox. in chrome there no room scroll window , make renderer size of window. not see why firefox scrolling.
i experiment same problems on firefox in mac on example.
the jumps on rendering due garbage collector (poorly implemented on firefox). allocating memory on each "animate" function.
instead of creating new vector3/matrix4 rotation, use global variables, create objects once.
besides, instead of using keyboardstate, , executing 'state' functions on each animate call, should use keyboardlistener, execute code when changes (and not time).
you should take example: http://mrdoob.github.com/three.js/examples/canvas_geometry_cube.html
Comments
Post a Comment