рдереНрд░реАред рдЬреЗрдПрд╕ рд╕реАрдЦрдирд╛ред рдЕрдзреНрдпрд╛рдп 1: рдереНрд░реАред рдЬреЗрдПрд╕ рдХрд╛ рдЙрдкрдпреЛрдЧ рдХрд░рдХреЗ рд╣рдорд╛рд░рд╛ рдкрд╣рд▓рд╛ 3 рдбреА рджреГрд╢реНрдп рдмрдирд╛рдирд╛

рд╕рднреА рдХреЛ рдирдорд╕реНрдХрд╛рд░!

рдореИрдВ рд╡реЗрдмрд▓реЙрдЧ рдХреЗ рд▓рд┐рдП рдЕрджреНрднреБрдд рдкреБрд╕реНрддрдХ Learning Three.js- The JavaScript 3D рд▓рд╛рдЗрдмреНрд░реЗрд░реА рдХрд╛ рдореБрдлреНрдд рдЕрдиреБрд╡рд╛рдж рд╢реБрд░реВ рдХрд░рдирд╛ рдЪрд╛рд╣рддрд╛ рд╣реВрдВред рдореБрдЭреЗ рдпрдХреАрди рд╣реИ рдХрд┐ рдпрд╣ рдкреБрд╕реНрддрдХ рди рдХреЗрд╡рд▓ рд╢реБрд░реБрдЖрддреА рд▓реЛрдЧреЛрдВ рдХреЗ рд▓рд┐рдП, рдмрд▓реНрдХрд┐ рдЙрдирдХреЗ рдХреНрд╖реЗрддреНрд░ рдХреЗ рдкреЗрд╢реЗрд╡рд░реЛрдВ рдХреЗ рд▓рд┐рдП рднреА рджрд┐рд▓рдЪрд╕реНрдк рд╣реЛрдЧреАред рдЦреИрд░, рдореИрдВрдиреЗ рдкрд░рд┐рдЪрдп рдХреЛ рд▓рдВрдмреЗ рд╕рдордп рддрдХ рдирд╣реАрдВ рдЦреАрдВрдЪрд╛, рдореИрдВ рд╕рд┐рд░реНрдл рдПрдХ рдЙрджрд╛рд╣рд░рдг рджреЗрддрд╛ рд╣реВрдВ рдХрд┐ рд╣рдо рдЬрд▓реНрдж рд╣реА рдХреНрдпрд╛ рдХрд░ рдкрд╛рдПрдВрдЧреЗ:











рдПрдХ HTML рдкреЗрдЬ рд╕рдВрд░рдЪрдирд╛ рдмрдирд╛рдПрдБ



рдкрд╣рд▓реА рдЪреАрдЬрд╝ рдЬреЛ рд╣рдореЗрдВ рдХрд░рдиреЗ рдХреА рдЬрд╝рд░реВрд░рдд рд╣реИ рд╡рд╣ рд╣реИ рдЦрд╛рд▓реА HTML рдкреГрд╖реНрда рдмрдирд╛рдирд╛ рдЬреЛ рд╣рдорд╛рд░реЗ рд╕рднреА рдЙрджрд╛рд╣рд░рдгреЛрдВ рдХреЗ рдЖрдзрд╛рд░ рдХреЗ рд░реВрдк рдореЗрдВ рдЗрд╕реНрддреЗрдорд╛рд▓ рдХрд┐рдпрд╛ рдЬрд╛ рд╕рдХрддрд╛ рд╣реИред рдЗрд╕ HTML рд╕рдВрд░рдЪрдирд╛ рдХреЛ рдирд┐рдореНрдирд╛рдиреБрд╕рд╛рд░ рджрд░реНрд╢рд╛рдпрд╛ рдЧрдпрд╛ рд╣реИ:



<!DOCTYPE html> <html> <head> <title>Example 01.01 - Basic skeleton</title> <script type="text/javascript" src="../libs/three.js"> </script> <script type="text/javascript" src="../libs/jquery-1.9.0.js"> </script> <style> body{ /* set margin to 0 and overflow to hidden, to use the complete page */ margin: 0; overflow: hidden; } </style> </head> <body> <!--Div which will hold the Output --> <div id="WebGL-output"> </div> <!--Javascript code that runs our Three.js examples --> <script type="text/javascript"> // once everything is loaded, we run our Three.js stuff. $(function () { // here we'll put the Three.js stuff }); </script> </body> </html>
      
      





рдпрд╣ рд▓рд┐рд╕реНрдЯрд┐рдВрдЧ рдХреЗрд╡рд▓ рддрддреНрд╡реЛрдВ рдХреЗ рдПрдХ рдЬреЛрдбрд╝реЗ рдХреЗ рд╕рд╛рде рдПрдХ рдмрд╣реБрдд рд╣реА рд╕рд░рд▓ HTML рдкреГрд╖реНрда рдХреА рд╕рдВрд░рдЪрдирд╛ рдХреЛ рджрд┐рдЦрд╛рддреА рд╣реИред рдмреНрд▓реЙрдХ рдореЗрдВ, рд╣рдо рдмрд╛рд╣рд░реА рдЬрд╛рд╡рд╛рд╕реНрдХреНрд░рд┐рдкреНрдЯ рдкреБрд╕реНрддрдХрд╛рд▓рдпреЛрдВ рдХреЛ рд▓реЛрдб рдХрд░рддреЗ рд╣реИрдВ рдЬреЛ рд╣рдо рдЙрджрд╛рд╣рд░рдгреЛрдВ рдореЗрдВ рдЙрдкрдпреЛрдЧ рдХрд░реЗрдВрдЧреЗред рдЙрджрд╛рд╣рд░рдг рдХреЗ рд▓рд┐рдП, рдЙрдкрд░реЛрдХреНрдд рд╕реВрдЪреА рдореЗрдВ, рд╣рдо рджреЛ рдкреБрд╕реНрддрдХрд╛рд▓рдпреЛрдВ рдХреЛ рдЬреЛрдбрд╝рдиреЗ рдХреА рдХреЛрд╢рд┐рд╢ рдХрд░ рд░рд╣реЗ рд╣реИрдВ: jquery-1.9.0.js



рдФрд░ jquery-1.9.0.js



. jquery-1.9.0.js



ред рдЗрд╕рдХреЗ рдЕрд▓рд╛рд╡рд╛ рдЗрд╕ рдмреНрд▓реЙрдХ рдореЗрдВ рд╣рдо рд╕реАрдПрд╕рдПрд╕ рдбрд┐рдЬрд╛рдЗрди рдХреЗ рд▓рд┐рдП рдХреБрдЫ рдкрдВрдХреНрддрд┐рдпреЛрдВ рдХреЛ рд▓рд┐рдЦрддреЗ рд╣реИрдВред рдкрд┐рдЫрд▓реЗ рд╕реНрдирд┐рдкреЗрдЯ рдореЗрдВ, рдЖрдк рдХреБрдЫ рдЬрд╛рд╡рд╛рд╕реНрдХреНрд░рд┐рдкреНрдЯ рдХреЛрдб рджреЗрдЦ рд╕рдХрддреЗ рд╣реИрдВред рдЬрдм рдкреЗрдЬ рдкреВрд░реА рддрд░рд╣ рд╕реЗ рд▓реЛрдб рд╣реЛ рдЬрд╛рддрд╛ рд╣реИ рддреЛ рдПрдХ рдЫреЛрдЯрд╛ рдЬрд╛рд╡рд╛рд╕реНрдХреНрд░рд┐рдкреНрдЯ рдлрд╝рдВрдХреНрд╢рди рдХреЙрд▓ рдХрд░рдиреЗ рдХреЗ рд▓рд┐рдП рдХреЛрдб рдХрд╛ рдпрд╣ рдЫреЛрдЯрд╛ рдЯреБрдХрдбрд╝рд╛ JQuery



рдХрд╛ рдЙрдкрдпреЛрдЧ рдХрд░рддрд╛ рд╣реИред рд╣рдо рдЗрд╕ рдлрд╝рдВрдХреНрд╢рди рдХреЗ рдЕрдВрджрд░ рд╕рднреА рддреАрди.js рдХреЛрдб рдбрд╛рд▓реЗрдВрдЧреЗред

рддреАрди.js рджреЛ рд╕рдВрд╕реНрдХрд░рдгреЛрдВ рдореЗрдВ рдЖрддреЗ рд╣реИрдВ:



рдпрджрд┐ рд╣рдо рдмреНрд░рд╛рдЙрдЬрд╝рд░ рдореЗрдВ рд▓рд┐рдЦреЗ рдЧрдП рдкреГрд╖реНрда рдХреЛ рдЦреЛрд▓рддреЗ рд╣реИрдВ, рддреЛ рд╣рдо рдмрд╣реБрдд рдЪреМрдВрдХреЗрдВрдЧреЗ рдирд╣реАрдВред рдЬреИрд╕рд╛ рдХрд┐ рдЕрдкреЗрдХреНрд╖рд┐рдд рдерд╛, рд╣рдо рд╕рднреА рджреЗрдЦрддреЗ рд╣реИрдВ рдХрд┐ рдПрдХ рдЦрд╛рд▓реА рдкреГрд╖реНрда рд╣реИред







рдЕрдЧрд▓реЗ рднрд╛рдЧ рдореЗрдВ, рдЖрдк рд╕реАрдЦреЗрдВрдЧреЗ рдХрд┐ 3 рдбреА рдСрдмреНрдЬреЗрдХреНрдЯреНрд╕ рдХреА рдкрд╣рд▓реА рдЬреЛрдбрд╝реА рдХреЛ рд╣рдорд╛рд░реЗ рд╕реАрди рдореЗрдВ рдХреИрд╕реЗ рдЬреЛрдбрд╝рд╛ рдЬрд╛рдПред



3D рдСрдмреНрдЬреЗрдХреНрдЯреНрд╕ рдХреЛ рд░реЗрдВрдбрд░ рдХрд░рдирд╛ рдФрд░ рджреЗрдЦрдирд╛



рдЗрд╕ рдмрд┐рдВрджреБ рдкрд░ рд╣рдо рдЕрдкрдирд╛ рдкрд╣рд▓рд╛ рджреГрд╢реНрдп рдмрдирд╛рдПрдВрдЧреЗ рдФрд░ рдХреБрдЫ рд╡рд╕реНрддреБрдУрдВ рдФрд░ рдПрдХ рдХреИрдорд░реЗ рдХреЛ рдЬреЛрдбрд╝реЗрдВрдЧреЗред рд╣рдорд╛рд░реЗ рдкрд╣рд▓реЗ рдЙрджрд╛рд╣рд░рдг рдореЗрдВ рдирд┐рдореНрдирд▓рд┐рдЦрд┐рдд рд╡рд╕реНрддреБрдПрдВ рд╣реЛрдВрдЧреА:

рдПрдХ рд╡рд┐рдорд╛рди рдПрдХ рджреНрд╡рд┐-рдЖрдпрд╛рдореА рдЖрдпрдд рд╣реИ рдЬреЛ рд╣рдорд╛рд░реЗ рдореБрдЦреНрдп рд╕реНрдерд▓ рдХреЗ рд░реВрдк рдореЗрдВ рдХрд╛рдо рдХрд░реЗрдЧрд╛ред рдпрд╣ рджреГрд╢реНрдп рдХреЗ рдмреАрдЪ рдореЗрдВ рдПрдХ рдЧреНрд░реЗ рдЖрдпрдд рдХреЗ рд░реВрдк рдореЗрдВ рджрд┐рдЦрд╛рдИ рджреЗрдЧрд╛ред

рдПрдХ рдШрди рдПрдХ рддреАрди-рдЖрдпрд╛рдореА рдШрди рд╣реИ рдЬрд┐рд╕реЗ рд╣рдо рд▓рд╛рд▓ рд░рдВрдЧ рдореЗрдВ рдкреНрд░рд╕реНрддреБрдд рдХрд░реЗрдВрдЧреЗред

рдПрдХ рдЧреЛрд▓рд╛ рдПрдХ рддреНрд░рд┐-рдЖрдпрд╛рдореА рдХреНрд╖реЗрддреНрд░ рд╣реИ, рдЬрд┐рд╕реЗ рд╣рдо рдиреАрд▓реЗ рд░рдВрдЧ рдореЗрдВ рдкреНрд░рд╕реНрддреБрдд рдХрд░реЗрдВрдЧреЗред

рдХреИрдорд░рд╛ - рдпрд╣ рдирд┐рд░реНрдзрд╛рд░рд┐рдд рдХрд░рддрд╛ рд╣реИ рдХрд┐ рд╣рдо рдЖрдЙрдЯрдкреБрдЯ рдореЗрдВ рдХреНрдпрд╛ рджреЗрдЦрддреЗ рд╣реИрдВред

рдХреБрд▓реНрд╣рд╛рдбрд╝реА рдПрдХреНрд╕, рд╡рд╛рдИ рдФрд░ рдЬреЗрдб рд╣реИрдВред рдпрд╣ рджреЗрдЦрдиреЗ рдХреЗ рд▓рд┐рдП рдПрдХ рдЙрдкрдпреЛрдЧреА рдбреАрдмрдЧрд┐рдВрдЧ рдЙрдкрдХрд░рдг рд╣реИ рдЬрд╣рд╛рдБ рдСрдмреНрдЬреЗрдХреНрдЯреНрд╕ рдкреНрд░рджрд╛рди рдХрд┐рдП рдЬрд╛рддреЗ рд╣реИрдВред

рдкрд╣рд▓реЗ, рдЖрдЗрдП рджреЗрдЦреЗрдВ рдХрд┐ рдпрд╣ рдХреЛрдб рдореЗрдВ рдХреИрд╕рд╛ рджрд┐рдЦрддрд╛ рд╣реИ, рдФрд░ рдлрд┐рд░ рдЗрд╕реЗ рдЬрд╛рдирдиреЗ рдХреА рдХреЛрд╢рд┐рд╢ рдХрд░реЗрдВред



 <script type="text/javascript"> $(function () { var scene = new THREE.Scene(); var camera = new THREE.PerspectiveCamera(45 , window.innerWidth / window.innerHeight , 0.1, 1000); var renderer = new THREE.WebGLRenderer(); renderer.setClearColorHex(0xEEEEEE); renderer.setSize(window.innerWidth, window.innerHeight); var axes = new THREE.AxisHelper( 20 ); scene.add(axes); var planeGeometry = new THREE.PlaneGeometry(60,20,1,1); var planeMaterial = new THREE.MeshBasicMaterial({color: 0xcccccc}); var plane = new THREE.Mesh(planeGeometry,planeMaterial); plane.rotation.x=-0.5*Math.PI; plane.position.x = 15; plane.position.y = 0; plane.position.z = 0; scene.add(plane); var cubeGeometry = new THREE.CubeGeometry(4,4,4); var cubeMaterial = new THREE.MeshBasicMaterial( {color: 0xff0000, wireframe: true}); var cube = new THREE.Mesh(cubeGeometry, cubeMaterial); cube.position.x = -4; cube.position.y = 3; cube.position.z = 0; scene.add(cube); var sphereGeometry = new THREE.SphereGeometry(4,20,20); var sphereMaterial = new THREE.MeshBasicMaterial( {color: 0x7777ff, wireframe: true}); var sphere = new THREE.Mesh(sphereGeometry,sphereMaterial); sphere.position.x = 20; sphere.position.y = 4; sphere.position.z = 2; scene.add(sphere); camera.position.x = -30; camera.position.y = 40; camera.position.z = 30; camera.lookAt(scene.position); $("#WebGL-output").append(renderer.domElement); renderer.render(scene, camera); });
      
      





рдпрджрд┐ рд╣рдо рдЗрд╕ рдЙрджрд╛рд╣рд░рдг рдХреЛ рдПрдХ рдмреНрд░рд╛рдЙрдЬрд╝рд░ рдореЗрдВ рдЦреЛрд▓рддреЗ рд╣реИрдВ, рддреЛ рд╣рдо рдХреБрдЫ рд╡реИрд╕рд╛ рд╣реА рджреЗрдЦреЗрдВрдЧреЗ рдЬреИрд╕рд╛ рд╣рдо рдЪрд╛рд╣рддреЗ рдереЗ, рд▓реЗрдХрд┐рди рдЕрднреА рднреА рдЖрджрд░реНрд╢ рд╕реЗ рдмрд╣реБрдд рджреВрд░ рд╣реИред







рдЗрд╕рд╕реЗ рдкрд╣рд▓реЗ рдХрд┐ рд╣рдо рджреГрд╢реНрдп рдХреЛ рд╕реБрдВрджрд░ рдмрдирд╛рдирд╛ рд╢реБрд░реВ рдХрд░реЗрдВ, рдЖрдЗрдП рд╣рдо рдЬреЛ рдХреБрдЫ рднреА рдХрд░рддреЗ рд╣реИрдВ, рдЙрд╕рдХреЗ рдмрд╛рд░реЗ рдореЗрдВ рдХрджрдо-рджрд░-рдХрджрдо рджреЗрдЦреЗрдВ:



 var scene = new THREE.Scene(); var camera = new THREE.PerspectiveCamera(45 , window.innerWidth / window.innerHeight , 0.1, 1000); var renderer = new THREE.WebGLRenderer(); renderer.setClearColorHex(0xEEEEEE); renderer.setSize(window.innerWidth, window.innerHeight);
      
      





рдЗрд╕ рдЙрджрд╛рд╣рд░рдг рдореЗрдВ, рд╣рдордиреЗ рджреГрд╢реНрдп, рдХреИрдорд░рд╛ рдФрд░ рд╡рд┐рдЬрд╝реБрдЕрд▓рд╛рдЗрдЬрд╝рд░ рдХреЛ рдкрд░рд┐рднрд╛рд╖рд┐рдд рдХрд┐рдпрд╛ред рдПрдХ рджреГрд╢реНрдп рдЪрд░ рдПрдХ рдХрдВрдЯреЗрдирд░ рд╣реИ рдЬрд┐рд╕рдХрд╛ рдЙрдкрдпреЛрдЧ рдЙрди рд╕рднреА рд╡рд╕реНрддреБрдУрдВ рдХреЛ рд╕рдВрдЧреНрд░рд╣реАрдд рдФрд░ рдЯреНрд░реИрдХ рдХрд░рдиреЗ рдХреЗ рд▓рд┐рдП рдХрд┐рдпрд╛ рдЬрд╛рддрд╛ рд╣реИ рдЬрд┐рдиреНрд╣реЗрдВ рд╣рдо рдкреНрд░рджрд░реНрд╢рд┐рдд рдХрд░рдирд╛ рдЪрд╛рд╣рддреЗ рд╣реИрдВред рдЬрд┐рд╕ рдЧреЛрд▓реЗ рдФрд░ рдШрди рдХреЛ рд╣рдо рдкреНрд░рджрд░реНрд╢рд┐рдд рдХрд░рдирд╛ рдЪрд╛рд╣рддреЗ рд╣реИрдВ рдЙрд╕реЗ рдЗрд╕ рдЙрджрд╛рд╣рд░рдг рдореЗрдВ рдереЛрдбрд╝реА рджреЗрд░ рдмрд╛рдж рдЬреЛрдбрд╝рд╛ рдЬрд╛рдПрдЧрд╛ред рдЗрд╕ рд╕реНрдирд┐рдкреЗрдЯ рдореЗрдВ, рд╣рдордиреЗ рдПрдХ рдХреИрдорд░рд╛ рд╡реЗрд░рд┐рдПрдмрд▓ рднреА рдмрдирд╛рдпрд╛ред рдпрд╣ рдЪрд░ рдирд┐рд░реНрдзрд╛рд░рд┐рдд рдХрд░рддрд╛ рд╣реИ рдХрд┐ рдЬрдм рд╣рдо рджреГрд╢реНрдп рдкреНрд░рд╕реНрддреБрдд рдХрд░рддреЗ рд╣реИрдВ рддреЛ рд╣рдо рдХреНрдпрд╛ рджреЗрдЦреЗрдВрдЧреЗред рдЕрдЧрд▓рд╛, рд╣рдо рд╡рд┐рдЬрд╝реБрдЕрд▓рд╛рдЗрдЬрд╝реЗрд╢рди (рд░реЗрдВрдбрд░рд┐рдВрдЧ) рдХреЗ рдСрдмреНрдЬреЗрдХреНрдЯ рдХреЛ рдкрд░рд┐рднрд╛рд╖рд┐рдд рдХрд░реЗрдВрдЧреЗред рдЧрдгрдирд╛ рдЧрдгрдирд╛ рдХреЗ рд▓рд┐рдП рдЬрд┐рдореНрдореЗрджрд╛рд░ рд╣реИ рдХрд┐ рдХреИрд╕реЗ рдмреНрд░рд╛рдЙрдЬрд╝рд░ рдореЗрдВ рджреГрд╢реНрдп рдПрдХ рдпрд╛ рджреВрд╕рд░реЗ рддрд░реАрдХреЗ рд╕реЗ рджрд┐рдЦрд╛рдИ рджреЗрдЧрд╛ред рд╣рдордиреЗ рдПрдХ WebGLRenderer



