How to Create a 3D Rotating Cube in Javascript | ThreeJS | Basic Explanation

preview_player
Показать описание
How to Create a 3D Rotating Cube in Javascript, using ThreeJS!
In this video you will find a detailed explanation for beginners to the world of 3D Rendering using the WebGL Library ThreeJS.

ThreeJS is a Javascript Library which makes it simple to use WebGL components in our web applications.

Download the ~500KB ThreeJS library:

Like the video to support future videos. Subscribe to know more interesting stuff about the coding world.

Here is the finished Javascript code from the Video:
--START OF CODE--

var scene = new THREE.Scene();
var camera = new THREE.PerspectiveCamera(
0.5, 1000
);

var renderer = new THREE.WebGLRenderer();

//Cube
var geometry = new THREE.BoxGeometry(1, 1, 1);
var material = new THREE.MeshNormalMaterial({color: 0x00aaff});

var cube = new THREE.Mesh(geometry, material);

function animate(){
requestAnimationFrame(animate);

}

animate();

--END OF CODE--

Subscribe to the channel :)
Рекомендации по теме
Комментарии
Автор

I'm Japanese so, I can't English very well, but I understand this. It's good! Thank you!

笑笑笑笑笑笑-rf
Автор

The Javascript code can be found in the Description :)
Also, there was a spelling error: "roation" instead of "rotation" once in the vid, which I removed and replaced with the animate function anyway

majormango
Автор

'new THREE.Scene()' is correct.

nil
visit shbcf.ru