Skip to content

Commit

Permalink
init commit
Browse files Browse the repository at this point in the history
  • Loading branch information
jinpyojeon committed Apr 25, 2017
0 parents commit 8f78238
Show file tree
Hide file tree
Showing 3 changed files with 913 additions and 0 deletions.
11 changes: 11 additions & 0 deletions main.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<html>

<head>
<script type="text/javascript" src="src/three.min.js"></script>
<script type="text/javascript" src="main.js"></script>
</head>

<body>
</body>

</html>
37 changes: 37 additions & 0 deletions main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
var scene, camera, renderer;
var geometry, material, mesh;

init();
animate();

function init() {

scene = new THREE.Scene();

camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 1, 10000);
camera.position.z = 1000;

geometry = new THREE.BoxGeometry(200, 200, 200);
material = new THREE.MeshBasicMaterial({ color: 0xff0000, wireframe: true });

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

renderer = new THREE.WebGLRenderer();
renderer.setSize(window.innerWidth, window.innerHeight);

window.onload = function() {
document.body.appendChild(renderer.domElement);
}
}

function animate() {

requestAnimationFrame(animate);

mesh.rotation.x += 0.01;
mesh.rotation.y += 0.02;

renderer.render(scene, camera);

}
Loading

0 comments on commit 8f78238

Please sign in to comment.