рдСрдмреНрдЬреЗрдХреНрдЯ рднреА рдмрдирд╛рдпрд╛ рд╣реИ рдЬреЛ рджреГрд╢реНрдп рдХреЛ рд░реЗрдВрдбрд░ рдХрд░рдиреЗ рдХреЗ рд▓рд┐рдП рд╡реАрдбрд┐рдпреЛ рдХрд╛рд░реНрдб рдХрд╛ рдЙрдкрдпреЛрдЧ рдХрд░реЗрдЧрд╛ред

рдпрд╣рд╛рдВ, setClearColorHex()



рдлрд╝рдВрдХреНрд╢рди рдХрд╛ рдЙрдкрдпреЛрдЧ рдХрд░рддреЗ рд╣реБрдП, рд╣рдо рд░реЗрдВрдбрд░рд░ рдХреА рдкреГрд╖реНрдарднреВрдорд┐ рдХрд╛ рд░рдВрдЧ рд▓рдЧрднрдЧ рд╕рдлреЗрдж (0XEEEEEE) рдкрд░ рд╕реЗрдЯ рдХрд░рддреЗ рд╣реИрдВ, рдФрд░ setSize()



рдлрд╝рдВрдХреНрд╢рди рдХрд╛ рдЙрдкрдпреЛрдЧ рдХрд░рдХреЗ рдкреНрд░рджрд╛рди рдХрд┐рдП рдЧрдП рджреГрд╢реНрдп рдХрд╛ рдЖрдХрд╛рд░ рднреА рдирд┐рд░реНрдзрд╛рд░рд┐рдд рдХрд░рддреЗ рд╣реИрдВред

рдЕрдм рддрдХ, рд╣рдорд╛рд░реЗ рдкрд╛рд╕ рдХреЗрд╡рд▓ рдореВрд▓ рддрддреНрд╡ рд╣реИрдВ, рдЬреИрд╕реЗ рдХрд┐ рдЦрд╛рд▓реА рджреГрд╢реНрдп, render



рдФрд░ camera



ред рд▓реЗрдХрд┐рди, рдЕрднреА рднреА, рдХрд▓реНрдкрдирд╛ рдХрд░рдиреЗ рдХреЗ рд▓рд┐рдП рдХреБрдЫ рднреА рдирд╣реАрдВ рд╣реИред рдирд┐рдореНрдирд▓рд┐рдЦрд┐рдд рдХреЛрдб рдЯреБрдХрдбрд╝рд╛ рд╕рд╣рд╛рдпрдХ рдХреБрд▓реНрд╣рд╛рдбрд╝рд┐рдпреЛрдВ рдФрд░ рдПрдХ рд╡рд┐рдорд╛рди рдЬреЛрдбрд╝рддрд╛ рд╣реИред



 var axes = new THREE.AxisHelper( 20 ); scene.add(axes); var planeGeometry = new THREE.PlaneGeometry(60,20); var planeMaterial = new THREE.MeshBasicMaterial( {color: 0xcccccc}); var plane = new THREE.Mesh(planeGeometry,planeMaterial); plane.rotation.x = -0.5*Math.PI; plane.position.x = 15; plane.position.y = 0; plane.position.z = 0; scene.add(plane);
      
      





рдЖрдк рджреЗрдЦ рд╕рдХрддреЗ рд╣реИрдВ рдХрд┐ рд╣рдордиреЗ рдХреБрд▓реНрд╣рд╛рдбрд╝реА рдХреА рд╡рд╕реНрддреБ рдмрдирд╛рдИ рд╣реИ рдФрд░ рд╣рдорд╛рд░реЗ рджреГрд╢реНрдп рдореЗрдВ рдХреБрд▓реНрд╣рд╛рдбрд╝рд┐рдпреЛрдВ рдХреЛ рдЬреЛрдбрд╝рдиреЗ рдХреЗ рд▓рд┐рдП рджреГрд╢реНрдп scene.add()



рдлрд╝рдВрдХреНрд╢рди рдХрд╛ рдЙрдкрдпреЛрдЧ рдХрд┐рдпрд╛ рд╣реИред рдЕрдм рд╣рдо рдПрдХ рдкреНрд▓реЗрди рдмрдирд╛ рд╕рдХрддреЗ рд╣реИрдВред рдпрд╣ рджреЛ рдЪрд░рдгреЛрдВ рдореЗрдВ рдХрд┐рдпрд╛ рдЬрд╛рддрд╛ рд╣реИред рдкрд╣рд▓реЗ рд╣рдо рдпрд╣ рдирд┐рд░реНрдзрд╛рд░рд┐рдд рдХрд░рддреЗ рд╣реИрдВ рдХрд┐ рд╡рд┐рдорд╛рди рдХреЛ new THREE



рдХрд╛ рдЙрдкрдпреЛрдЧ рдХрд░рдХреЗ рдкреНрд░рджрд░реНрд╢рд┐рдд рдХрд┐рдпрд╛ рдЬрд╛рдПрдЧрд╛ред рдХреЛрдб рдореЗрдВ PlaneGeometry(60,20)



