LOADING...

Preview

Pen ID
Unlock Campus Themeforest adv

 

CSS
html, body {
	width: 100%;
	height: 100%;
	overflow: hidden;
	padding: 0;
	margin: 0;
	background-color: #000;
}
JS
var scene = new THREE.Scene();
var camera = new THREE.PerspectiveCamera(90, window.innerWidth / window.innerHeight, 0.01, 100);
var renderer = new THREE.WebGLRenderer({});
renderer.setSize(window.innerWidth, window.innerHeight);
renderer.setClearColor(0x808080);
document.body.appendChild(renderer.domElement);
window.onresize = function() {
	renderer.setSize(window.innerWidth, window.innerHeight);
	camera.aspect = window.innerWidth / window.innerHeight;
	camera.updateProjectionMatrix();
};
var cube = new THREE.BoxBufferGeometry(1, 1, 1);
var face = new THREE.TextureLoader().load("https://s18.postimg.org/mvdokvgx5/Face.png"),
	lefthead = new THREE.TextureLoader().load("https://s18.postimg.org/epvmmqv95/Left_Head.png"),
	righthead = new THREE.TextureLoader().load("https://s18.postimg.org/fs5t5als9/Right_Head.png"),
	antiface = new THREE.TextureLoader().load("https://s18.postimg.org/rh9stafbt/Antiface.png"),
	tophead = new THREE.TextureLoader().load("https://s18.postimg.org/4skltnss9/Top_Head.png"),
	bottomhead = new THREE.TextureLoader().load("https://s18.postimg.org/v0vqj3xh5/Bottom_Head.png");
var textures = [face, antiface, tophead, bottomhead, righthead, lefthead];
for(i = 0; i < textures.length; i++) {
	textures[i].magFilter = THREE.NearestFilter;
}
var faceMat = new THREE.MeshBasicMaterial({map: face}),
	leftheadMat = new THREE.MeshBasicMaterial({map: lefthead}),
	rightheadMat = new THREE.MeshBasicMaterial({map: righthead}),
	antifaceMat = new THREE.MeshBasicMaterial({map: antiface}),
	topheadMat = new THREE.MeshBasicMaterial({map: tophead}),
	bottomheadMat = new THREE.MeshBasicMaterial({map: bottomhead});
var materials = [faceMat, antifaceMat, topheadMat, bottomheadMat, rightheadMat, leftheadMat];
var head = new THREE.Mesh(cube, materials);
head.position.set(0, 0, -5);
head.rotation.x += Math.PI / 12;
scene.add(head);
function update() {
	head.rotation.y -= 0.02;
}
function draw() {
	requestAnimationFrame(draw);
	update();
	renderer.render(scene, camera);
}
draw();
window.onmousedown = function() {
	head.rotation.x = -Math.PI / 12;
};
window.onmouseup = function() {
	head.rotation.x = Math.PI / 12;
};
var audio = new Audio("https://goo.gl/6eDCCY");
audio.volume = 1;
setInterval(function() {
	audio.play();
}, 5000);

Description

is truth no clickb8
Term
Sat, 04/14/2018 - 20:47

Related Codes

Pen ID
Pen ID
Pen ID
Square Adv