threejs

import * as THREE from './js/three.module.js';

let camera, scene, renderer;
let geometry, material, mesh;

init();

function init() {

	camera = new THREE.PerspectiveCamera( 70, window.innerWidth / window.innerHeight, 0.01, 10 );
	camera.position.z = 1;

	scene = new THREE.Scene();

	geometry = new THREE.BoxGeometry( 0.2, 0.2, 0.2 );
	material = new THREE.MeshNormalMaterial();

	mesh = new THREE.Mesh( geometry, material );
	scene.add( mesh );

	renderer = new THREE.WebGLRenderer( { antialias: true } );
	renderer.setSize( window.innerWidth, window.innerHeight );
	renderer.setAnimationLoop( animation );
	document.body.appendChild( renderer.domElement );

}

function animation( time ) {

	mesh.rotation.x = time / 2000;
	mesh.rotation.y = time / 1000;

	renderer.render( scene, camera );

}

3.5
4
Third News 105 points

                                    <script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r123/three.js"
        integrity="sha512-8Yom5spEjD3HeZTNoDiOm4Y4Rn3RVKUFpiqTM4I3RIIO0u8e2m7XjT5rG1GQNHJlVcD9EZrzn+itENl4C6112A=="
        crossorigin="anonymous"></script>

3.5 (4 Votes)
0
Are there any code examples left?
Create a Free Account
Unlock the power of data and AI by diving into Python, ChatGPT, SQL, Power BI, and beyond.
Sign up
Develop soft skills on BrainApps
Complete the IQ Test
Relative searches
threejs node js what is made with three.js things you can do with three.js three.js node,js three.js node.js threejs node.js three-es javascript can I use three.js what is three.js used for can i use three.js with javascript ? can use three.js with javascript ? three.js javascript three js guide Three.js) three.jss three js habr three js three three js create a three three js create three javascript three js three.js ik node threejs three.jjs interactive three.js three js jans THREE.js html node js three three js in nodejs three.js basic three js basic three.js a three js .org three js node js three js node browser what can i do with three js what is three node js three js in javascript three js in node three js' three javascript three js browser what three js three.js information threenodes.js Three.js .org threejs web using three js three js example threejs from nodejs wht is three.js three-ik.js three js new threejs node how to use three.js three js framework how to use three.js in nodejs three js script what is three js Three js interactive whAT IS THE three.js js THREE three js plain nodejs and threejs nodejs and threes three.js s three js org threes js threee.js threes.js three js node three.js org what is three.js three js nodejs three js three .js js/three.js three . js threee js three js.org Three.js. using threejs threer.js three.js, javascript three.js what is threejs doc three.js node three js examples thre.js Three. js. Three. js thee js three js three ... in js THREEg.js tree.js treen js thee.js three.js three js tree js threejs
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source