ред рдЗрд╕ рд╕реНрдерд┐рддрд┐ рдореЗрдВ, рд╣рдорд╛рд░реЗ рд╡рд┐рдорд╛рди рдХреА рдЪреМрдбрд╝рд╛рдИ 60 рдФрд░ 20 рдХреА рдКрдБрдЪрд╛рдИ рд╣реЛрдЧреАред рдЗрд╕рдХреЗ рдЕрд▓рд╛рд╡рд╛, рд╣рдореЗрдВ рддреАрди рдмрд╛рд░ рдмрддрд╛рдирд╛ рд╣реЛрдЧрд╛ рдХрд┐ рд╣рдорд╛рд░рд╛ рд╡рд┐рдорд╛рди рдХреИрд╕рд╛ рджрд┐рдЦрдирд╛ рдЪрд╛рд╣рд┐рдП (рдЙрджрд╛рд╣рд░рдг рдХреЗ рд▓рд┐рдП, рдЙрд╕рдХрд╛ рд░рдВрдЧ рдпрд╛ рдкрд╛рд░рджрд░реНрд╢рд┐рддрд╛)ред Three.js рдореЗрдВ, рд╣рдо рдПрдХ рднреМрддрд┐рдХ рд╡рд╕реНрддреБ рдмрдирд╛рдХрд░ рдРрд╕рд╛ рдХрд░рддреЗ рд╣реИрдВред рдкрд╣рд▓реЗ рдЙрджрд╛рд╣рд░рдг рдХреЗ рд▓рд┐рдП, рд╣рдо рд░рдВрдЧ 0xcccccc рдХреА рдореБрдЦреНрдп рд╕рд╛рдордЧреНрд░реА ( MeshBasicMaterial()



рд╡рд┐рдзрд┐ рдХрд╛ рдЙрдкрдпреЛрдЧ рдХрд░рдХреЗ MeshBasicMaterial()



рдмрдирд╛рдПрдВрдЧреЗред рдЗрд╕рдХреЗ рдмрд╛рдж, рд╣рдо рдЗрди рджреЛ рд╡рд╕реНрддреБрдУрдВ рдХреЛ plane



рдирд╛рдо рдХреА рдПрдХ рдЬрд╛рд▓ рд╡рд╕реНрддреБ рдореЗрдВ рдорд┐рд▓рд╛рддреЗ plane



ред рдЗрд╕рд╕реЗ рдкрд╣рд▓реЗ рдХрд┐ рд╣рдо рджреГрд╢реНрдп рдореЗрдВ plane



рдЬреЛрдбрд╝рддреЗ plane



, рд╣рдореЗрдВ рдЗрд╕реЗ рд╕рд╣реА рд╕реНрдерд┐рддрд┐ рдореЗрдВ рд░рдЦрдирд╛ рд╣реЛрдЧрд╛; рд╣рдо рдЗрд╕реЗ рдХрд░рддреЗ рд╣реИрдВ, рд╕рдмрд╕реЗ рдкрд╣рд▓реЗ, рдЗрд╕реЗ рдПрдХреНрд╕ рдЕрдХреНрд╖ рдХреЗ рдЪрд╛рд░реЛрдВ рдУрд░ 90 рдбрд┐рдЧреНрд░реА рдШреБрдорд╛рдХрд░, рдФрд░ рдлрд┐рд░ рд╣рдо position



рд╕рдВрдкрддреНрддрд┐ рдХрд╛ рдЙрдкрдпреЛрдЧ рдХрд░рдХреЗ рджреГрд╢реНрдп рдкрд░ рдЗрд╕рдХреА рд╕реНрдерд┐рддрд┐ рдирд┐рд░реНрдзрд╛рд░рд┐рдд рдХрд░рддреЗ рд╣реИрдВред рдЕрдВрдд рдореЗрдВ, рд╣рдореЗрдВ рдЗрд╕ рдСрдмреНрдЬреЗрдХреНрдЯ рдХреЛ рджреГрд╢реНрдп рдореЗрдВ рдЬреЛрдбрд╝рдирд╛ рд╣реЛрдЧрд╛, рдЬрд┐рд╕ рддрд░рд╣ рд╣рдордиреЗ axes



рдСрдмреНрдЬреЗрдХреНрдЯ рдХреЗ рд╕рд╛рде рдХрд┐рдпрд╛ рдерд╛ред

рдХреНрдпреВрдм рдФрд░ рдЧреЛрд▓реЗ рдХреЛ рдПрдХ рд╣реА рддрд░рд╣ рд╕реЗ рдЬреЛрдбрд╝рд╛ рдЬрд╛рддрд╛ рд╣реИ, рд▓реЗрдХрд┐рди wireframe



рд╕рдВрдкрддреНрддрд┐ рдХрд╛ рдореВрд▓реНрдп true



рд╣реЛрдЧрд╛, рддреЛ рдЖрдЗрдП рдЗрд╕ рдЙрджрд╛рд╣рд░рдг рдХреЗ рдЕрдВрддрд┐рдо рднрд╛рдЧ рдкрд░ рдЪрд▓рддреЗ рд╣реИрдВ:



 camera.position.x = -30; camera.position.y = 40; camera.position.z = 30; camera.lookAt(scene.position); $("#WebGL-output").append(renderer.domElement); renderer.render(scene, camera);
      
      





рдЗрд╕ рд╕реНрддрд░ рдкрд░, рд╡реЗ рд╕рднреА рддрддреНрд╡ рдЬрд┐рдирдХреА рд╣рдо рдХрд▓реНрдкрдирд╛ рдХрд░рдирд╛ рдЪрд╛рд╣рддреЗ рдереЗ рдЙрдиреНрд╣реЗрдВ рдЙрдирдХреЗ рдЙрдЪрд┐рдд рд╕реНрдерд╛рдиреЛрдВ рдореЗрдВ рджреГрд╢реНрдп рдореЗрдВ рдЬреЛрдбрд╝рд╛ рдЧрдпрд╛ред рд╣рдордиреЗ рдкрд╣рд▓реЗ рд╣реА рдХрд╣рд╛ рд╣реИ рдХрд┐ рдХреИрдорд░рд╛ рдирд┐рд░реНрдзрд╛рд░рд┐рдд рдХрд░рддрд╛ рд╣реИ рдХрд┐ рдХреНрдпрд╛ рдкреНрд░рджрд░реНрд╢рд┐рдд рдХрд┐рдпрд╛ рдЬрд╛рдПрдЧрд╛ред рдЗрд╕ рдХреЛрдб рдХреЗ рдЯреБрдХрдбрд╝реЗ рдореЗрдВ, рд╣рдо рд╕реНрдерд┐рддрд┐ рд╡рд┐рд╢реЗрд╖рддрд╛ рдХреЗ x, y рдФрд░ z рдорд╛рдиреЛрдВ рдХрд╛ рдЙрдкрдпреЛрдЧ рдХрд░рдХреЗ рдХреИрдорд░рд╛ рдХреЛ position



рджреЗрддреЗ рд╣реИрдВ рдФрд░ рдпрд╣ рд╣рдорд╛рд░реЗ рджреГрд╢реНрдп рдкрд░ рдордВрдбрд░рд╛рдиреЗ рд▓рдЧрддрд╛ рд╣реИред рдпрд╣ рд╕реБрдирд┐рд╢реНрдЪрд┐рдд рдХрд░рдиреЗ рдХреЗ рд▓рд┐рдП рдХрд┐ рдХреИрдорд░рд╛ рд╣рдорд╛рд░реА рд╡рд╕реНрддреБрдУрдВ рдХреЛ рджреЗрдЦ рд░рд╣рд╛ рд╣реИ, рд╣рдо рдЕрдкрдиреЗ рджреГрд╢реНрдп рдХреЗ рдХреЗрдВрджреНрд░ рдХреЛ рдЗрдВрдЧрд┐рдд рдХрд░рдиреЗ рдХреЗ рд▓рд┐рдП lookAt()



рдлрд╝рдВрдХреНрд╢рди рдХрд╛ рдЙрдкрдпреЛрдЧ рдХрд░рддреЗ рд╣реИрдВред



рд╕рд╛рдордЧреНрд░реА, рдкреНрд░рдХрд╛рд╢ рдФрд░ рдЫрд╛рдпрд╛ рдЬреЛрдбрд╝рдирд╛



рдирдИ рд╕рд╛рдордЧреНрд░реА рдФрд░ рд▓рд╛рдЗрдЯрд┐рдВрдЧ рдХреЛ рдереНрд░реА.рдЬреИрд╕ рдореЗрдВ рдЬреЛрдбрд╝рдирд╛ рдмрд╣реБрдд рд╣реА рд╕рд░рд▓ рдФрд░ рд╕реБрдВрджрд░ рд╣реИ рдЬреИрд╕рд╛ рдХрд┐ рд╣рдордиреЗ рдкрд┐рдЫрд▓реЗ рднрд╛рдЧ рдореЗрдВ рдХрд┐рдпрд╛ рдерд╛ред



 var spotLight = new THREE.SpotLight( 0xffffff ); spotLight.position.set( -40, 60, -10 ); scene.add(spotLight );
      
      





SpotLight()



рд╡рд┐рдзрд┐ spotLight.position.set( -40, 60, -10 )



рд╕реЗ рд╣рдорд╛рд░реЗ рджреГрд╢реНрдп рдХреЛ рдкреНрд░рдХрд╛рд╢рд┐рдд рдХрд░рддреА рд╣реИред рд╕реНрдерд┐рддрд┐ / spotLight.position.set( -40, 60, -10 )



рд╕реНрдерд┐рддрд┐ред рдпрджрд┐ рдЖрдк рдлрд┐рд░ рд╕реЗ рджреГрд╢реНрдп рдкреНрд░рд╕реНрддреБрдд рдХрд░рддреЗ рд╣реИрдВ, рддреЛ рдЖрдк рджреЗрдЦреЗрдВрдЧреЗ рдХрд┐ рдкрд┐рдЫрд▓реЗ рдЙрджрд╛рд╣рд░рдг рдХреЗ рд╕рд╛рде рдХреЛрдИ рдЕрдВрддрд░ рдирд╣реАрдВ рд╣реИред рдХрд╛рд░рдг рдпрд╣ рд╣реИ рдХрд┐ рд╡рд┐рднрд┐рдиреНрди рд╕рд╛рдордЧреНрд░реА рдкреНрд░рдХрд╛рд╢ рдХреЗ рд▓рд┐рдП рдЕрд▓рдЧ-рдЕрд▓рдЧ рдкреНрд░рддрд┐рдХреНрд░рд┐рдпрд╛ рдХрд░рддреА рд╣реИрдВред рдореБрдЦреНрдп рд╕рд╛рдордЧреНрд░реА рдЬреЛ рд╣рдордиреЗ рдкрд┐рдЫрд▓реЗ рдЙрджрд╛рд╣рд░рдг рдореЗрдВ рд╡рд╕реНрддреБрдУрдВ рдХреЗ рд▓рд┐рдП рдЗрд╕реНрддреЗрдорд╛рд▓ рдХреА MeshBasicMaterial



( MeshBasicMaterial



() рд╡рд┐рдзрд┐ рдХрд╛ рдЙрдкрдпреЛрдЧ рдХрд░рдХреЗ) рджреГрд╢реНрдп рдореЗрдВ рдкреНрд░рдХрд╛рд╢ рд╕реНрд░реЛрддреЛрдВ рдХреЗ рд▓рд┐рдП рдХрд┐рд╕реА рднреА рддрд░рд╣ рд╕реЗ рдкреНрд░рддрд┐рдХреНрд░рд┐рдпрд╛ рдирд╣реАрдВ рдХрд░рддрд╛ рд╣реИред рд╡реЗ рдмрд╕ рдПрдХ рд╡рд┐рд╢рд┐рд╖реНрдЯ рд░рдВрдЧ рдореЗрдВ рд╡рд╕реНрддреБрдУрдВ рдХреА рдХрд▓реНрдкрдирд╛ рдХрд░рддреЗ рд╣реИрдВред рдЗрд╕рд▓рд┐рдП, рд╣рдореЗрдВ рдЕрдкрдиреЗ рд╡рд┐рдорд╛рди, рдЧреЛрд▓реЗ рдФрд░ рдШрди рдХреЗ рд▓рд┐рдП рд╕рд╛рдордЧреНрд░реА рдХреЛ рдиреАрдЪреЗ рджрд┐рдЦрд╛рдП рдЕрдиреБрд╕рд╛рд░ рдмрджрд▓рдирд╛ рдЪрд╛рд╣рд┐рдП:



 var planeGeometry = new THREE.PlaneGeometry(60,20); var planeMaterial = new THREE.MeshLambertMaterial( {color: 0xffffff}); var plane = new THREE.Mesh(planeGeometry,planeMaterial); ... var cubeGeometry = new THREE.CubeGeometry(4,4,4); var cubeMaterial = new THREE.MeshLambertMaterial( {color: 0xff0000}); var cube = new THREE.Mesh(cubeGeometry, cubeMaterial); ... var sphereGeometry = new THREE.SphereGeometry(4,20,20); var sphereMaterial = new THREE.MeshLambertMaterial( {color: 0x7777ff}); var sphere = new THREE.Mesh(sphereGeometry,sphereMaterial);
      
      





рдХреЛрдб рдХреЗ рдЗрд╕ рднрд╛рдЧ рдореЗрдВ, рд╣рдордиреЗ рдЕрдкрдиреА рд╡рд╕реНрддреБрдУрдВ рдХреЗ рд▓рд┐рдП рдореЗрд╢рд▓реИрдореНрдмрд░реНрдЯ рдордЯреЗрд░рд┐рдпрд▓ рдлрд╝рдВрдХреНрд╢рди рдХрд╛ рдЙрдкрдпреЛрдЧ рдХрд░рдХреЗ рднреМрддрд┐рдХ рд╕рдВрдкрддреНрддрд┐ рдХреЛ рдмрджрд▓ рджрд┐рдпрд╛ред рддреАрди.js рджреЛ рд╕рд╛рдордЧреНрд░реА рдкреНрд░рджрд╛рди рдХрд░рддреЗ рд╣реИрдВ рдЬреЛ рдкреНрд░рдХрд╛рд╢ рд╕реНрд░реЛрдд рдЕрдиреБрднрд╡ рдХрд░рддреЗ рд╣реИрдВ: MeshLambertMaterial рдФрд░ MeshPhongMaterialред

рд╣рд╛рд▓рд╛рдБрдХрд┐, рдЬреИрд╕рд╛ рдХрд┐ рдирд┐рдореНрдирд▓рд┐рдЦрд┐рдд рд╕реНрдХреНрд░реАрдирд╢реЙрдЯ рдореЗрдВ рджрд┐рдЦрд╛рдпрд╛ рдЧрдпрд╛ рд╣реИ, рдпрд╣ рдЕрднреА рднреА рд╡рд╣ рдирд╣реАрдВ рд╣реИ рдЬреЛ рд╣рдо рдЗрд╕рдХреЗ рд▓рд┐рдП рд▓рдХреНрд╖реНрдп рдХрд░ рд░рд╣реЗ рд╣реИрдВ:







рдШрди рдФрд░ рдЧреЛрд▓рд╛ рдереЛрдбрд╝рд╛ рдмреЗрд╣рддрд░ рдирд┐рдХрд▓рд╛, рд▓реЗрдХрд┐рди рдЕрднреА рддрдХ рдЗрд╕рдореЗрдВ рдХреЛрдИ рдЫрд╛рдпрд╛ рдирд╣реАрдВ рд╣реИред рд░реЗрдВрдбрд░рд┐рдВрдЧ рд╢реИрдбреЛ рдореЗрдВ рдмрд╣реБрдд рдЕрдзрд┐рдХ рдкреНрд░реЛрд╕реЗрд╕рд┐рдВрдЧ рдкрд╛рд╡рд░ рд╣реЛрддреА рд╣реИ рдФрд░ рдЗрд╕реА рдХрд╛рд░рдг рд╕реЗ рд╢реИрдбреЛрдЬрд╝ рдХреЛ рддреАрди.рдЬреИрд╕ рдореЗрдВ рдбрд┐рдлрд╝реЙрд▓реНрдЯ рд░реВрдк рд╕реЗ рдЕрдХреНрд╖рдо рдХрд░ рджрд┐рдпрд╛ рдЬрд╛рддрд╛ рд╣реИред рд▓реЗрдХрд┐рди рдЙрдирдХрд╛ рд╕рдорд╛рд╡реЗрд╢ рд╡рд╛рд╕реНрддрд╡ рдореЗрдВ рдмрд╣реБрдд рд╕рд░рд▓ рд╣реИред рдЫрд╛рдпрд╛ рдХреЗ рд▓рд┐рдП, рд╣рдореЗрдВ рд╕реНрд░реЛрдд рдХреЛ рдХрдИ рд╕реНрдерд╛рдиреЛрдВ рдкрд░ рдмрджрд▓рдиреЗ рдХреА рдЖрд╡рд╢реНрдпрдХрддрд╛ рд╣реИ, рдЬреИрд╕рд╛ рдХрд┐ рдирд┐рдореНрдирд▓рд┐рдЦрд┐рдд рдХреЛрдб рдЯреБрдХрдбрд╝рд╛ рдореЗрдВ рджрд┐рдЦрд╛рдпрд╛ рдЧрдпрд╛ рд╣реИ:



 renderer.setClearColorHex(0xEEEEEE, 1.0); renderer.setSize(window.innerWidth, window.innerHeight); renderer.shadowMapEnabled = true;
      
      





рдкрд╣рд▓реА рдЪреАрдЬ рдЬреЛ рд╣рдореЗрдВ рдХрд░рдиреЗ рдХреА рдЬрд╝рд░реВрд░рдд рд╣реИ рд╡рд╣ рдпрд╣ рд╣реИ рдХрд┐ рд╣рдо render



рдХреЛ рд╢рд╛рдорд┐рд▓ рдХрд░рдирд╛ рдЪрд╛рд╣рддреЗ рд╣реИрдВред рддреБрдо true



рдХрд░рдиреЗ рдХреЗ рд▓рд┐рдП shadowMapEnabled



рд╕рдВрдкрддреНрддрд┐ рд╕реЗрдЯ рдХрд░рдХреЗ рдРрд╕рд╛ рдХрд░ рд╕рдХрддреЗ рд╣реИрдВред рдпрджрд┐ рдЖрдк рдЗрд╕ рдХрд╛рд░реНрд░рд╡рд╛рдИ рдХреЗ рдкрд░рд┐рдгрд╛рдо рдХреЛ рджреЗрдЦрддреЗ рд╣реИрдВ, рддреЛ рд╣рдо рдХреБрдЫ рднреА рдиреЛрдЯрд┐рд╕ рдирд╣реАрдВ рдХрд░реЗрдВрдЧреЗред рдРрд╕рд╛ рдЗрд╕рд▓рд┐рдП рд╣реИ рдХреНрдпреЛрдВрдХрд┐ рд╣рдореЗрдВ рд╕реНрдкрд╖реНрдЯ рд░реВрдк рд╕реЗ рдпрд╣ рдирд┐рд░реНрдзрд╛рд░рд┐рдд рдХрд░рдирд╛ рдЪрд╛рд╣рд┐рдП рдХрд┐ рдХреМрди рд╕реА рд╡рд╕реНрддреБ рдЫрд╛рдпрд╛ рдбрд╛рд▓реЗрдЧреА рдФрд░ рдХрд┐рди рд╡рд╕реНрддреБрдУрдВ рдкрд░ рдпрд╣ рдЧрд┐рд░реЗрдЧреАред рд╣рдорд╛рд░реЗ рдЙрджрд╛рд╣рд░рдг рдореЗрдВ, рд╣рдо рдЪрд╛рд╣рддреЗ рд╣реИрдВ рдХрд┐ рдЧреЛрд▓рд╛ рдФрд░ рдШрди рд╣рдорд╛рд░реЗ рд╡рд┐рдорд╛рди рдкрд░ рдЫрд╛рдпрд╛ рдбрд╛рд▓реЗрдВред рдЖрдк рдпрд╣ рдХрд░ рд╕рдХрддреЗ рд╣реИрдВ рдХрд┐ рд╕рд╣реА рдЧреБрдгреЛрдВ рдХреЛ рд╕рд╣реА рдкрд░ рд╕реЗрдЯ рдХрд░рдХреЗ:



 plane.receiveShadow = true; ... cube.castShadow = true; ... sphere.castShadow = true;
      
      





рдЕрдм рдЖрдкрдХреЛ рдЫрд╛рдпрд╛ рджрд┐рдЦрд╛рдиреЗ рдХреЗ рд▓рд┐рдП рдПрдХ рдФрд░ рдЪреАрдЬрд╝ рдХреА рдЬрд╝рд░реВрд░рдд рд╣реИред рд╣рдореЗрдВ рдпрд╣ рдирд┐рд░реНрдзрд╛рд░рд┐рдд рдХрд░рдиреЗ рдХреА рдЖрд╡рд╢реНрдпрдХрддрд╛ рд╣реИ рдХрд┐ рдХреМрди рд╕реЗ рдкреНрд░рдХрд╛рд╢ рд╕реНрд░реЛрдд рдЫрд╛рдпрд╛ рдХрд╛ рдХрд╛рд░рдг рдмрдиреЗрдВрдЧреЗред рд╡реЗ рд╕рднреА рдРрд╕рд╛ рдирд╣реАрдВ рдХрд░ рд╕рдХрддреЗ рд╣реИрдВ, рдЗрд╕ рдкрд░ рдЕрдЧрд▓реЗ рднрд╛рдЧ рдореЗрдВ рдЪрд░реНрдЪрд╛ рдХреА рдЬрд╛рдПрдЧреА, рд╣рдорд╛рд░реЗ рдЙрджрд╛рд╣рд░рдг рдореЗрдВ рд╣рдо SpotLight()



рд╡рд┐рдзрд┐ рдХрд╛ рдЙрдкрдпреЛрдЧ рдХрд░реЗрдВрдЧреЗред рдЕрдм рд╣рдореЗрдВ рд╕рд┐рд░реНрдл рд╕рд╣реА рд╕рдВрдкрддреНрддрд┐ рдирд┐рд░реНрдзрд╛рд░рд┐рдд рдХрд░рдиреА рд╣реИ рдФрд░ рдЕрдВрдд рдореЗрдВ, рдЫрд╛рдпрд╛ рдХреА рдХрд▓реНрдкрдирд╛ рдХрд░реЗрдВред



 spotLight.castShadow = true;
      
      





рдирд┐рдореНрдирд▓рд┐рдЦрд┐рдд рд╕реНрдХреНрд░реАрдирд╢реЙрдЯ рдореЗрдВ рдХреНрдпрд╛ рджреЗрдЦрд╛ рдЬрд╛ рд╕рдХрддрд╛ рд╣реИ:







рдЕрдЧрд▓реЗ рднрд╛рдЧ рдореЗрдВ рд╣рдо рдПрдХ рд╕рд╛рдзрд╛рд░рдг рдПрдиреАрдореЗрд╢рди рдЬреЛрдбрд╝реЗрдВрдЧреЗред



рдЖрдЗрдП рдПрдиреАрдореЗрд╢рди рдХреЗ рд╕рд╛рде рд╣рдорд╛рд░реЗ рджреГрд╢реНрдп рдХреЛ рдЬрдЯрд┐рд▓ рдХрд░реЗрдВ



рдпрджрд┐ рд╣рдо рдХрд┐рд╕реА рддрд░рд╣ рдЕрдкрдиреЗ рджреГрд╢реНрдп рдХреЛ рдкреБрдирд░реНрдЬреАрд╡рд┐рдд рдХрд░рдирд╛ рдЪрд╛рд╣рддреЗ рд╣реИрдВ, рддреЛ рд╕рдмрд╕реЗ рдкрд╣рд▓реЗ рд╣рдореЗрдВ рдПрдХ рдирд┐рд╢реНрдЪрд┐рдд рдЕрдВрддрд░рд╛рд▓ рдкрд░ рджреГрд╢реНрдп рдХреЛ рдлрд┐рд░ рд╕реЗ рдкрд░рд┐рднрд╛рд╖рд┐рдд рдХрд░рдиреЗ рдХрд╛ рдПрдХ рддрд░реАрдХрд╛ рдЦреЛрдЬрдирд╛ рдЪрд╛рд╣рд┐рдПред рд╣рдо рдЗрд╕реЗ setInterval(function,interval)



рдХрд╛ рдЙрдкрдпреЛрдЧ рдХрд░рдХреЗ рдХрд░ рд╕рдХрддреЗ рд╣реИрдВред рдЗрд╕ рдлрд╝рдВрдХреНрд╢рди рдХрд╛ рдЙрдкрдпреЛрдЧ рдХрд░рдХреЗ, рд╣рдо рдПрдХ рдлрд╝рдВрдХреНрд╢рди рдХреЛ рдкрд░рд┐рднрд╛рд╖рд┐рдд рдХрд░ рд╕рдХрддреЗ рд╣реИрдВ рдЬрд┐рд╕реЗ рдкреНрд░рддреНрдпреЗрдХ 100 рдорд┐рд▓реАрд╕реЗрдХрдВрдб рдХрд╣рд╛ рдЬрд╛рдПрдЧрд╛ред рдЗрд╕ рдлрд╝рдВрдХреНрд╢рди рдХреЗ рд╕рд╛рде рд╕рдорд╕реНрдпрд╛ рдпрд╣ рд╣реИ рдХрд┐ рдпрд╣ рдЗрд╕ рдмрд╛рдд рдкрд░ рдзреНрдпрд╛рди рдирд╣реАрдВ рджреЗрддрд╛ рд╣реИ рдХрд┐ рдмреНрд░рд╛рдЙрдЬрд╝рд░ рдореЗрдВ рдХреНрдпрд╛ рд╣реЛ рд░рд╣рд╛ рд╣реИред рдпрджрд┐ рдЖрдк рдПрдХ рдФрд░ рдЯреИрдм рджреЗрдЦ рд░рд╣реЗ рд╣реИрдВ, рддреЛ рдпрд╣ рдлрд╝рдВрдХреНрд╢рди рдЕрднреА рднреА рд╣рд░ рдХреБрдЫ рдорд┐рд▓реАрд╕реЗрдХрдВрдб рдХрд╣рд▓рд╛рдПрдЧрд╛ред рдЗрд╕рдХреЗ рдЕрд▓рд╛рд╡рд╛, setInterval()



рд╡рд┐рдзрд┐ рд╕реНрдХреНрд░реАрди рд░рд┐рдбреНрд░рд╛рдЗрд╡рд┐рдВрдЧ рдХреЗ рд╕рд╛рде рд╕рд┐рдВрдХреНрд░рдирд╛рдЗрдЬрд╝ рдирд╣реАрдВ рд╣реИред рдпрд╣ рд╕рдм рдЙрдЪреНрдЪ рдкреНрд░реЛрд╕реЗрд╕рд░ рд▓реЛрдб рдФрд░ рдХрдо рджрдХреНрд╖рддрд╛ рдХреЛ рдЬрдиреНрдо рджреЗ рд╕рдХрддрд╛ рд╣реИред



рдкрд░рд┐рдЪрдп рдХрд╛ рдЕрдиреБрд░реЛрдз рдХрд░ рд░рд╣рд╛ рд╣реВрдБрдЕрдирд╛рдордХрд░рдгрдлреНрд░реЗрдо () рд╡рд┐рдзрд┐



рд╕реМрднрд╛рдЧреНрдп рд╕реЗ, рдЖрдзреБрдирд┐рдХ рдмреНрд░рд╛рдЙрдЬрд╝рд░реЛрдВ рдХреЗ рдкрд╛рд╕ requestAnimationFrame



() рдлрд╝рдВрдХреНрд╢рди: requestAnimationFrame



() рд╡рд┐рдзрд┐ рд╕реЗ рдЬреБрдбрд╝реА рд╕рдорд╕реНрдпрд╛рдУрдВ рдХрд╛ рд╕рдорд╛рдзрд╛рди рд╣реИред рдЗрд╕ рдлрд╝рдВрдХреНрд╢рди рдХрд╛ рдЙрдкрдпреЛрдЧ рдХрд░рдХреЗ, рдЖрдк рдПрдХ рдлрд╝рдВрдХреНрд╢рди рдирд┐рд░реНрджрд┐рд╖реНрдЯ рдХрд░ рд╕рдХрддреЗ рд╣реИрдВ рдЬрд┐рд╕реЗ рдмреНрд░рд╛рдЙрдЬрд╝рд░ рджреНрд╡рд╛рд░рд╛ рдкрд░рд┐рднрд╛рд╖рд┐рдд рдЕрдВрддрд░рд╛рд▓ рдкрд░ рдмреБрд▓рд╛рдпрд╛ рдЬрд╛рдПрдЧрд╛ред рдЖрдкрдХреЛ рдмрд╕ рдПрдХ рдлрдВрдХреНрд╢рди рдмрдирд╛рдирд╛ рд╣реЛрдЧрд╛ рдЬреЛ рд░реЗрдВрдбрд░рд┐рдВрдЧ рдХреЛ рд╣реИрдВрдбрд▓ рдХрд░реЗрдЧрд╛, рдЬреИрд╕рд╛ рдХрд┐ рдиреАрдЪреЗ рджрд┐рдЦрд╛рдпрд╛ рдЧрдпрд╛ рд╣реИ:



 function renderScene() { requestAnimationFrame(renderScene); renderer.render(scene, camera); }
      
      





renderScene



() рдлрд╝рдВрдХреНрд╢рди рдореЗрдВ, рд╣рдо рдлрд┐рд░ рд╕реЗ рдЪрд▓ рд░рд╣реЗ рдПрдиреАрдореЗрд╢рди рдХреЛ рдмрдЪрд╛рдиреЗ рдХреЗ рд▓рд┐рдП requestAnimationFrame



() рд╡рд┐рдзрд┐ рдХреЛ рдХреЙрд▓ рдХрд░рддреЗ рд╣реИрдВред рдХреЗрд╡рд▓ рдПрдХ рдЪреАрдЬ рдЬреЛ рд╣рдореЗрдВ рдЪрд╛рд╣рд┐рдП рд╡рд╣ рд╣реИ renderer.render()



рдХреА рдЬрдЧрд╣ рдХреЛ рдмрджрд▓рдирд╛ред renderer.render()



рд╡рд┐рдзрд┐ рдХреЙрд▓ рдХреЗ рдмрд╛рдж рдЬрдм рд╣рдордиреЗ рджреГрд╢реНрдп рдХреЛ рдкреВрд░реА рддрд░рд╣ рд╕реЗ рдмрдирд╛рдпрд╛ рд╣реИ, рд╣рдо рдПрдиреАрдореЗрд╢рди рд╢реБрд░реВ рдХрд░рдиреЗ рдХреЗ рд▓рд┐рдП renderScene



() рдлрд╝рдВрдХреНрд╢рди рдХреЛ рдХреЙрд▓ рдХрд░рддреЗ рд╣реИрдВ:



 ... $("#WebGL-output").append(renderer.domElement); renderScene();
      
      





рдпрджрд┐ рдЖрдк рдЗрд╕ рдХреЛрдб рдХреЛ рдЪрд▓рд╛рддреЗ рд╣реИрдВ, рддреЛ рдЖрдкрдХреЛ рдкрд┐рдЫрд▓реЗ рдЙрджрд╛рд╣рд░рдг рдХреА рддреБрд▓рдирд╛ рдореЗрдВ рдХреЛрдИ рдмрджрд▓рд╛рд╡ рдирд╣реАрдВ рджрд┐рдЦреЗрдЧрд╛, рдХреНрдпреЛрдВрдХрд┐ рд╣рдордиреЗ рдЕрднреА рддрдХ рдХреБрдЫ рднреА рдПрдирд┐рдореЗрдЯреЗрдб рдирд╣реАрдВ рдХрд┐рдпрд╛ рд╣реИред рдЗрд╕рд╕реЗ рдкрд╣рд▓реЗ рдХрд┐ рд╣рдо рдПрдиреАрдореЗрд╢рди рдЬреЛрдбрд╝рддреЗ рд╣реИрдВ, рдореИрдВ рдПрдХ рдЫреЛрдЯреА рд╕рд╣рд╛рдпрдХ рд▓рд╛рдЗрдмреНрд░реЗрд░реА рд╢реБрд░реВ рдХрд░рдирд╛ рдЪрд╛рд╣рддрд╛ рд╣реВрдВ рдЬреЛ рд╣рдореЗрдВ рдлреНрд░реЗрдо рджрд░ рдХреЗ рдмрд╛рд░реЗ рдореЗрдВ рдЬрд╛рдирдХрд╛рд░реА рджреЗрддреА рд╣реИ рдЬрд┐рд╕рдХреЗ рд╕рд╛рде рдПрдиреАрдореЗрд╢рди рдХрд╛рдо рдХрд░рддрд╛ рд╣реИред рд╣рдореЗрдВ рдЗрд╕реЗ рдХрдиреЗрдХреНрдЯ рдХрд░рдиреЗ рдХреА рдЖрд╡рд╢реНрдпрдХрддрд╛ рд╣реИ рдЬреЛ рддрддреНрд╡ рдореЗрдВ рдкрдВрдЬреАрдХреГрдд рд╣реИ
    : 
      



<script type="text/javascript" src="../libs/stats.js"></script>

,

<div id="Stats-output"></div>






, тАУ , :



function initStats() { var stats = new Stats(); stats.setMode(0); stats.domElement.style.position = 'absolute'; stats.domElement.style.left = '0px'; stats.domElement.style.top = '0px'; $("#Stats-output").append(stats.domElement ); return stats; }






. setMode



(). 0, FPS, 1, . FPS, 0. jQuery :



$(function () { var stats = initStats(); тАж }





render():

function render() { stats.update(); ... requestAnimationFrame(render); renderer.render(scene, camera); }





, , :









requestAnimationFrame



() . render



() , . :



function render() { ... cube.rotation.x += 0.02; cube.rotation.y += 0.02; cube.rotation.z += 0.02; ... requestAnimationFrame(render); renderer.render(scene, camera); }





, ? тАУ rotation



0,02 render



(), . , , .





render



() :



var step=0; function render() { ... step+=0.04; sphere.position.x = 20+( 10*(Math.cos(step))); sphere.position.y = 2 +( 10*Math.abs(Math.sin(step))); ... requestAnimationFrame(render); renderer.render(scene, camera); }





rotation



; position



. , , . . Math.cos()



Math.sin()



step



. . , step+=0.04



. :







.

, . 3D-, , , . , , . , .



dat.GUI

Google dat.GUI( ), . , , :



, dat.GUI , :



<script type="text/javascript" src="../libs/dat.gui.js"></script>





тАУ JavaScript , , , dat.GUI. JavaScript :



var controls = new function() { this.rotationSpeed = 0.02; this.bouncingSpeed = 0.03; }





: this.rotationSpeed



this.bouncingSpeed



. dat.GUI , :



var gui = new dat.GUI(); gui.add(controls, 'rotationSpeed',0,0.5); gui.add(controls, 'bouncingSpeed',0,0.5);





rotationSpeed



bouncingSpeed



0 0,5. , тАУ , render



, , dat.GUI, . :



function render() { ... cube.rotation.x += controls.rotationSpeed; cube.rotation.y += controls.rotationSpeed; cube.rotation.z += controls.rotationSpeed; step+=controls.bouncingSpeed; sphere.position.x = 20+( 10*(Math.cos(step))); sphere.position.y = 2 +( 10*Math.abs(Math.sin(step))); ... }





, , , :







.



ASCII

3D- . Three.js , , . , : ASCII . , -ASCII, . :



$("#WebGL-output").append(renderer.domElement);





:

var effect = new THREE.AsciiEffect( renderer ); effect.setSize(window.innerWidth, window.innerHeight ); $("#WebGL-output").append(effect.domElement);





. renderer.render(scene, camera), effect.render(scene,camera). :







.

, , , Three.js .





. , Three.js .

, . , Three.js.

, : GitHub
















:



<script type="text/javascript" src="../libs/stats.js"></script>






,

<div id="Stats-output"></div>






, тАУ , :



function initStats() { var stats = new Stats(); stats.setMode(0); stats.domElement.style.position = 'absolute'; stats.domElement.style.left = '0px'; stats.domElement.style.top = '0px'; $("#Stats-output").append(stats.domElement ); return stats; }






. setMode



(). 0, FPS, 1, . FPS, 0. jQuery :



$(function () { var stats = initStats(); тАж }





render():

function render() { stats.update(); ... requestAnimationFrame(render); renderer.render(scene, camera); }





, , :









requestAnimationFrame



() . render



() , . :



function render() { ... cube.rotation.x += 0.02; cube.rotation.y += 0.02; cube.rotation.z += 0.02; ... requestAnimationFrame(render); renderer.render(scene, camera); }





, ? тАУ rotation



0,02 render



(), . , , .





render



() :



var step=0; function render() { ... step+=0.04; sphere.position.x = 20+( 10*(Math.cos(step))); sphere.position.y = 2 +( 10*Math.abs(Math.sin(step))); ... requestAnimationFrame(render); renderer.render(scene, camera); }





rotation



; position



. , , . . Math.cos()



Math.sin()



step



. . , step+=0.04



. :







.

, . 3D-, , , . , , . , .



dat.GUI

Google dat.GUI( ), . , , :



, dat.GUI , :



<script type="text/javascript" src="../libs/dat.gui.js"></script>





тАУ JavaScript , , , dat.GUI. JavaScript :



var controls = new function() { this.rotationSpeed = 0.02; this.bouncingSpeed = 0.03; }





: this.rotationSpeed



this.bouncingSpeed



. dat.GUI , :



var gui = new dat.GUI(); gui.add(controls, 'rotationSpeed',0,0.5); gui.add(controls, 'bouncingSpeed',0,0.5);





rotationSpeed



bouncingSpeed



0 0,5. , тАУ , render



, , dat.GUI, . :



function render() { ... cube.rotation.x += controls.rotationSpeed; cube.rotation.y += controls.rotationSpeed; cube.rotation.z += controls.rotationSpeed; step+=controls.bouncingSpeed; sphere.position.x = 20+( 10*(Math.cos(step))); sphere.position.y = 2 +( 10*Math.abs(Math.sin(step))); ... }





, , , :







.



ASCII

3D- . Three.js , , . , : ASCII . , -ASCII, . :



$("#WebGL-output").append(renderer.domElement);





:

var effect = new THREE.AsciiEffect( renderer ); effect.setSize(window.innerWidth, window.innerHeight ); $("#WebGL-output").append(effect.domElement);





. renderer.render(scene, camera), effect.render(scene,camera). :







.

, , , Three.js .





. , Three.js .

, . , Three.js.

, : GitHub












    : 
      



<script type="text/javascript" src="../libs/stats.js"></script>






,

<div id="Stats-output"></div>

, тАУ , :



function initStats() { var stats = new Stats(); stats.setMode(0); stats.domElement.style.position = 'absolute'; stats.domElement.style.left = '0px'; stats.domElement.style.top = '0px'; $("#Stats-output").append(stats.domElement ); return stats; }






. setMode



(). 0, FPS, 1, . FPS, 0. jQuery :



$(function () { var stats = initStats(); тАж }





render():

function render() { stats.update(); ... requestAnimationFrame(render); renderer.render(scene, camera); }





, , :









requestAnimationFrame



() . render



() , . :



function render() { ... cube.rotation.x += 0.02; cube.rotation.y += 0.02; cube.rotation.z += 0.02; ... requestAnimationFrame(render); renderer.render(scene, camera); }





, ? тАУ rotation



0,02 render



(), . , , .





render



() :



var step=0; function render() { ... step+=0.04; sphere.position.x = 20+( 10*(Math.cos(step))); sphere.position.y = 2 +( 10*Math.abs(Math.sin(step))); ... requestAnimationFrame(render); renderer.render(scene, camera); }





rotation



; position



. , , . . Math.cos()



Math.sin()



step



. . , step+=0.04



. :







.

, . 3D-, , , . , , . , .



dat.GUI

Google dat.GUI( ), . , , :



, dat.GUI , :



<script type="text/javascript" src="../libs/dat.gui.js"></script>





тАУ JavaScript , , , dat.GUI. JavaScript :



var controls = new function() { this.rotationSpeed = 0.02; this.bouncingSpeed = 0.03; }





: this.rotationSpeed



this.bouncingSpeed



. dat.GUI , :



var gui = new dat.GUI(); gui.add(controls, 'rotationSpeed',0,0.5); gui.add(controls, 'bouncingSpeed',0,0.5);





rotationSpeed



bouncingSpeed



0 0,5. , тАУ , render



, , dat.GUI, . :



function render() { ... cube.rotation.x += controls.rotationSpeed; cube.rotation.y += controls.rotationSpeed; cube.rotation.z += controls.rotationSpeed; step+=controls.bouncingSpeed; sphere.position.x = 20+( 10*(Math.cos(step))); sphere.position.y = 2 +( 10*Math.abs(Math.sin(step))); ... }





, , , :







.



ASCII

3D- . Three.js , , . , : ASCII . , -ASCII, . :



$("#WebGL-output").append(renderer.domElement);





:

var effect = new THREE.AsciiEffect( renderer ); effect.setSize(window.innerWidth, window.innerHeight ); $("#WebGL-output").append(effect.domElement);





. renderer.render(scene, camera), effect.render(scene,camera). :







.

, , , Three.js .





. , Three.js .

, . , Three.js.

, : GitHub
















:



<script type="text/javascript" src="../libs/stats.js"></script>






,

<div id="Stats-output"></div>






, тАУ , :



function initStats() { var stats = new Stats(); stats.setMode(0); stats.domElement.style.position = 'absolute'; stats.domElement.style.left = '0px'; stats.domElement.style.top = '0px'; $("#Stats-output").append(stats.domElement ); return stats; }






. setMode



(). 0, FPS, 1, . FPS, 0. jQuery :



$(function () { var stats = initStats(); тАж }





render():

function render() { stats.update(); ... requestAnimationFrame(render); renderer.render(scene, camera); }





, , :









requestAnimationFrame



() . render



() , . :



function render() { ... cube.rotation.x += 0.02; cube.rotation.y += 0.02; cube.rotation.z += 0.02; ... requestAnimationFrame(render); renderer.render(scene, camera); }





, ? тАУ rotation



0,02 render



(), . , , .





render



() :



var step=0; function render() { ... step+=0.04; sphere.position.x = 20+( 10*(Math.cos(step))); sphere.position.y = 2 +( 10*Math.abs(Math.sin(step))); ... requestAnimationFrame(render); renderer.render(scene, camera); }





rotation



; position



. , , . . Math.cos()



Math.sin()



step



. . , step+=0.04



. :







.

, . 3D-, , , . , , . , .



dat.GUI

Google dat.GUI( ), . , , :



, dat.GUI , :



<script type="text/javascript" src="../libs/dat.gui.js"></script>





тАУ JavaScript , , , dat.GUI. JavaScript :



var controls = new function() { this.rotationSpeed = 0.02; this.bouncingSpeed = 0.03; }





: this.rotationSpeed



this.bouncingSpeed



. dat.GUI , :



var gui = new dat.GUI(); gui.add(controls, 'rotationSpeed',0,0.5); gui.add(controls, 'bouncingSpeed',0,0.5);





rotationSpeed



bouncingSpeed



0 0,5. , тАУ , render



, , dat.GUI, . :



function render() { ... cube.rotation.x += controls.rotationSpeed; cube.rotation.y += controls.rotationSpeed; cube.rotation.z += controls.rotationSpeed; step+=controls.bouncingSpeed; sphere.position.x = 20+( 10*(Math.cos(step))); sphere.position.y = 2 +( 10*Math.abs(Math.sin(step))); ... }





, , , :







.



ASCII

3D- . Three.js , , . , : ASCII . , -ASCII, . :



$("#WebGL-output").append(renderer.domElement);





:

var effect = new THREE.AsciiEffect( renderer ); effect.setSize(window.innerWidth, window.innerHeight ); $("#WebGL-output").append(effect.domElement);





. renderer.render(scene, camera), effect.render(scene,camera). :







.

, , , Three.js .





. , Three.js .

, . , Three.js.

, : GitHub












    : 
      



<script type="text/javascript" src="../libs/stats.js"></script>






,

<div id="Stats-output"></div>






, тАУ , :



function initStats() { var stats = new Stats(); stats.setMode(0); stats.domElement.style.position = 'absolute'; stats.domElement.style.left = '0px'; stats.domElement.style.top = '0px'; $("#Stats-output").append(stats.domElement ); return stats; }






. setMode



(). 0, FPS, 1, . FPS, 0. jQuery :



$(function () { var stats = initStats(); тАж }





render():

function render() { stats.update(); ... requestAnimationFrame(render); renderer.render(scene, camera); }





, , :









requestAnimationFrame



() . render



() , . :



function render() { ... cube.rotation.x += 0.02; cube.rotation.y += 0.02; cube.rotation.z += 0.02; ... requestAnimationFrame(render); renderer.render(scene, camera); }





, ? тАУ rotation



0,02 render



(), . , , .





render



() :



var step=0; function render() { ... step+=0.04; sphere.position.x = 20+( 10*(Math.cos(step))); sphere.position.y = 2 +( 10*Math.abs(Math.sin(step))); ... requestAnimationFrame(render); renderer.render(scene, camera); }





rotation



; position



. , , . . Math.cos()



Math.sin()



step



. . , step+=0.04



. :







.

, . 3D-, , , . , , . , .



dat.GUI

Google dat.GUI( ), . , , :



, dat.GUI , :



<script type="text/javascript" src="../libs/dat.gui.js"></script>





тАУ JavaScript , , , dat.GUI. JavaScript :



var controls = new function() { this.rotationSpeed = 0.02; this.bouncingSpeed = 0.03; }





: this.rotationSpeed



this.bouncingSpeed



. dat.GUI , :



var gui = new dat.GUI(); gui.add(controls, 'rotationSpeed',0,0.5); gui.add(controls, 'bouncingSpeed',0,0.5);





rotationSpeed



bouncingSpeed



0 0,5. , тАУ , render



, , dat.GUI, . :



function render() { ... cube.rotation.x += controls.rotationSpeed; cube.rotation.y += controls.rotationSpeed; cube.rotation.z += controls.rotationSpeed; step+=controls.bouncingSpeed; sphere.position.x = 20+( 10*(Math.cos(step))); sphere.position.y = 2 +( 10*Math.abs(Math.sin(step))); ... }





, , , :







.



ASCII

3D- . Three.js , , . , : ASCII . , -ASCII, . :



$("#WebGL-output").append(renderer.domElement);





:

var effect = new THREE.AsciiEffect( renderer ); effect.setSize(window.innerWidth, window.innerHeight ); $("#WebGL-output").append(effect.domElement);





. renderer.render(scene, camera), effect.render(scene,camera). :







.

, , , Three.js .





. , Three.js .

, . , Three.js.

, : GitHub












:



<script type="text/javascript" src="../libs/stats.js"></script>






,

<div id="Stats-output"></div>






, тАУ , :



function initStats() { var stats = new Stats(); stats.setMode(0); stats.domElement.style.position = 'absolute'; stats.domElement.style.left = '0px'; stats.domElement.style.top = '0px'; $("#Stats-output").append(stats.domElement ); return stats; }






. setMode



(). 0, FPS, 1, . FPS, 0. jQuery :



$(function () { var stats = initStats(); тАж }





render():

function render() { stats.update(); ... requestAnimationFrame(render); renderer.render(scene, camera); }





, , :









requestAnimationFrame



() . render



() , . :



function render() { ... cube.rotation.x += 0.02; cube.rotation.y += 0.02; cube.rotation.z += 0.02; ... requestAnimationFrame(render); renderer.render(scene, camera); }





, ? тАУ rotation



0,02 render



(), . , , .





render



() :



var step=0; function render() { ... step+=0.04; sphere.position.x = 20+( 10*(Math.cos(step))); sphere.position.y = 2 +( 10*Math.abs(Math.sin(step))); ... requestAnimationFrame(render); renderer.render(scene, camera); }





rotation



; position



. , , . . Math.cos()



Math.sin()



step



. . , step+=0.04



. :







.

, . 3D-, , , . , , . , .



dat.GUI

Google dat.GUI( ), . , , :



, dat.GUI , :



<script type="text/javascript" src="../libs/dat.gui.js"></script>





тАУ JavaScript , , , dat.GUI. JavaScript :



var controls = new function() { this.rotationSpeed = 0.02; this.bouncingSpeed = 0.03; }





: this.rotationSpeed



this.bouncingSpeed



. dat.GUI , :



var gui = new dat.GUI(); gui.add(controls, 'rotationSpeed',0,0.5); gui.add(controls, 'bouncingSpeed',0,0.5);





rotationSpeed



bouncingSpeed



0 0,5. , тАУ , render



, , dat.GUI, . :



function render() { ... cube.rotation.x += controls.rotationSpeed; cube.rotation.y += controls.rotationSpeed; cube.rotation.z += controls.rotationSpeed; step+=controls.bouncingSpeed; sphere.position.x = 20+( 10*(Math.cos(step))); sphere.position.y = 2 +( 10*Math.abs(Math.sin(step))); ... }





, , , :







.



ASCII

3D- . Three.js , , . , : ASCII . , -ASCII, . :



$("#WebGL-output").append(renderer.domElement);





:

var effect = new THREE.AsciiEffect( renderer ); effect.setSize(window.innerWidth, window.innerHeight ); $("#WebGL-output").append(effect.domElement);





. renderer.render(scene, camera), effect.render(scene,camera). :







.

, , , Three.js .





. , Three.js .

, . , Three.js.

, : GitHub












    : 
      



<script type="text/javascript" src="../libs/stats.js"></script>






,

<div id="Stats-output"></div>






, тАУ , :



function initStats() { var stats = new Stats(); stats.setMode(0); stats.domElement.style.position = 'absolute'; stats.domElement.style.left = '0px'; stats.domElement.style.top = '0px'; $("#Stats-output").append(stats.domElement ); return stats; }






. setMode



(). 0, FPS, 1, . FPS, 0. jQuery :



$(function () { var stats = initStats(); тАж }





render():

function render() { stats.update(); ... requestAnimationFrame(render); renderer.render(scene, camera); }





, , :









requestAnimationFrame



() . render



() , . :



function render() { ... cube.rotation.x += 0.02; cube.rotation.y += 0.02; cube.rotation.z += 0.02; ... requestAnimationFrame(render); renderer.render(scene, camera); }





, ? тАУ rotation



0,02 render



(), . , , .





render



() :



var step=0; function render() { ... step+=0.04; sphere.position.x = 20+( 10*(Math.cos(step))); sphere.position.y = 2 +( 10*Math.abs(Math.sin(step))); ... requestAnimationFrame(render); renderer.render(scene, camera); }





rotation



; position



. , , . . Math.cos()



Math.sin()



step



. . , step+=0.04



. :







.

, . 3D-, , , . , , . , .



dat.GUI

Google dat.GUI( ), . , , :



, dat.GUI , :



<script type="text/javascript" src="../libs/dat.gui.js"></script>





тАУ JavaScript , , , dat.GUI. JavaScript :



var controls = new function() { this.rotationSpeed = 0.02; this.bouncingSpeed = 0.03; }





: this.rotationSpeed



this.bouncingSpeed



. dat.GUI , :



var gui = new dat.GUI(); gui.add(controls, 'rotationSpeed',0,0.5); gui.add(controls, 'bouncingSpeed',0,0.5);





rotationSpeed



bouncingSpeed



0 0,5. , тАУ , render



, , dat.GUI, . :



function render() { ... cube.rotation.x += controls.rotationSpeed; cube.rotation.y += controls.rotationSpeed; cube.rotation.z += controls.rotationSpeed; step+=controls.bouncingSpeed; sphere.position.x = 20+( 10*(Math.cos(step))); sphere.position.y = 2 +( 10*Math.abs(Math.sin(step))); ... }





, , , :







.



ASCII

3D- . Three.js , , . , : ASCII . , -ASCII, . :



$("#WebGL-output").append(renderer.domElement);





:

var effect = new THREE.AsciiEffect( renderer ); effect.setSize(window.innerWidth, window.innerHeight ); $("#WebGL-output").append(effect.domElement);





. renderer.render(scene, camera), effect.render(scene,camera). :







.

, , , Three.js .





. , Three.js .

, . , Three.js.

, : GitHub












:



<script type="text/javascript" src="../libs/stats.js"></script>






,

<div id="Stats-output"></div>






, тАУ , :



function initStats() { var stats = new Stats(); stats.setMode(0); stats.domElement.style.position = 'absolute'; stats.domElement.style.left = '0px'; stats.domElement.style.top = '0px'; $("#Stats-output").append(stats.domElement ); return stats; }






. setMode



(). 0, FPS, 1, . FPS, 0. jQuery :



$(function () { var stats = initStats(); тАж }





render():

function render() { stats.update(); ... requestAnimationFrame(render); renderer.render(scene, camera); }





, , :









requestAnimationFrame



() . render



() , . :



function render() { ... cube.rotation.x += 0.02; cube.rotation.y += 0.02; cube.rotation.z += 0.02; ... requestAnimationFrame(render); renderer.render(scene, camera); }





, ? тАУ rotation



0,02 render



(), . , , .





render



() :



var step=0; function render() { ... step+=0.04; sphere.position.x = 20+( 10*(Math.cos(step))); sphere.position.y = 2 +( 10*Math.abs(Math.sin(step))); ... requestAnimationFrame(render); renderer.render(scene, camera); }





rotation



; position



. , , . . Math.cos()



Math.sin()



step



. . , step+=0.04



. :







.

, . 3D-, , , . , , . , .



dat.GUI

Google dat.GUI( ), . , , :



, dat.GUI , :



<script type="text/javascript" src="../libs/dat.gui.js"></script>





тАУ JavaScript , , , dat.GUI. JavaScript :



var controls = new function() { this.rotationSpeed = 0.02; this.bouncingSpeed = 0.03; }





: this.rotationSpeed



this.bouncingSpeed



. dat.GUI , :



var gui = new dat.GUI(); gui.add(controls, 'rotationSpeed',0,0.5); gui.add(controls, 'bouncingSpeed',0,0.5);





rotationSpeed



bouncingSpeed



0 0,5. , тАУ , render



, , dat.GUI, . :



function render() { ... cube.rotation.x += controls.rotationSpeed; cube.rotation.y += controls.rotationSpeed; cube.rotation.z += controls.rotationSpeed; step+=controls.bouncingSpeed; sphere.position.x = 20+( 10*(Math.cos(step))); sphere.position.y = 2 +( 10*Math.abs(Math.sin(step))); ... }





, , , :







.



ASCII

3D- . Three.js , , . , : ASCII . , -ASCII, . :



$("#WebGL-output").append(renderer.domElement);





:

var effect = new THREE.AsciiEffect( renderer ); effect.setSize(window.innerWidth, window.innerHeight ); $("#WebGL-output").append(effect.domElement);





. renderer.render(scene, camera), effect.render(scene,camera). :







.

, , , Three.js .





. , Three.js .

, . , Three.js.

, : GitHub












    : 
      



<script type="text/javascript" src="../libs/stats.js"></script>






,

<div id="Stats-output"></div>






, тАУ , :



function initStats() { var stats = new Stats(); stats.setMode(0); stats.domElement.style.position = 'absolute'; stats.domElement.style.left = '0px'; stats.domElement.style.top = '0px'; $("#Stats-output").append(stats.domElement ); return stats; }






. setMode



(). 0, FPS, 1, . FPS, 0. jQuery :



$(function () { var stats = initStats(); тАж }





render():

function render() { stats.update(); ... requestAnimationFrame(render); renderer.render(scene, camera); }





, , :









requestAnimationFrame



() . render



() , . :



function render() { ... cube.rotation.x += 0.02; cube.rotation.y += 0.02; cube.rotation.z += 0.02; ... requestAnimationFrame(render); renderer.render(scene, camera); }





, ? тАУ rotation



0,02 render



(), . , , .





render



() :



var step=0; function render() { ... step+=0.04; sphere.position.x = 20+( 10*(Math.cos(step))); sphere.position.y = 2 +( 10*Math.abs(Math.sin(step))); ... requestAnimationFrame(render); renderer.render(scene, camera); }





rotation



; position



. , , . . Math.cos()



Math.sin()



step



. . , step+=0.04



. :







.

, . 3D-, , , . , , . , .



dat.GUI

Google dat.GUI( ), . , , :



, dat.GUI , :



<script type="text/javascript" src="../libs/dat.gui.js"></script>





тАУ JavaScript , , , dat.GUI. JavaScript :



var controls = new function() { this.rotationSpeed = 0.02; this.bouncingSpeed = 0.03; }





: this.rotationSpeed



this.bouncingSpeed



. dat.GUI , :



var gui = new dat.GUI(); gui.add(controls, 'rotationSpeed',0,0.5); gui.add(controls, 'bouncingSpeed',0,0.5);





rotationSpeed



bouncingSpeed



0 0,5. , тАУ , render



, , dat.GUI, . :



function render() { ... cube.rotation.x += controls.rotationSpeed; cube.rotation.y += controls.rotationSpeed; cube.rotation.z += controls.rotationSpeed; step+=controls.bouncingSpeed; sphere.position.x = 20+( 10*(Math.cos(step))); sphere.position.y = 2 +( 10*Math.abs(Math.sin(step))); ... }





, , , :







.



ASCII

3D- . Three.js , , . , : ASCII . , -ASCII, . :



$("#WebGL-output").append(renderer.domElement);





:

var effect = new THREE.AsciiEffect( renderer ); effect.setSize(window.innerWidth, window.innerHeight ); $("#WebGL-output").append(effect.domElement);





. renderer.render(scene, camera), effect.render(scene,camera). :







.

, , , Three.js .





. , Three.js .

, . , Three.js.

, : GitHub












:



<script type="text/javascript" src="../libs/stats.js"></script>






,

<div id="Stats-output"></div>






, тАУ , :



function initStats() { var stats = new Stats(); stats.setMode(0); stats.domElement.style.position = 'absolute'; stats.domElement.style.left = '0px'; stats.domElement.style.top = '0px'; $("#Stats-output").append(stats.domElement ); return stats; }






. setMode



(). 0, FPS, 1, . FPS, 0. jQuery :



$(function () { var stats = initStats(); тАж }





render():

function render() { stats.update(); ... requestAnimationFrame(render); renderer.render(scene, camera); }





, , :









requestAnimationFrame



() . render



() , . :



function render() { ... cube.rotation.x += 0.02; cube.rotation.y += 0.02; cube.rotation.z += 0.02; ... requestAnimationFrame(render); renderer.render(scene, camera); }





, ? тАУ rotation



0,02 render



(), . , , .





render



() :



var step=0; function render() { ... step+=0.04; sphere.position.x = 20+( 10*(Math.cos(step))); sphere.position.y = 2 +( 10*Math.abs(Math.sin(step))); ... requestAnimationFrame(render); renderer.render(scene, camera); }





rotation



; position



. , , . . Math.cos()



Math.sin()



step



. . , step+=0.04



. :







.

, . 3D-, , , . , , . , .



dat.GUI

Google dat.GUI( ), . , , :



, dat.GUI , :



<script type="text/javascript" src="../libs/dat.gui.js"></script>





тАУ JavaScript , , , dat.GUI. JavaScript :



var controls = new function() { this.rotationSpeed = 0.02; this.bouncingSpeed = 0.03; }





: this.rotationSpeed



this.bouncingSpeed



. dat.GUI , :



var gui = new dat.GUI(); gui.add(controls, 'rotationSpeed',0,0.5); gui.add(controls, 'bouncingSpeed',0,0.5);





rotationSpeed



bouncingSpeed



0 0,5. , тАУ , render



, , dat.GUI, . :



function render() { ... cube.rotation.x += controls.rotationSpeed; cube.rotation.y += controls.rotationSpeed; cube.rotation.z += controls.rotationSpeed; step+=controls.bouncingSpeed; sphere.position.x = 20+( 10*(Math.cos(step))); sphere.position.y = 2 +( 10*Math.abs(Math.sin(step))); ... }





, , , :







.



ASCII

3D- . Three.js , , . , : ASCII . , -ASCII, . :



$("#WebGL-output").append(renderer.domElement);





:

var effect = new THREE.AsciiEffect( renderer ); effect.setSize(window.innerWidth, window.innerHeight ); $("#WebGL-output").append(effect.domElement);





. renderer.render(scene, camera), effect.render(scene,camera). :







.

, , , Three.js .





. , Three.js .

, . , Three.js.

, : GitHub












:



<script type="text/javascript" src="../libs/stats.js"></script>






,

<div id="Stats-output"></div>






, тАУ , :



function initStats() { var stats = new Stats(); stats.setMode(0); stats.domElement.style.position = 'absolute'; stats.domElement.style.left = '0px'; stats.domElement.style.top = '0px'; $("#Stats-output").append(stats.domElement ); return stats; }






. setMode



(). 0, FPS, 1, . FPS, 0. jQuery :



$(function () { var stats = initStats(); тАж }





render():

function render() { stats.update(); ... requestAnimationFrame(render); renderer.render(scene, camera); }





, , :









requestAnimationFrame



() . render



() , . :



function render() { ... cube.rotation.x += 0.02; cube.rotation.y += 0.02; cube.rotation.z += 0.02; ... requestAnimationFrame(render); renderer.render(scene, camera); }





, ? тАУ rotation



0,02 render



(), . , , .





render



() :



var step=0; function render() { ... step+=0.04; sphere.position.x = 20+( 10*(Math.cos(step))); sphere.position.y = 2 +( 10*Math.abs(Math.sin(step))); ... requestAnimationFrame(render); renderer.render(scene, camera); }





rotation



; position



. , , . . Math.cos()



Math.sin()



step



. . , step+=0.04



. :







.

, . 3D-, , , . , , . , .



dat.GUI

Google dat.GUI( ), . , , :



, dat.GUI , :



<script type="text/javascript" src="../libs/dat.gui.js"></script>





тАУ JavaScript , , , dat.GUI. JavaScript :



var controls = new function() { this.rotationSpeed = 0.02; this.bouncingSpeed = 0.03; }





: this.rotationSpeed



this.bouncingSpeed



. dat.GUI , :



var gui = new dat.GUI(); gui.add(controls, 'rotationSpeed',0,0.5); gui.add(controls, 'bouncingSpeed',0,0.5);





rotationSpeed



bouncingSpeed



0 0,5. , тАУ , render



, , dat.GUI, . :



function render() { ... cube.rotation.x += controls.rotationSpeed; cube.rotation.y += controls.rotationSpeed; cube.rotation.z += controls.rotationSpeed; step+=controls.bouncingSpeed; sphere.position.x = 20+( 10*(Math.cos(step))); sphere.position.y = 2 +( 10*Math.abs(Math.sin(step))); ... }





, , , :







.



ASCII

3D- . Three.js , , . , : ASCII . , -ASCII, . :



$("#WebGL-output").append(renderer.domElement);





:

var effect = new THREE.AsciiEffect( renderer ); effect.setSize(window.innerWidth, window.innerHeight ); $("#WebGL-output").append(effect.domElement);





. renderer.render(scene, camera), effect.render(scene,camera). :







.

, , , Three.js .





. , Three.js .

, . , Three.js.

, : GitHub












:



<script type="text/javascript" src="../libs/stats.js"></script>






,

<div id="Stats-output"></div>






, тАУ , :



function initStats() { var stats = new Stats(); stats.setMode(0); stats.domElement.style.position = 'absolute'; stats.domElement.style.left = '0px'; stats.domElement.style.top = '0px'; $("#Stats-output").append(stats.domElement ); return stats; }






. setMode



(). 0, FPS, 1, . FPS, 0. jQuery :



$(function () { var stats = initStats(); тАж }





render():

function render() { stats.update(); ... requestAnimationFrame(render); renderer.render(scene, camera); }





, , :









requestAnimationFrame



() . render



() , . :



function render() { ... cube.rotation.x += 0.02; cube.rotation.y += 0.02; cube.rotation.z += 0.02; ... requestAnimationFrame(render); renderer.render(scene, camera); }





, ? тАУ rotation



0,02 render



(), . , , .





render



() :



var step=0; function render() { ... step+=0.04; sphere.position.x = 20+( 10*(Math.cos(step))); sphere.position.y = 2 +( 10*Math.abs(Math.sin(step))); ... requestAnimationFrame(render); renderer.render(scene, camera); }





rotation



; position



. , , . . Math.cos()



Math.sin()



step



. . , step+=0.04



. :







.

, . 3D-, , , . , , . , .



dat.GUI

Google dat.GUI( ), . , , :



, dat.GUI , :



<script type="text/javascript" src="../libs/dat.gui.js"></script>





тАУ JavaScript , , , dat.GUI. JavaScript :



var controls = new function() { this.rotationSpeed = 0.02; this.bouncingSpeed = 0.03; }





: this.rotationSpeed



this.bouncingSpeed



. dat.GUI , :



var gui = new dat.GUI(); gui.add(controls, 'rotationSpeed',0,0.5); gui.add(controls, 'bouncingSpeed',0,0.5);





rotationSpeed



bouncingSpeed



0 0,5. , тАУ , render



, , dat.GUI, . :



function render() { ... cube.rotation.x += controls.rotationSpeed; cube.rotation.y += controls.rotationSpeed; cube.rotation.z += controls.rotationSpeed; step+=controls.bouncingSpeed; sphere.position.x = 20+( 10*(Math.cos(step))); sphere.position.y = 2 +( 10*Math.abs(Math.sin(step))); ... }





, , , :







.



ASCII

3D- . Three.js , , . , : ASCII . , -ASCII, . :



$("#WebGL-output").append(renderer.domElement);





:

var effect = new THREE.AsciiEffect( renderer ); effect.setSize(window.innerWidth, window.innerHeight ); $("#WebGL-output").append(effect.domElement);





. renderer.render(scene, camera), effect.render(scene,camera). :







.

, , , Three.js .





. , Three.js .

, . , Three.js.

, : GitHub












    : 
      



<script type="text/javascript" src="../libs/stats.js"></script>






,

<div id="Stats-output"></div>






, тАУ , :



function initStats() { var stats = new Stats(); stats.setMode(0); stats.domElement.style.position = 'absolute'; stats.domElement.style.left = '0px'; stats.domElement.style.top = '0px'; $("#Stats-output").append(stats.domElement ); return stats; }






. setMode



(). 0, FPS, 1, . FPS, 0. jQuery :



$(function () { var stats = initStats(); тАж }





render():

function render() { stats.update(); ... requestAnimationFrame(render); renderer.render(scene, camera); }





, , :









requestAnimationFrame



() . render



() , . :



function render() { ... cube.rotation.x += 0.02; cube.rotation.y += 0.02; cube.rotation.z += 0.02; ... requestAnimationFrame(render); renderer.render(scene, camera); }





, ? тАУ rotation



0,02 render



(), . , , .





render



() :



var step=0; function render() { ... step+=0.04; sphere.position.x = 20+( 10*(Math.cos(step))); sphere.position.y = 2 +( 10*Math.abs(Math.sin(step))); ... requestAnimationFrame(render); renderer.render(scene, camera); }





rotation



; position



. , , . . Math.cos()



Math.sin()



step



. . , step+=0.04



. :







.

, . 3D-, , , . , , . , .



dat.GUI

Google dat.GUI( ), . , , :



, dat.GUI , :



<script type="text/javascript" src="../libs/dat.gui.js"></script>





тАУ JavaScript , , , dat.GUI. JavaScript :



var controls = new function() { this.rotationSpeed = 0.02; this.bouncingSpeed = 0.03; }





: this.rotationSpeed



this.bouncingSpeed



. dat.GUI , :



var gui = new dat.GUI(); gui.add(controls, 'rotationSpeed',0,0.5); gui.add(controls, 'bouncingSpeed',0,0.5);





rotationSpeed



bouncingSpeed



0 0,5. , тАУ , render



, , dat.GUI, . :



function render() { ... cube.rotation.x += controls.rotationSpeed; cube.rotation.y += controls.rotationSpeed; cube.rotation.z += controls.rotationSpeed; step+=controls.bouncingSpeed; sphere.position.x = 20+( 10*(Math.cos(step))); sphere.position.y = 2 +( 10*Math.abs(Math.sin(step))); ... }





, , , :







.



ASCII

3D- . Three.js , , . , : ASCII . , -ASCII, . :



$("#WebGL-output").append(renderer.domElement);





:

var effect = new THREE.AsciiEffect( renderer ); effect.setSize(window.innerWidth, window.innerHeight ); $("#WebGL-output").append(effect.domElement);





. renderer.render(scene, camera), effect.render(scene,camera). :







.

, , , Three.js .





. , Three.js .

, . , Three.js.

, : GitHub












:



<script type="text/javascript" src="../libs/stats.js"></script>






,

<div id="Stats-output"></div>






, тАУ , :



function initStats() { var stats = new Stats(); stats.setMode(0); stats.domElement.style.position = 'absolute'; stats.domElement.style.left = '0px'; stats.domElement.style.top = '0px'; $("#Stats-output").append(stats.domElement ); return stats; }






. setMode



(). 0, FPS, 1, . FPS, 0. jQuery :



$(function () { var stats = initStats(); тАж }





render():

function render() { stats.update(); ... requestAnimationFrame(render); renderer.render(scene, camera); }





, , :









requestAnimationFrame



() . render



() , . :



function render() { ... cube.rotation.x += 0.02; cube.rotation.y += 0.02; cube.rotation.z += 0.02; ... requestAnimationFrame(render); renderer.render(scene, camera); }





, ? тАУ rotation



0,02 render



(), . , , .





render



() :



var step=0; function render() { ... step+=0.04; sphere.position.x = 20+( 10*(Math.cos(step))); sphere.position.y = 2 +( 10*Math.abs(Math.sin(step))); ... requestAnimationFrame(render); renderer.render(scene, camera); }





rotation



; position



. , , . . Math.cos()



Math.sin()



step



. . , step+=0.04



. :







.

, . 3D-, , , . , , . , .



dat.GUI

Google dat.GUI( ), . , , :



, dat.GUI , :



<script type="text/javascript" src="../libs/dat.gui.js"></script>





тАУ JavaScript , , , dat.GUI. JavaScript :



var controls = new function() { this.rotationSpeed = 0.02; this.bouncingSpeed = 0.03; }





: this.rotationSpeed



this.bouncingSpeed



. dat.GUI , :



var gui = new dat.GUI(); gui.add(controls, 'rotationSpeed',0,0.5); gui.add(controls, 'bouncingSpeed',0,0.5);





rotationSpeed



bouncingSpeed



0 0,5. , тАУ , render



, , dat.GUI, . :



function render() { ... cube.rotation.x += controls.rotationSpeed; cube.rotation.y += controls.rotationSpeed; cube.rotation.z += controls.rotationSpeed; step+=controls.bouncingSpeed; sphere.position.x = 20+( 10*(Math.cos(step))); sphere.position.y = 2 +( 10*Math.abs(Math.sin(step))); ... }





, , , :







.



ASCII

3D- . Three.js , , . , : ASCII . , -ASCII, . :



$("#WebGL-output").append(renderer.domElement);





:

var effect = new THREE.AsciiEffect( renderer ); effect.setSize(window.innerWidth, window.innerHeight ); $("#WebGL-output").append(effect.domElement);





. renderer.render(scene, camera), effect.render(scene,camera). :







.

, , , Three.js .





. , Three.js .

, . , Three.js.

, : GitHub












:



<script type="text/javascript" src="../libs/stats.js"></script>






,

<div id="Stats-output"></div>






, тАУ , :



function initStats() { var stats = new Stats(); stats.setMode(0); stats.domElement.style.position = 'absolute'; stats.domElement.style.left = '0px'; stats.domElement.style.top = '0px'; $("#Stats-output").append(stats.domElement ); return stats; }






. setMode



(). 0, FPS, 1, . FPS, 0. jQuery :



$(function () { var stats = initStats(); тАж }





render():

function render() { stats.update(); ... requestAnimationFrame(render); renderer.render(scene, camera); }





, , :









requestAnimationFrame



() . render



() , . :



function render() { ... cube.rotation.x += 0.02; cube.rotation.y += 0.02; cube.rotation.z += 0.02; ... requestAnimationFrame(render); renderer.render(scene, camera); }





, ? тАУ rotation



0,02 render



(), . , , .





render



() :



var step=0; function render() { ... step+=0.04; sphere.position.x = 20+( 10*(Math.cos(step))); sphere.position.y = 2 +( 10*Math.abs(Math.sin(step))); ... requestAnimationFrame(render); renderer.render(scene, camera); }





rotation



; position



. , , . . Math.cos()



Math.sin()



step



. . , step+=0.04



. :







.

, . 3D-, , , . , , . , .



dat.GUI

Google dat.GUI( ), . , , :



, dat.GUI , :



<script type="text/javascript" src="../libs/dat.gui.js"></script>





тАУ JavaScript , , , dat.GUI. JavaScript :



var controls = new function() { this.rotationSpeed = 0.02; this.bouncingSpeed = 0.03; }





: this.rotationSpeed



this.bouncingSpeed



. dat.GUI , :



var gui = new dat.GUI(); gui.add(controls, 'rotationSpeed',0,0.5); gui.add(controls, 'bouncingSpeed',0,0.5);





rotationSpeed



bouncingSpeed



0 0,5. , тАУ , render



, , dat.GUI, . :



function render() { ... cube.rotation.x += controls.rotationSpeed; cube.rotation.y += controls.rotationSpeed; cube.rotation.z += controls.rotationSpeed; step+=controls.bouncingSpeed; sphere.position.x = 20+( 10*(Math.cos(step))); sphere.position.y = 2 +( 10*Math.abs(Math.sin(step))); ... }





, , , :







.



ASCII

3D- . Three.js , , . , : ASCII . , -ASCII, . :



$("#WebGL-output").append(renderer.domElement);





:

var effect = new THREE.AsciiEffect( renderer ); effect.setSize(window.innerWidth, window.innerHeight ); $("#WebGL-output").append(effect.domElement);





. renderer.render(scene, camera), effect.render(scene,camera). :







.

, , , Three.js .





. , Three.js .

, . , Three.js.

, : GitHub












:



<script type="text/javascript" src="../libs/stats.js"></script>






,

<div id="Stats-output"></div>






, тАУ , :



function initStats() { var stats = new Stats(); stats.setMode(0); stats.domElement.style.position = 'absolute'; stats.domElement.style.left = '0px'; stats.domElement.style.top = '0px'; $("#Stats-output").append(stats.domElement ); return stats; }






. setMode



(). 0, FPS, 1, . FPS, 0. jQuery :



$(function () { var stats = initStats(); тАж }





render():

function render() { stats.update(); ... requestAnimationFrame(render); renderer.render(scene, camera); }





, , :









requestAnimationFrame



() . render



() , . :



function render() { ... cube.rotation.x += 0.02; cube.rotation.y += 0.02; cube.rotation.z += 0.02; ... requestAnimationFrame(render); renderer.render(scene, camera); }





, ? тАУ rotation



0,02 render



(), . , , .





render



() :



var step=0; function render() { ... step+=0.04; sphere.position.x = 20+( 10*(Math.cos(step))); sphere.position.y = 2 +( 10*Math.abs(Math.sin(step))); ... requestAnimationFrame(render); renderer.render(scene, camera); }





rotation



; position



. , , . . Math.cos()



Math.sin()



step



. . , step+=0.04



. :







.

, . 3D-, , , . , , . , .



dat.GUI

Google dat.GUI( ), . , , :



, dat.GUI , :



<script type="text/javascript" src="../libs/dat.gui.js"></script>





тАУ JavaScript , , , dat.GUI. JavaScript :



var controls = new function() { this.rotationSpeed = 0.02; this.bouncingSpeed = 0.03; }





: this.rotationSpeed



this.bouncingSpeed



. dat.GUI , :



var gui = new dat.GUI(); gui.add(controls, 'rotationSpeed',0,0.5); gui.add(controls, 'bouncingSpeed',0,0.5);





rotationSpeed



bouncingSpeed



0 0,5. , тАУ , render



, , dat.GUI, . :



function render() { ... cube.rotation.x += controls.rotationSpeed; cube.rotation.y += controls.rotationSpeed; cube.rotation.z += controls.rotationSpeed; step+=controls.bouncingSpeed; sphere.position.x = 20+( 10*(Math.cos(step))); sphere.position.y = 2 +( 10*Math.abs(Math.sin(step))); ... }





, , , :







.



ASCII

3D- . Three.js , , . , : ASCII . , -ASCII, . :



$("#WebGL-output").append(renderer.domElement);





:

var effect = new THREE.AsciiEffect( renderer ); effect.setSize(window.innerWidth, window.innerHeight ); $("#WebGL-output").append(effect.domElement);





. renderer.render(scene, camera), effect.render(scene,camera). :







.

, , , Three.js .





. , Three.js .

, . , Three.js.

, : GitHub












    : 
      



<script type="text/javascript" src="../libs/stats.js"></script>






,

<div id="Stats-output"></div>






, тАУ , :



function initStats() { var stats = new Stats(); stats.setMode(0); stats.domElement.style.position = 'absolute'; stats.domElement.style.left = '0px'; stats.domElement.style.top = '0px'; $("#Stats-output").append(stats.domElement ); return stats; }






. setMode



(). 0, FPS, 1, . FPS, 0. jQuery :



$(function () { var stats = initStats(); тАж }





render():

function render() { stats.update(); ... requestAnimationFrame(render); renderer.render(scene, camera); }





, , :









requestAnimationFrame



() . render



() , . :



function render() { ... cube.rotation.x += 0.02; cube.rotation.y += 0.02; cube.rotation.z += 0.02; ... requestAnimationFrame(render); renderer.render(scene, camera); }





, ? тАУ rotation



0,02 render



(), . , , .





render



() :



var step=0; function render() { ... step+=0.04; sphere.position.x = 20+( 10*(Math.cos(step))); sphere.position.y = 2 +( 10*Math.abs(Math.sin(step))); ... requestAnimationFrame(render); renderer.render(scene, camera); }





rotation



; position



. , , . . Math.cos()



Math.sin()



step



. . , step+=0.04



. :







.

, . 3D-, , , . , , . , .



dat.GUI

Google dat.GUI( ), . , , :



, dat.GUI , :



<script type="text/javascript" src="../libs/dat.gui.js"></script>





тАУ JavaScript , , , dat.GUI. JavaScript :



var controls = new function() { this.rotationSpeed = 0.02; this.bouncingSpeed = 0.03; }





: this.rotationSpeed



this.bouncingSpeed



. dat.GUI , :



var gui = new dat.GUI(); gui.add(controls, 'rotationSpeed',0,0.5); gui.add(controls, 'bouncingSpeed',0,0.5);





rotationSpeed



bouncingSpeed



0 0,5. , тАУ , render



, , dat.GUI, . :



function render() { ... cube.rotation.x += controls.rotationSpeed; cube.rotation.y += controls.rotationSpeed; cube.rotation.z += controls.rotationSpeed; step+=controls.bouncingSpeed; sphere.position.x = 20+( 10*(Math.cos(step))); sphere.position.y = 2 +( 10*Math.abs(Math.sin(step))); ... }





, , , :







.



ASCII

3D- . Three.js , , . , : ASCII . , -ASCII, . :



$("#WebGL-output").append(renderer.domElement);





:

var effect = new THREE.AsciiEffect( renderer ); effect.setSize(window.innerWidth, window.innerHeight ); $("#WebGL-output").append(effect.domElement);





. renderer.render(scene, camera), effect.render(scene,camera). :







.

, , , Three.js .





. , Three.js .

, . , Three.js.

, : GitHub












:



<script type="text/javascript" src="../libs/stats.js"></script>






,

<div id="Stats-output"></div>






, тАУ , :



function initStats() { var stats = new Stats(); stats.setMode(0); stats.domElement.style.position = 'absolute'; stats.domElement.style.left = '0px'; stats.domElement.style.top = '0px'; $("#Stats-output").append(stats.domElement ); return stats; }






. setMode



(). 0, FPS, 1, . FPS, 0. jQuery :



$(function () { var stats = initStats(); тАж }





render():

function render() { stats.update(); ... requestAnimationFrame(render); renderer.render(scene, camera); }





, , :









requestAnimationFrame



() . render



() , . :



function render() { ... cube.rotation.x += 0.02; cube.rotation.y += 0.02; cube.rotation.z += 0.02; ... requestAnimationFrame(render); renderer.render(scene, camera); }





, ? тАУ rotation



0,02 render



(), . , , .





render



() :



var step=0; function render() { ... step+=0.04; sphere.position.x = 20+( 10*(Math.cos(step))); sphere.position.y = 2 +( 10*Math.abs(Math.sin(step))); ... requestAnimationFrame(render); renderer.render(scene, camera); }





rotation



; position



. , , . . Math.cos()



Math.sin()



step



. . , step+=0.04



. :







.

, . 3D-, , , . , , . , .



dat.GUI

Google dat.GUI( ), . , , :



, dat.GUI , :



<script type="text/javascript" src="../libs/dat.gui.js"></script>





тАУ JavaScript , , , dat.GUI. JavaScript :



var controls = new function() { this.rotationSpeed = 0.02; this.bouncingSpeed = 0.03; }





: this.rotationSpeed



this.bouncingSpeed



. dat.GUI , :



var gui = new dat.GUI(); gui.add(controls, 'rotationSpeed',0,0.5); gui.add(controls, 'bouncingSpeed',0,0.5);





rotationSpeed



bouncingSpeed



0 0,5. , тАУ , render



, , dat.GUI, . :



function render() { ... cube.rotation.x += controls.rotationSpeed; cube.rotation.y += controls.rotationSpeed; cube.rotation.z += controls.rotationSpeed; step+=controls.bouncingSpeed; sphere.position.x = 20+( 10*(Math.cos(step))); sphere.position.y = 2 +( 10*Math.abs(Math.sin(step))); ... }





, , , :







.



ASCII

3D- . Three.js , , . , : ASCII . , -ASCII, . :



$("#WebGL-output").append(renderer.domElement);





:

var effect = new THREE.AsciiEffect( renderer ); effect.setSize(window.innerWidth, window.innerHeight ); $("#WebGL-output").append(effect.domElement);





. renderer.render(scene, camera), effect.render(scene,camera). :







.

, , , Three.js .





. , Three.js .

, . , Three.js.

, : GitHub












:



<script type="text/javascript" src="../libs/stats.js"></script>






,

<div id="Stats-output"></div>






, тАУ , :



function initStats() { var stats = new Stats(); stats.setMode(0); stats.domElement.style.position = 'absolute'; stats.domElement.style.left = '0px'; stats.domElement.style.top = '0px'; $("#Stats-output").append(stats.domElement ); return stats; }






. setMode



(). 0, FPS, 1, . FPS, 0. jQuery :



$(function () { var stats = initStats(); тАж }





render():

function render() { stats.update(); ... requestAnimationFrame(render); renderer.render(scene, camera); }





, , :









requestAnimationFrame



() . render



() , . :



function render() { ... cube.rotation.x += 0.02; cube.rotation.y += 0.02; cube.rotation.z += 0.02; ... requestAnimationFrame(render); renderer.render(scene, camera); }





, ? тАУ rotation



0,02 render



(), . , , .





render



() :



var step=0; function render() { ... step+=0.04; sphere.position.x = 20+( 10*(Math.cos(step))); sphere.position.y = 2 +( 10*Math.abs(Math.sin(step))); ... requestAnimationFrame(render); renderer.render(scene, camera); }





rotation



; position



. , , . . Math.cos()



Math.sin()



step



. . , step+=0.04



. :







.

, . 3D-, , , . , , . , .



dat.GUI

Google dat.GUI( ), . , , :



, dat.GUI , :



<script type="text/javascript" src="../libs/dat.gui.js"></script>





тАУ JavaScript , , , dat.GUI. JavaScript :



var controls = new function() { this.rotationSpeed = 0.02; this.bouncingSpeed = 0.03; }





: this.rotationSpeed



this.bouncingSpeed



. dat.GUI , :



var gui = new dat.GUI(); gui.add(controls, 'rotationSpeed',0,0.5); gui.add(controls, 'bouncingSpeed',0,0.5);





rotationSpeed



bouncingSpeed



0 0,5. , тАУ , render



, , dat.GUI, . :



function render() { ... cube.rotation.x += controls.rotationSpeed; cube.rotation.y += controls.rotationSpeed; cube.rotation.z += controls.rotationSpeed; step+=controls.bouncingSpeed; sphere.position.x = 20+( 10*(Math.cos(step))); sphere.position.y = 2 +( 10*Math.abs(Math.sin(step))); ... }





, , , :







.



ASCII

3D- . Three.js , , . , : ASCII . , -ASCII, . :



$("#WebGL-output").append(renderer.domElement);





:

var effect = new THREE.AsciiEffect( renderer ); effect.setSize(window.innerWidth, window.innerHeight ); $("#WebGL-output").append(effect.domElement);





. renderer.render(scene, camera), effect.render(scene,camera). :







.

, , , Three.js .





. , Three.js .

, . , Three.js.

, : GitHub












:



<script type="text/javascript" src="../libs/stats.js"></script>






,

<div id="Stats-output"></div>






, тАУ , :



function initStats() { var stats = new Stats(); stats.setMode(0); stats.domElement.style.position = 'absolute'; stats.domElement.style.left = '0px'; stats.domElement.style.top = '0px'; $("#Stats-output").append(stats.domElement ); return stats; }






. setMode



(). 0, FPS, 1, . FPS, 0. jQuery :



$(function () { var stats = initStats(); тАж }





render():

function render() { stats.update(); ... requestAnimationFrame(render); renderer.render(scene, camera); }





, , :









requestAnimationFrame



() . render



() , . :



function render() { ... cube.rotation.x += 0.02; cube.rotation.y += 0.02; cube.rotation.z += 0.02; ... requestAnimationFrame(render); renderer.render(scene, camera); }





, ? тАУ rotation



0,02 render



(), . , , .





render



() :



var step=0; function render() { ... step+=0.04; sphere.position.x = 20+( 10*(Math.cos(step))); sphere.position.y = 2 +( 10*Math.abs(Math.sin(step))); ... requestAnimationFrame(render); renderer.render(scene, camera); }





rotation



; position



. , , . . Math.cos()



Math.sin()



step



. . , step+=0.04



. :







.

, . 3D-, , , . , , . , .



dat.GUI

Google dat.GUI( ), . , , :



, dat.GUI , :



<script type="text/javascript" src="../libs/dat.gui.js"></script>





тАУ JavaScript , , , dat.GUI. JavaScript :



var controls = new function() { this.rotationSpeed = 0.02; this.bouncingSpeed = 0.03; }





: this.rotationSpeed



this.bouncingSpeed



. dat.GUI , :



var gui = new dat.GUI(); gui.add(controls, 'rotationSpeed',0,0.5); gui.add(controls, 'bouncingSpeed',0,0.5);





rotationSpeed



bouncingSpeed



0 0,5. , тАУ , render



, , dat.GUI, . :



function render() { ... cube.rotation.x += controls.rotationSpeed; cube.rotation.y += controls.rotationSpeed; cube.rotation.z += controls.rotationSpeed; step+=controls.bouncingSpeed; sphere.position.x = 20+( 10*(Math.cos(step))); sphere.position.y = 2 +( 10*Math.abs(Math.sin(step))); ... }





, , , :







.



ASCII

3D- . Three.js , , . , : ASCII . , -ASCII, . :



$("#WebGL-output").append(renderer.domElement);





:

var effect = new THREE.AsciiEffect( renderer ); effect.setSize(window.innerWidth, window.innerHeight ); $("#WebGL-output").append(effect.domElement);





. renderer.render(scene, camera), effect.render(scene,camera). :







.

, , , Three.js .





. , Three.js .

, . , Three.js.

, : GitHub












:



<script type="text/javascript" src="../libs/stats.js"></script>






,

<div id="Stats-output"></div>






, тАУ , :



function initStats() { var stats = new Stats(); stats.setMode(0); stats.domElement.style.position = 'absolute'; stats.domElement.style.left = '0px'; stats.domElement.style.top = '0px'; $("#Stats-output").append(stats.domElement ); return stats; }






. setMode



(). 0, FPS, 1, . FPS, 0. jQuery :



$(function () { var stats = initStats(); тАж }





render():

function render() { stats.update(); ... requestAnimationFrame(render); renderer.render(scene, camera); }





, , :









requestAnimationFrame



() . render



() , . :



function render() { ... cube.rotation.x += 0.02; cube.rotation.y += 0.02; cube.rotation.z += 0.02; ... requestAnimationFrame(render); renderer.render(scene, camera); }





, ? тАУ rotation



0,02 render



(), . , , .





render



() :



var step=0; function render() { ... step+=0.04; sphere.position.x = 20+( 10*(Math.cos(step))); sphere.position.y = 2 +( 10*Math.abs(Math.sin(step))); ... requestAnimationFrame(render); renderer.render(scene, camera); }





rotation



; position



. , , . . Math.cos()



Math.sin()



step



. . , step+=0.04



. :







.

, . 3D-, , , . , , . , .



dat.GUI

Google dat.GUI( ), . , , :



, dat.GUI , :



<script type="text/javascript" src="../libs/dat.gui.js"></script>





тАУ JavaScript , , , dat.GUI. JavaScript :



var controls = new function() { this.rotationSpeed = 0.02; this.bouncingSpeed = 0.03; }





: this.rotationSpeed



this.bouncingSpeed



. dat.GUI , :



var gui = new dat.GUI(); gui.add(controls, 'rotationSpeed',0,0.5); gui.add(controls, 'bouncingSpeed',0,0.5);





rotationSpeed



bouncingSpeed



0 0,5. , тАУ , render



, , dat.GUI, . :



function render() { ... cube.rotation.x += controls.rotationSpeed; cube.rotation.y += controls.rotationSpeed; cube.rotation.z += controls.rotationSpeed; step+=controls.bouncingSpeed; sphere.position.x = 20+( 10*(Math.cos(step))); sphere.position.y = 2 +( 10*Math.abs(Math.sin(step))); ... }





, , , :







.



ASCII

3D- . Three.js , , . , : ASCII . , -ASCII, . :



$("#WebGL-output").append(renderer.domElement);





:

var effect = new THREE.AsciiEffect( renderer ); effect.setSize(window.innerWidth, window.innerHeight ); $("#WebGL-output").append(effect.domElement);





. renderer.render(scene, camera), effect.render(scene,camera). :







.

, , , Three.js .





. , Three.js .

, . , Three.js.

, : GitHub












    : 
      



<script type="text/javascript" src="../libs/stats.js"></script>






,

<div id="Stats-output"></div>






, тАУ , :



function initStats() { var stats = new Stats(); stats.setMode(0); stats.domElement.style.position = 'absolute'; stats.domElement.style.left = '0px'; stats.domElement.style.top = '0px'; $("#Stats-output").append(stats.domElement ); return stats; }






. setMode



(). 0, FPS, 1, . FPS, 0. jQuery :



$(function () { var stats = initStats(); тАж }





render():

function render() { stats.update(); ... requestAnimationFrame(render); renderer.render(scene, camera); }





, , :









requestAnimationFrame



() . render



() , . :



function render() { ... cube.rotation.x += 0.02; cube.rotation.y += 0.02; cube.rotation.z += 0.02; ... requestAnimationFrame(render); renderer.render(scene, camera); }





, ? тАУ rotation



0,02 render



(), . , , .





render



() :



var step=0; function render() { ... step+=0.04; sphere.position.x = 20+( 10*(Math.cos(step))); sphere.position.y = 2 +( 10*Math.abs(Math.sin(step))); ... requestAnimationFrame(render); renderer.render(scene, camera); }





rotation



; position



. , , . . Math.cos()



Math.sin()



step



. . , step+=0.04



. :







.

, . 3D-, , , . , , . , .



dat.GUI

Google dat.GUI( ), . , , :



, dat.GUI , :



<script type="text/javascript" src="../libs/dat.gui.js"></script>

тАУ JavaScript , , , dat.GUI. JavaScript :



var controls = new function() { this.rotationSpeed = 0.02; this.bouncingSpeed = 0.03; }





: this.rotationSpeed



this.bouncingSpeed



. dat.GUI , :



var gui = new dat.GUI(); gui.add(controls, 'rotationSpeed',0,0.5); gui.add(controls, 'bouncingSpeed',0,0.5);





rotationSpeed



bouncingSpeed



0 0,5. , тАУ , render



, , dat.GUI, . :



function render() { ... cube.rotation.x += controls.rotationSpeed; cube.rotation.y += controls.rotationSpeed; cube.rotation.z += controls.rotationSpeed; step+=controls.bouncingSpeed; sphere.position.x = 20+( 10*(Math.cos(step))); sphere.position.y = 2 +( 10*Math.abs(Math.sin(step))); ... }





, , , :







.



ASCII

3D- . Three.js , , . , : ASCII . , -ASCII, . :



$("#WebGL-output").append(renderer.domElement);





:

var effect = new THREE.AsciiEffect( renderer ); effect.setSize(window.innerWidth, window.innerHeight ); $("#WebGL-output").append(effect.domElement);





. renderer.render(scene, camera), effect.render(scene,camera). :







.

, , , Three.js .





. , Three.js .

, . , Three.js.

, : GitHub
















:



<script type="text/javascript" src="../libs/stats.js"></script>






,

<div id="Stats-output"></div>






, тАУ , :



function initStats() { var stats = new Stats(); stats.setMode(0); stats.domElement.style.position = 'absolute'; stats.domElement.style.left = '0px'; stats.domElement.style.top = '0px'; $("#Stats-output").append(stats.domElement ); return stats; }






. setMode



(). 0, FPS, 1, . FPS, 0. jQuery :



$(function () { var stats = initStats(); тАж }





render():

function render() { stats.update(); ... requestAnimationFrame(render); renderer.render(scene, camera); }





, , :









requestAnimationFrame



() . render



() , . :



function render() { ... cube.rotation.x += 0.02; cube.rotation.y += 0.02; cube.rotation.z += 0.02; ... requestAnimationFrame(render); renderer.render(scene, camera); }





, ? тАУ rotation



0,02 render



(), . , , .





render



() :



var step=0; function render() { ... step+=0.04; sphere.position.x = 20+( 10*(Math.cos(step))); sphere.position.y = 2 +( 10*Math.abs(Math.sin(step))); ... requestAnimationFrame(render); renderer.render(scene, camera); }





rotation



; position



. , , . . Math.cos()



Math.sin()



step



. . , step+=0.04



. :







.

, . 3D-, , , . , , . , .



dat.GUI

Google dat.GUI( ), . , , :



, dat.GUI , :



<script type="text/javascript" src="../libs/dat.gui.js"></script>





тАУ JavaScript , , , dat.GUI. JavaScript :



var controls = new function() { this.rotationSpeed = 0.02; this.bouncingSpeed = 0.03; }





: this.rotationSpeed



this.bouncingSpeed



. dat.GUI , :



var gui = new dat.GUI(); gui.add(controls, 'rotationSpeed',0,0.5); gui.add(controls, 'bouncingSpeed',0,0.5);





rotationSpeed



bouncingSpeed



0 0,5. , тАУ , render



, , dat.GUI, . :



function render() { ... cube.rotation.x += controls.rotationSpeed; cube.rotation.y += controls.rotationSpeed; cube.rotation.z += controls.rotationSpeed; step+=controls.bouncingSpeed; sphere.position.x = 20+( 10*(Math.cos(step))); sphere.position.y = 2 +( 10*Math.abs(Math.sin(step))); ... }





, , , :







.



ASCII

3D- . Three.js , , . , : ASCII . , -ASCII, . :



$("#WebGL-output").append(renderer.domElement);





:

var effect = new THREE.AsciiEffect( renderer ); effect.setSize(window.innerWidth, window.innerHeight ); $("#WebGL-output").append(effect.domElement);





. renderer.render(scene, camera), effect.render(scene,camera). :







.

, , , Three.js .





. , Three.js .

, . , Three.js.

, : GitHub












    : 
      



<script type="text/javascript" src="../libs/stats.js"></script>






,

<div id="Stats-output"></div>






, тАУ , :



function initStats() { var stats = new Stats(); stats.setMode(0); stats.domElement.style.position = 'absolute'; stats.domElement.style.left = '0px'; stats.domElement.style.top = '0px'; $("#Stats-output").append(stats.domElement ); return stats; }






. setMode



(). 0, FPS, 1, . FPS, 0. jQuery :



$(function () { var stats = initStats(); тАж }





render():

function render() { stats.update(); ... requestAnimationFrame(render); renderer.render(scene, camera); }





, , :









requestAnimationFrame



() . render



() , . :



function render() { ... cube.rotation.x += 0.02; cube.rotation.y += 0.02; cube.rotation.z += 0.02; ... requestAnimationFrame(render); renderer.render(scene, camera); }





, ? тАУ rotation



0,02 render



(), . , , .





render



() :



var step=0; function render() { ... step+=0.04; sphere.position.x = 20+( 10*(Math.cos(step))); sphere.position.y = 2 +( 10*Math.abs(Math.sin(step))); ... requestAnimationFrame(render); renderer.render(scene, camera); }





rotation



; position



. , , . . Math.cos()



Math.sin()



step



. . , step+=0.04



. :







.

, . 3D-, , , . , , . , .



dat.GUI

Google dat.GUI( ), . , , :



, dat.GUI , :



<script type="text/javascript" src="../libs/dat.gui.js"></script>





тАУ JavaScript , , , dat.GUI. JavaScript :



var controls = new function() { this.rotationSpeed = 0.02; this.bouncingSpeed = 0.03; }





: this.rotationSpeed



this.bouncingSpeed



. dat.GUI , :



var gui = new dat.GUI(); gui.add(controls, 'rotationSpeed',0,0.5); gui.add(controls, 'bouncingSpeed',0,0.5);





rotationSpeed



bouncingSpeed



0 0,5. , тАУ , render



, , dat.GUI, . :



function render() { ... cube.rotation.x += controls.rotationSpeed; cube.rotation.y += controls.rotationSpeed; cube.rotation.z += controls.rotationSpeed; step+=controls.bouncingSpeed; sphere.position.x = 20+( 10*(Math.cos(step))); sphere.position.y = 2 +( 10*Math.abs(Math.sin(step))); ... }





, , , :







.



ASCII

3D- . Three.js , , . , : ASCII . , -ASCII, . :



$("#WebGL-output").append(renderer.domElement);





:

var effect = new THREE.AsciiEffect( renderer ); effect.setSize(window.innerWidth, window.innerHeight ); $("#WebGL-output").append(effect.domElement);





. renderer.render(scene, camera), effect.render(scene,camera). :







.

, , , Three.js .





. , Three.js .

, . , Three.js.

, : GitHub












:



<script type="text/javascript" src="../libs/stats.js"></script>






,

<div id="Stats-output"></div>






, тАУ , :



function initStats() { var stats = new Stats(); stats.setMode(0); stats.domElement.style.position = 'absolute'; stats.domElement.style.left = '0px'; stats.domElement.style.top = '0px'; $("#Stats-output").append(stats.domElement ); return stats; }






. setMode



(). 0, FPS, 1, . FPS, 0. jQuery :



$(function () { var stats = initStats(); тАж }





render():

function render() { stats.update(); ... requestAnimationFrame(render); renderer.render(scene, camera); }





, , :









requestAnimationFrame



() . render



() , . :



function render() { ... cube.rotation.x += 0.02; cube.rotation.y += 0.02; cube.rotation.z += 0.02; ... requestAnimationFrame(render); renderer.render(scene, camera); }





, ? тАУ rotation



0,02 render



(), . , , .





render



() :



var step=0; function render() { ... step+=0.04; sphere.position.x = 20+( 10*(Math.cos(step))); sphere.position.y = 2 +( 10*Math.abs(Math.sin(step))); ... requestAnimationFrame(render); renderer.render(scene, camera); }





rotation



; position



. , , . . Math.cos()



Math.sin()



step



. . , step+=0.04



. :







.

, . 3D-, , , . , , . , .



dat.GUI

Google dat.GUI( ), . , , :



, dat.GUI , :



<script type="text/javascript" src="../libs/dat.gui.js"></script>





тАУ JavaScript , , , dat.GUI. JavaScript :



var controls = new function() { this.rotationSpeed = 0.02; this.bouncingSpeed = 0.03; }





: this.rotationSpeed



this.bouncingSpeed



. dat.GUI , :



var gui = new dat.GUI(); gui.add(controls, 'rotationSpeed',0,0.5); gui.add(controls, 'bouncingSpeed',0,0.5);





rotationSpeed



bouncingSpeed



0 0,5. , тАУ , render



, , dat.GUI, . :



function render() { ... cube.rotation.x += controls.rotationSpeed; cube.rotation.y += controls.rotationSpeed; cube.rotation.z += controls.rotationSpeed; step+=controls.bouncingSpeed; sphere.position.x = 20+( 10*(Math.cos(step))); sphere.position.y = 2 +( 10*Math.abs(Math.sin(step))); ... }





, , , :







.



ASCII

3D- . Three.js , , . , : ASCII . , -ASCII, . :



$("#WebGL-output").append(renderer.domElement);





:

var effect = new THREE.AsciiEffect( renderer ); effect.setSize(window.innerWidth, window.innerHeight ); $("#WebGL-output").append(effect.domElement);





. renderer.render(scene, camera), effect.render(scene,camera). :







.

, , , Three.js .





. , Three.js .

, . , Three.js.

, : GitHub












    : 
      



<script type="text/javascript" src="../libs/stats.js"></script>






,

<div id="Stats-output"></div>






, тАУ , :



function initStats() { var stats = new Stats(); stats.setMode(0); stats.domElement.style.position = 'absolute'; stats.domElement.style.left = '0px'; stats.domElement.style.top = '0px'; $("#Stats-output").append(stats.domElement ); return stats; }






. setMode



(). 0, FPS, 1, . FPS, 0. jQuery :



$(function () { var stats = initStats(); тАж }





render():

function render() { stats.update(); ... requestAnimationFrame(render); renderer.render(scene, camera); }





, , :









requestAnimationFrame



() . render



() , . :



function render() { ... cube.rotation.x += 0.02; cube.rotation.y += 0.02; cube.rotation.z += 0.02; ... requestAnimationFrame(render); renderer.render(scene, camera); }





, ? тАУ rotation



0,02 render



(), . , , .





render



() :



var step=0; function render() { ... step+=0.04; sphere.position.x = 20+( 10*(Math.cos(step))); sphere.position.y = 2 +( 10*Math.abs(Math.sin(step))); ... requestAnimationFrame(render); renderer.render(scene, camera); }





rotation



; position



. , , . . Math.cos()



Math.sin()



step



. . , step+=0.04



. :







.

, . 3D-, , , . , , . , .



dat.GUI

Google dat.GUI( ), . , , :



, dat.GUI , :



<script type="text/javascript" src="../libs/dat.gui.js"></script>





тАУ JavaScript , , , dat.GUI. JavaScript :



var controls = new function() { this.rotationSpeed = 0.02; this.bouncingSpeed = 0.03; }





: this.rotationSpeed



this.bouncingSpeed



. dat.GUI , :



var gui = new dat.GUI(); gui.add(controls, 'rotationSpeed',0,0.5); gui.add(controls, 'bouncingSpeed',0,0.5);





rotationSpeed



bouncingSpeed



0 0,5. , тАУ , render



, , dat.GUI, . :



function render() { ... cube.rotation.x += controls.rotationSpeed; cube.rotation.y += controls.rotationSpeed; cube.rotation.z += controls.rotationSpeed; step+=controls.bouncingSpeed; sphere.position.x = 20+( 10*(Math.cos(step))); sphere.position.y = 2 +( 10*Math.abs(Math.sin(step))); ... }





, , , :







.



ASCII

3D- . Three.js , , . , : ASCII . , -ASCII, . :



$("#WebGL-output").append(renderer.domElement);





:

var effect = new THREE.AsciiEffect( renderer ); effect.setSize(window.innerWidth, window.innerHeight ); $("#WebGL-output").append(effect.domElement);





. renderer.render(scene, camera), effect.render(scene,camera). :







.

, , , Three.js .





. , Three.js .

, . , Three.js.

, : GitHub












:



<script type="text/javascript" src="../libs/stats.js"></script>






,

<div id="Stats-output"></div>






, тАУ , :



function initStats() { var stats = new Stats(); stats.setMode(0); stats.domElement.style.position = 'absolute'; stats.domElement.style.left = '0px'; stats.domElement.style.top = '0px'; $("#Stats-output").append(stats.domElement ); return stats; }






. setMode



(). 0, FPS, 1, . FPS, 0. jQuery :



$(function () { var stats = initStats(); тАж }





render():

function render() { stats.update(); ... requestAnimationFrame(render); renderer.render(scene, camera); }





, , :









requestAnimationFrame



() . render



() , . :



function render() { ... cube.rotation.x += 0.02; cube.rotation.y += 0.02; cube.rotation.z += 0.02; ... requestAnimationFrame(render); renderer.render(scene, camera); }





, ? тАУ rotation



0,02 render



(), . , , .





render



() :



var step=0; function render() { ... step+=0.04; sphere.position.x = 20+( 10*(Math.cos(step))); sphere.position.y = 2 +( 10*Math.abs(Math.sin(step))); ... requestAnimationFrame(render); renderer.render(scene, camera); }





rotation



; position



. , , . . Math.cos()



Math.sin()



step



. . , step+=0.04



. :







.

, . 3D-, , , . , , . , .



dat.GUI

Google dat.GUI( ), . , , :



, dat.GUI , :



<script type="text/javascript" src="../libs/dat.gui.js"></script>





тАУ JavaScript , , , dat.GUI. JavaScript :



var controls = new function() { this.rotationSpeed = 0.02; this.bouncingSpeed = 0.03; }





: this.rotationSpeed



this.bouncingSpeed



. dat.GUI , :



var gui = new dat.GUI(); gui.add(controls, 'rotationSpeed',0,0.5); gui.add(controls, 'bouncingSpeed',0,0.5);





rotationSpeed



bouncingSpeed



0 0,5. , тАУ , render



, , dat.GUI, . :



function render() { ... cube.rotation.x += controls.rotationSpeed; cube.rotation.y += controls.rotationSpeed; cube.rotation.z += controls.rotationSpeed; step+=controls.bouncingSpeed; sphere.position.x = 20+( 10*(Math.cos(step))); sphere.position.y = 2 +( 10*Math.abs(Math.sin(step))); ... }





, , , :







.



ASCII

3D- . Three.js , , . , : ASCII . , -ASCII, . :



$("#WebGL-output").append(renderer.domElement);





:

var effect = new THREE.AsciiEffect( renderer ); effect.setSize(window.innerWidth, window.innerHeight ); $("#WebGL-output").append(effect.domElement);





. renderer.render(scene, camera), effect.render(scene,camera). :







.

, , , Three.js .





. , Three.js .

, . , Three.js.

, : GitHub












    : 
      



<script type="text/javascript" src="../libs/stats.js"></script>






,

<div id="Stats-output"></div>






, тАУ , :



function initStats() { var stats = new Stats(); stats.setMode(0); stats.domElement.style.position = 'absolute'; stats.domElement.style.left = '0px'; stats.domElement.style.top = '0px'; $("#Stats-output").append(stats.domElement ); return stats; }






. setMode



(). 0, FPS, 1, . FPS, 0. jQuery :



$(function () { var stats = initStats(); тАж }





render():

function render() { stats.update(); ... requestAnimationFrame(render); renderer.render(scene, camera); }





, , :









requestAnimationFrame



() . render



() , . :



function render() { ... cube.rotation.x += 0.02; cube.rotation.y += 0.02; cube.rotation.z += 0.02; ... requestAnimationFrame(render); renderer.render(scene, camera); }





, ? тАУ rotation



0,02 render



(), . , , .





render



() :



var step=0; function render() { ... step+=0.04; sphere.position.x = 20+( 10*(Math.cos(step))); sphere.position.y = 2 +( 10*Math.abs(Math.sin(step))); ... requestAnimationFrame(render); renderer.render(scene, camera); }





rotation



; position



. , , . . Math.cos()



Math.sin()



step



. . , step+=0.04



. :







.

, . 3D-, , , . , , . , .



dat.GUI

Google dat.GUI( ), . , , :



, dat.GUI , :



<script type="text/javascript" src="../libs/dat.gui.js"></script>





тАУ JavaScript , , , dat.GUI. JavaScript :



var controls = new function() { this.rotationSpeed = 0.02; this.bouncingSpeed = 0.03; }





: this.rotationSpeed



this.bouncingSpeed



. dat.GUI , :



var gui = new dat.GUI(); gui.add(controls, 'rotationSpeed',0,0.5); gui.add(controls, 'bouncingSpeed',0,0.5);





rotationSpeed



bouncingSpeed



0 0,5. , тАУ , render



, , dat.GUI, . :



function render() { ... cube.rotation.x += controls.rotationSpeed; cube.rotation.y += controls.rotationSpeed; cube.rotation.z += controls.rotationSpeed; step+=controls.bouncingSpeed; sphere.position.x = 20+( 10*(Math.cos(step))); sphere.position.y = 2 +( 10*Math.abs(Math.sin(step))); ... }





, , , :







.



ASCII

3D- . Three.js , , . , : ASCII . , -ASCII, . :



$("#WebGL-output").append(renderer.domElement);





:

var effect = new THREE.AsciiEffect( renderer ); effect.setSize(window.innerWidth, window.innerHeight ); $("#WebGL-output").append(effect.domElement);





. renderer.render(scene, camera), effect.render(scene,camera). :







.

, , , Three.js .





. , Three.js .

, . , Three.js.

, : GitHub












:



<script type="text/javascript" src="../libs/stats.js"></script>






,

<div id="Stats-output"></div>






, тАУ , :



function initStats() { var stats = new Stats(); stats.setMode(0); stats.domElement.style.position = 'absolute'; stats.domElement.style.left = '0px'; stats.domElement.style.top = '0px'; $("#Stats-output").append(stats.domElement ); return stats; }






. setMode



(). 0, FPS, 1, . FPS, 0. jQuery :



$(function () { var stats = initStats(); тАж }





render():

function render() { stats.update(); ... requestAnimationFrame(render); renderer.render(scene, camera); }





, , :









requestAnimationFrame



() . render



() , . :



function render() { ... cube.rotation.x += 0.02; cube.rotation.y += 0.02; cube.rotation.z += 0.02; ... requestAnimationFrame(render); renderer.render(scene, camera); }





, ? тАУ rotation



0,02 render



(), . , , .





render



() :



var step=0; function render() { ... step+=0.04; sphere.position.x = 20+( 10*(Math.cos(step))); sphere.position.y = 2 +( 10*Math.abs(Math.sin(step))); ... requestAnimationFrame(render); renderer.render(scene, camera); }





rotation



; position



. , , . . Math.cos()



Math.sin()



step



. . , step+=0.04



. :







.

, . 3D-, , , . , , . , .



dat.GUI

Google dat.GUI( ), . , , :



, dat.GUI , :



<script type="text/javascript" src="../libs/dat.gui.js"></script>





тАУ JavaScript , , , dat.GUI. JavaScript :



var controls = new function() { this.rotationSpeed = 0.02; this.bouncingSpeed = 0.03; }





: this.rotationSpeed



this.bouncingSpeed



. dat.GUI , :



var gui = new dat.GUI(); gui.add(controls, 'rotationSpeed',0,0.5); gui.add(controls, 'bouncingSpeed',0,0.5);





rotationSpeed



bouncingSpeed



0 0,5. , тАУ , render



, , dat.GUI, . :



function render() { ... cube.rotation.x += controls.rotationSpeed; cube.rotation.y += controls.rotationSpeed; cube.rotation.z += controls.rotationSpeed; step+=controls.bouncingSpeed; sphere.position.x = 20+( 10*(Math.cos(step))); sphere.position.y = 2 +( 10*Math.abs(Math.sin(step))); ... }





, , , :







.



ASCII

3D- . Three.js , , . , : ASCII . , -ASCII, . :



$("#WebGL-output").append(renderer.domElement);





:

var effect = new THREE.AsciiEffect( renderer ); effect.setSize(window.innerWidth, window.innerHeight ); $("#WebGL-output").append(effect.domElement);





. renderer.render(scene, camera), effect.render(scene,camera). :







.

, , , Three.js .





. , Three.js .

, . , Three.js.

, : GitHub












:



<script type="text/javascript" src="../libs/stats.js"></script>






,

<div id="Stats-output"></div>






, тАУ , :



function initStats() { var stats = new Stats(); stats.setMode(0); stats.domElement.style.position = 'absolute'; stats.domElement.style.left = '0px'; stats.domElement.style.top = '0px'; $("#Stats-output").append(stats.domElement ); return stats; }






. setMode



(). 0, FPS, 1, . FPS, 0. jQuery :



$(function () { var stats = initStats(); тАж }





render():

function render() { stats.update(); ... requestAnimationFrame(render); renderer.render(scene, camera); }





, , :









requestAnimationFrame



() . render



() , . :



function render() { ... cube.rotation.x += 0.02; cube.rotation.y += 0.02; cube.rotation.z += 0.02; ... requestAnimationFrame(render); renderer.render(scene, camera); }





, ? тАУ rotation



0,02 render



(), . , , .





render



() :



var step=0; function render() { ... step+=0.04; sphere.position.x = 20+( 10*(Math.cos(step))); sphere.position.y = 2 +( 10*Math.abs(Math.sin(step))); ... requestAnimationFrame(render); renderer.render(scene, camera); }





rotation



; position



. , , . . Math.cos()



Math.sin()



step



. . , step+=0.04



. :







.

, . 3D-, , , . , , . , .



dat.GUI

Google dat.GUI( ), . , , :



, dat.GUI , :



<script type="text/javascript" src="../libs/dat.gui.js"></script>





тАУ JavaScript , , , dat.GUI. JavaScript :



var controls = new function() { this.rotationSpeed = 0.02; this.bouncingSpeed = 0.03; }





: this.rotationSpeed



this.bouncingSpeed



. dat.GUI , :



var gui = new dat.GUI(); gui.add(controls, 'rotationSpeed',0,0.5); gui.add(controls, 'bouncingSpeed',0,0.5);





rotationSpeed



bouncingSpeed



0 0,5. , тАУ , render



, , dat.GUI, . :



function render() { ... cube.rotation.x += controls.rotationSpeed; cube.rotation.y += controls.rotationSpeed; cube.rotation.z += controls.rotationSpeed; step+=controls.bouncingSpeed; sphere.position.x = 20+( 10*(Math.cos(step))); sphere.position.y = 2 +( 10*Math.abs(Math.sin(step))); ... }





, , , :







.



ASCII

3D- . Three.js , , . , : ASCII . , -ASCII, . :



$("#WebGL-output").append(renderer.domElement);





:

var effect = new THREE.AsciiEffect( renderer ); effect.setSize(window.innerWidth, window.innerHeight ); $("#WebGL-output").append(effect.domElement);





. renderer.render(scene, camera), effect.render(scene,camera). :







.

, , , Three.js .





. , Three.js .

, . , Three.js.

, : GitHub












:



<script type="text/javascript" src="../libs/stats.js"></script>






,

<div id="Stats-output"></div>






, тАУ , :



function initStats() { var stats = new Stats(); stats.setMode(0); stats.domElement.style.position = 'absolute'; stats.domElement.style.left = '0px'; stats.domElement.style.top = '0px'; $("#Stats-output").append(stats.domElement ); return stats; }






. setMode



(). 0, FPS, 1, . FPS, 0. jQuery :



$(function () { var stats = initStats(); тАж }





render():

function render() { stats.update(); ... requestAnimationFrame(render); renderer.render(scene, camera); }





, , :









requestAnimationFrame



() . render



() , . :



function render() { ... cube.rotation.x += 0.02; cube.rotation.y += 0.02; cube.rotation.z += 0.02; ... requestAnimationFrame(render); renderer.render(scene, camera); }





, ? тАУ rotation



0,02 render



(), . , , .





render



() :



var step=0; function render() { ... step+=0.04; sphere.position.x = 20+( 10*(Math.cos(step))); sphere.position.y = 2 +( 10*Math.abs(Math.sin(step))); ... requestAnimationFrame(render); renderer.render(scene, camera); }





rotation



; position



. , , . . Math.cos()



Math.sin()



step



. . , step+=0.04



. :







.

, . 3D-, , , . , , . , .



dat.GUI

Google dat.GUI( ), . , , :



, dat.GUI , :



<script type="text/javascript" src="../libs/dat.gui.js"></script>





тАУ JavaScript , , , dat.GUI. JavaScript :



var controls = new function() { this.rotationSpeed = 0.02; this.bouncingSpeed = 0.03; }





: this.rotationSpeed



this.bouncingSpeed



. dat.GUI , :



var gui = new dat.GUI(); gui.add(controls, 'rotationSpeed',0,0.5); gui.add(controls, 'bouncingSpeed',0,0.5);





rotationSpeed



bouncingSpeed



0 0,5. , тАУ , render



, , dat.GUI, . :



function render() { ... cube.rotation.x += controls.rotationSpeed; cube.rotation.y += controls.rotationSpeed; cube.rotation.z += controls.rotationSpeed; step+=controls.bouncingSpeed; sphere.position.x = 20+( 10*(Math.cos(step))); sphere.position.y = 2 +( 10*Math.abs(Math.sin(step))); ... }





, , , :







.



ASCII

3D- . Three.js , , . , : ASCII . , -ASCII, . :



$("#WebGL-output").append(renderer.domElement);





:

var effect = new THREE.AsciiEffect( renderer ); effect.setSize(window.innerWidth, window.innerHeight ); $("#WebGL-output").append(effect.domElement);





. renderer.render(scene, camera), effect.render(scene,camera). :







.

, , , Three.js .





. , Three.js .

, . , Three.js.

, : GitHub












    : 
      



<script type="text/javascript" src="../libs/stats.js"></script>






,

<div id="Stats-output"></div>






, тАУ , :



function initStats() { var stats = new Stats(); stats.setMode(0); stats.domElement.style.position = 'absolute'; stats.domElement.style.left = '0px'; stats.domElement.style.top = '0px'; $("#Stats-output").append(stats.domElement ); return stats; }






. setMode



(). 0, FPS, 1, . FPS, 0. jQuery :



$(function () { var stats = initStats(); тАж }





render():

function render() { stats.update(); ... requestAnimationFrame(render); renderer.render(scene, camera); }





, , :









requestAnimationFrame



() . render



() , . :



function render() { ... cube.rotation.x += 0.02; cube.rotation.y += 0.02; cube.rotation.z += 0.02; ... requestAnimationFrame(render); renderer.render(scene, camera); }





, ? тАУ rotation



0,02 render



(), . , , .





render



() :



var step=0; function render() { ... step+=0.04; sphere.position.x = 20+( 10*(Math.cos(step))); sphere.position.y = 2 +( 10*Math.abs(Math.sin(step))); ... requestAnimationFrame(render); renderer.render(scene, camera); }





rotation



; position



. , , . . Math.cos()



Math.sin()



step



. . , step+=0.04



. :







.

, . 3D-, , , . , , . , .



dat.GUI

Google dat.GUI( ), . , , :



, dat.GUI , :



<script type="text/javascript" src="../libs/dat.gui.js"></script>





тАУ JavaScript , , , dat.GUI. JavaScript :



var controls = new function() { this.rotationSpeed = 0.02; this.bouncingSpeed = 0.03; }





: this.rotationSpeed



this.bouncingSpeed



. dat.GUI , :



var gui = new dat.GUI(); gui.add(controls, 'rotationSpeed',0,0.5); gui.add(controls, 'bouncingSpeed',0,0.5);





rotationSpeed



bouncingSpeed



0 0,5. , тАУ , render



, , dat.GUI, . :



function render() { ... cube.rotation.x += controls.rotationSpeed; cube.rotation.y += controls.rotationSpeed; cube.rotation.z += controls.rotationSpeed; step+=controls.bouncingSpeed; sphere.position.x = 20+( 10*(Math.cos(step))); sphere.position.y = 2 +( 10*Math.abs(Math.sin(step))); ... }





, , , :







.



ASCII

3D- . Three.js , , . , : ASCII . , -ASCII, . :



$("#WebGL-output").append(renderer.domElement);

:

var effect = new THREE.AsciiEffect( renderer ); effect.setSize(window.innerWidth, window.innerHeight ); $("#WebGL-output").append(effect.domElement);





. renderer.render(scene, camera), effect.render(scene,camera). :







.

, , , Three.js .





. , Three.js .

, . , Three.js.

, : GitHub
















:



<script type="text/javascript" src="../libs/stats.js"></script>






,

<div id="Stats-output"></div>






, тАУ , :



function initStats() { var stats = new Stats(); stats.setMode(0); stats.domElement.style.position = 'absolute'; stats.domElement.style.left = '0px'; stats.domElement.style.top = '0px'; $("#Stats-output").append(stats.domElement ); return stats; }






. setMode



(). 0, FPS, 1, . FPS, 0. jQuery :



$(function () { var stats = initStats(); тАж }





render():

function render() { stats.update(); ... requestAnimationFrame(render); renderer.render(scene, camera); }





, , :









requestAnimationFrame



() . render



() , . :



function render() { ... cube.rotation.x += 0.02; cube.rotation.y += 0.02; cube.rotation.z += 0.02; ... requestAnimationFrame(render); renderer.render(scene, camera); }





, ? тАУ rotation



0,02 render



(), . , , .





render



() :



var step=0; function render() { ... step+=0.04; sphere.position.x = 20+( 10*(Math.cos(step))); sphere.position.y = 2 +( 10*Math.abs(Math.sin(step))); ... requestAnimationFrame(render); renderer.render(scene, camera); }





rotation



; position



. , , . . Math.cos()



Math.sin()



step



. . , step+=0.04



. :







.

, . 3D-, , , . , , . , .



dat.GUI

Google dat.GUI( ), . , , :



, dat.GUI , :



<script type="text/javascript" src="../libs/dat.gui.js"></script>





тАУ JavaScript , , , dat.GUI. JavaScript :



var controls = new function() { this.rotationSpeed = 0.02; this.bouncingSpeed = 0.03; }





: this.rotationSpeed



this.bouncingSpeed



. dat.GUI , :



var gui = new dat.GUI(); gui.add(controls, 'rotationSpeed',0,0.5); gui.add(controls, 'bouncingSpeed',0,0.5);





rotationSpeed



bouncingSpeed



0 0,5. , тАУ , render



, , dat.GUI, . :



function render() { ... cube.rotation.x += controls.rotationSpeed; cube.rotation.y += controls.rotationSpeed; cube.rotation.z += controls.rotationSpeed; step+=controls.bouncingSpeed; sphere.position.x = 20+( 10*(Math.cos(step))); sphere.position.y = 2 +( 10*Math.abs(Math.sin(step))); ... }





, , , :







.



ASCII

3D- . Three.js , , . , : ASCII . , -ASCII, . :



$("#WebGL-output").append(renderer.domElement);





:

var effect = new THREE.AsciiEffect( renderer ); effect.setSize(window.innerWidth, window.innerHeight ); $("#WebGL-output").append(effect.domElement);





. renderer.render(scene, camera), effect.render(scene,camera). :







.

, , , Three.js .





. , Three.js .

, . , Three.js.

, : GitHub












    : 
      



<script type="text/javascript" src="../libs/stats.js"></script>






,

<div id="Stats-output"></div>






, тАУ , :



function initStats() { var stats = new Stats(); stats.setMode(0); stats.domElement.style.position = 'absolute'; stats.domElement.style.left = '0px'; stats.domElement.style.top = '0px'; $("#Stats-output").append(stats.domElement ); return stats; }






. setMode



(). 0, FPS, 1, . FPS, 0. jQuery :



$(function () { var stats = initStats(); тАж }





render():

function render() { stats.update(); ... requestAnimationFrame(render); renderer.render(scene, camera); }





, , :









requestAnimationFrame



() . render



() , . :



function render() { ... cube.rotation.x += 0.02; cube.rotation.y += 0.02; cube.rotation.z += 0.02; ... requestAnimationFrame(render); renderer.render(scene, camera); }





, ? тАУ rotation



0,02 render



(), . , , .





render



() :



var step=0; function render() { ... step+=0.04; sphere.position.x = 20+( 10*(Math.cos(step))); sphere.position.y = 2 +( 10*Math.abs(Math.sin(step))); ... requestAnimationFrame(render); renderer.render(scene, camera); }





rotation



; position



. , , . . Math.cos()



Math.sin()



step



. . , step+=0.04



. :







.

, . 3D-, , , . , , . , .



dat.GUI

Google dat.GUI( ), . , , :



, dat.GUI , :



<script type="text/javascript" src="../libs/dat.gui.js"></script>





тАУ JavaScript , , , dat.GUI. JavaScript :



var controls = new function() { this.rotationSpeed = 0.02; this.bouncingSpeed = 0.03; }





: this.rotationSpeed



this.bouncingSpeed



. dat.GUI , :



var gui = new dat.GUI(); gui.add(controls, 'rotationSpeed',0,0.5); gui.add(controls, 'bouncingSpeed',0,0.5);





rotationSpeed



bouncingSpeed



0 0,5. , тАУ , render



, , dat.GUI, . :



function render() { ... cube.rotation.x += controls.rotationSpeed; cube.rotation.y += controls.rotationSpeed; cube.rotation.z += controls.rotationSpeed; step+=controls.bouncingSpeed; sphere.position.x = 20+( 10*(Math.cos(step))); sphere.position.y = 2 +( 10*Math.abs(Math.sin(step))); ... }





, , , :







.



ASCII

3D- . Three.js , , . , : ASCII . , -ASCII, . :



$("#WebGL-output").append(renderer.domElement);





:

var effect = new THREE.AsciiEffect( renderer ); effect.setSize(window.innerWidth, window.innerHeight ); $("#WebGL-output").append(effect.domElement);





. renderer.render(scene, camera), effect.render(scene,camera). :







.

, , , Three.js .





. , Three.js .

, . , Three.js.

, : GitHub












:



<script type="text/javascript" src="../libs/stats.js"></script>






,

<div id="Stats-output"></div>






, тАУ , :



function initStats() { var stats = new Stats(); stats.setMode(0); stats.domElement.style.position = 'absolute'; stats.domElement.style.left = '0px'; stats.domElement.style.top = '0px'; $("#Stats-output").append(stats.domElement ); return stats; }






. setMode



(). 0, FPS, 1, . FPS, 0. jQuery :



$(function () { var stats = initStats(); тАж }





render():

function render() { stats.update(); ... requestAnimationFrame(render); renderer.render(scene, camera); }





, , :









requestAnimationFrame



() . render



() , . :



function render() { ... cube.rotation.x += 0.02; cube.rotation.y += 0.02; cube.rotation.z += 0.02; ... requestAnimationFrame(render); renderer.render(scene, camera); }





, ? тАУ rotation



0,02 render



(), . , , .





render



() :



var step=0; function render() { ... step+=0.04; sphere.position.x = 20+( 10*(Math.cos(step))); sphere.position.y = 2 +( 10*Math.abs(Math.sin(step))); ... requestAnimationFrame(render); renderer.render(scene, camera); }





rotation



; position



. , , . . Math.cos()



Math.sin()



step



. . , step+=0.04



. :







.

, . 3D-, , , . , , . , .



dat.GUI

Google dat.GUI( ), . , , :



, dat.GUI , :



<script type="text/javascript" src="../libs/dat.gui.js"></script>





тАУ JavaScript , , , dat.GUI. JavaScript :



var controls = new function() { this.rotationSpeed = 0.02; this.bouncingSpeed = 0.03; }





: this.rotationSpeed



this.bouncingSpeed



. dat.GUI , :



var gui = new dat.GUI(); gui.add(controls, 'rotationSpeed',0,0.5); gui.add(controls, 'bouncingSpeed',0,0.5);





rotationSpeed



bouncingSpeed



0 0,5. , тАУ , render



, , dat.GUI, . :



function render() { ... cube.rotation.x += controls.rotationSpeed; cube.rotation.y += controls.rotationSpeed; cube.rotation.z += controls.rotationSpeed; step+=controls.bouncingSpeed; sphere.position.x = 20+( 10*(Math.cos(step))); sphere.position.y = 2 +( 10*Math.abs(Math.sin(step))); ... }





, , , :







.



ASCII

3D- . Three.js , , . , : ASCII . , -ASCII, . :



$("#WebGL-output").append(renderer.domElement);





:

var effect = new THREE.AsciiEffect( renderer ); effect.setSize(window.innerWidth, window.innerHeight ); $("#WebGL-output").append(effect.domElement);





. renderer.render(scene, camera), effect.render(scene,camera). :







.

, , , Three.js .





. , Three.js .

, . , Three.js.

, : GitHub












:



<script type="text/javascript" src="../libs/stats.js"></script>






,

<div id="Stats-output"></div>






, тАУ , :



function initStats() { var stats = new Stats(); stats.setMode(0); stats.domElement.style.position = 'absolute'; stats.domElement.style.left = '0px'; stats.domElement.style.top = '0px'; $("#Stats-output").append(stats.domElement ); return stats; }






. setMode



(). 0, FPS, 1, . FPS, 0. jQuery :



$(function () { var stats = initStats(); тАж }





render():

function render() { stats.update(); ... requestAnimationFrame(render); renderer.render(scene, camera); }





, , :









requestAnimationFrame



() . render



() , . :



function render() { ... cube.rotation.x += 0.02; cube.rotation.y += 0.02; cube.rotation.z += 0.02; ... requestAnimationFrame(render); renderer.render(scene, camera); }





, ? тАУ rotation



0,02 render



(), . , , .





render



() :



var step=0; function render() { ... step+=0.04; sphere.position.x = 20+( 10*(Math.cos(step))); sphere.position.y = 2 +( 10*Math.abs(Math.sin(step))); ... requestAnimationFrame(render); renderer.render(scene, camera); }





rotation



; position



. , , . . Math.cos()



Math.sin()



step



. . , step+=0.04



. :







.

, . 3D-, , , . , , . , .



dat.GUI

Google dat.GUI( ), . , , :



, dat.GUI , :



<script type="text/javascript" src="../libs/dat.gui.js"></script>





тАУ JavaScript , , , dat.GUI. JavaScript :



var controls = new function() { this.rotationSpeed = 0.02; this.bouncingSpeed = 0.03; }





: this.rotationSpeed



this.bouncingSpeed



. dat.GUI , :



var gui = new dat.GUI(); gui.add(controls, 'rotationSpeed',0,0.5); gui.add(controls, 'bouncingSpeed',0,0.5);





rotationSpeed



bouncingSpeed



0 0,5. , тАУ , render



, , dat.GUI, . :



function render() { ... cube.rotation.x += controls.rotationSpeed; cube.rotation.y += controls.rotationSpeed; cube.rotation.z += controls.rotationSpeed; step+=controls.bouncingSpeed; sphere.position.x = 20+( 10*(Math.cos(step))); sphere.position.y = 2 +( 10*Math.abs(Math.sin(step))); ... }





, , , :







.



ASCII

3D- . Three.js , , . , : ASCII . , -ASCII, . :



$("#WebGL-output").append(renderer.domElement);





:

var effect = new THREE.AsciiEffect( renderer ); effect.setSize(window.innerWidth, window.innerHeight ); $("#WebGL-output").append(effect.domElement);





. renderer.render(scene, camera), effect.render(scene,camera). :







.

, , , Three.js .





. , Three.js .

, . , Three.js.

, : GitHub












:



<script type="text/javascript" src="../libs/stats.js"></script>






,

<div id="Stats-output"></div>






, тАУ , :



function initStats() { var stats = new Stats(); stats.setMode(0); stats.domElement.style.position = 'absolute'; stats.domElement.style.left = '0px'; stats.domElement.style.top = '0px'; $("#Stats-output").append(stats.domElement ); return stats; }






. setMode



(). 0, FPS, 1, . FPS, 0. jQuery :



$(function () { var stats = initStats(); тАж }





render():

function render() { stats.update(); ... requestAnimationFrame(render); renderer.render(scene, camera); }





, , :









requestAnimationFrame



() . render



() , . :



function render() { ... cube.rotation.x += 0.02; cube.rotation.y += 0.02; cube.rotation.z += 0.02; ... requestAnimationFrame(render); renderer.render(scene, camera); }





, ? тАУ rotation



0,02 render



(), . , , .





render



() :



var step=0; function render() { ... step+=0.04; sphere.position.x = 20+( 10*(Math.cos(step))); sphere.position.y = 2 +( 10*Math.abs(Math.sin(step))); ... requestAnimationFrame(render); renderer.render(scene, camera); }





rotation



; position



. , , . . Math.cos()



Math.sin()



step



. . , step+=0.04



. :







.

, . 3D-, , , . , , . , .



dat.GUI

Google dat.GUI( ), . , , :



, dat.GUI , :



<script type="text/javascript" src="../libs/dat.gui.js"></script>





тАУ JavaScript , , , dat.GUI. JavaScript :



var controls = new function() { this.rotationSpeed = 0.02; this.bouncingSpeed = 0.03; }





: this.rotationSpeed



this.bouncingSpeed



. dat.GUI , :



var gui = new dat.GUI(); gui.add(controls, 'rotationSpeed',0,0.5); gui.add(controls, 'bouncingSpeed',0,0.5);





rotationSpeed



bouncingSpeed



0 0,5. , тАУ , render



, , dat.GUI, . :



function render() { ... cube.rotation.x += controls.rotationSpeed; cube.rotation.y += controls.rotationSpeed; cube.rotation.z += controls.rotationSpeed; step+=controls.bouncingSpeed; sphere.position.x = 20+( 10*(Math.cos(step))); sphere.position.y = 2 +( 10*Math.abs(Math.sin(step))); ... }





, , , :







.



ASCII

3D- . Three.js , , . , : ASCII . , -ASCII, . :



$("#WebGL-output").append(renderer.domElement);





:

var effect = new THREE.AsciiEffect( renderer ); effect.setSize(window.innerWidth, window.innerHeight ); $("#WebGL-output").append(effect.domElement);





. renderer.render(scene, camera), effect.render(scene,camera). :







.

, , , Three.js .





. , Three.js .

, . , Three.js.

, : GitHub















All Articles