three.js dom id of canvas element used for webgl renderer -


i'd id of canvas element automatically created three.js.

alternately, equally happy (perhaps more so) ability pass along preexisting canvas element id during construction.

after researching, tried this:

renderer = new three.webglrenderer( { canvas: my_canvas } ); 

without success (it pretty old build, hoping work). perhaps parameter syntax has changed since 2 years ago?

(my_canvas being id of canvas, tried passing along context, no luck)

finally tried:

document.getelementsbytagname('canvas'); 

which returned nothing... puzzler , proverbial straw led me post here.

any insight appreciated, thanks! (i have voting rights)

var canvas = document.getelementbyid("canvasid"); renderer = new three.webglrenderer({ canvas: canvas }); 

Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -