You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi @jasonsturges
I made some changes to code as per your suggestions.
Thank you
In scene.js
animate=()=>{renderer.setAnimationLoop(function(){renderer.render(scene,camera);cube.rotation.y+=0.01;});};//we can create renderer outside the createScene so that the renderer is created only once.renderer=newWebGLRenderer({antialias: true});exportconstcreateScene=(el)=>{//we can bind the renderer.domElement (canvas element ) to divel.appendChild(renderer.domElement);constresize=()=>{renderer.setSize(el.clientWidth,el.clientHeight);camera.aspect=el.clientWidth/el.clientHeight;camera.updateProjectionMatrix();};animate();resize();window.addEventListener("resize",resize);};exportconstDispose=()=>{//removes the animationLooprenderer.setAnimationLoop();//we can add code to Dispose objects};
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi @jasonsturges
I made some changes to code as per your suggestions.
Thank you
In scene.js
In App.svelte
Beta Was this translation helpful? Give feedback.
All reactions