Three.js cube
How do I make an three.js cube?
What is a three.js cube? How do you make a three.js cube? This script and codes were developed by Ali Klein on 11 July 2022, Monday.
Three.js cube - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Three.js cube</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <script src='https://cdnjs.cloudflare.com/ajax/libs/three.js/r75/three.min.js'></script>
<script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.2/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
Three.js cube - Script Codes CSS Codes
body { margin: 0; background-color: #729f98;
}
canvas { width: 300px; height: 300px; position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
}
Three.js cube - Script Codes JS Codes
var scene = new THREE.Scene();
var color = new THREE.Color( 0xff0000 ); camera = new THREE.PerspectiveCamera( 75, 300/300, 0.1, 1000 ); renderer = new THREE.WebGLRenderer(); renderer.setSize( 300, 300 ); renderer = new THREE.WebGLRenderer( { alpha: true } ); renderer.setClearColor( 0xffffff, 0 ); document.body.appendChild( renderer.domElement ); geometry = new THREE.BoxGeometry( 1, 1, 1 ); material = new THREE.MeshBasicMaterial({ color: 0xFFFFFF, wireframe: true, wireframeLinewidth: 2 }); cube = new THREE.Mesh( geometry, material ); scene.add( cube ); camera.position.z = 2; render = function () { requestAnimationFrame( render ); cube.rotation.x += 0.05; cube.rotation.y += 0.05; renderer.render(scene, camera); }; render();
Developer | Ali Klein |
Username | AliKlein |
Uploaded | July 11, 2022 |
Rating | 3 |
Size | 1,997 Kb |
Views | 72,864 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
Parallax Background Scroll | 3,150 Kb |
Buzzy Pen | 5,034 Kb |
VW Logo | 2,212 Kb |
David Bowie SVG Morph | 11,407 Kb |
Wobbly Button Snap SVG Morph | 3,130 Kb |
Canvas Portal Animation | 4,951 Kb |
Paper.js Play | 5,239 Kb |
Animated Hillary Clinton Donald Trump Logos SVG | 4,004 Kb |
Mobile Nav Menu | 4,745 Kb |
Speech Bubble Animation | 3,562 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
Project_one | MOHIM | 9,592 Kb |
Resize image | Happyhj | 1,892 Kb |
Haml Calendar | Katydecorah | 5,643 Kb |
SVG Icons Template | Legofsalmon | 2,618 Kb |
Gear | Elorenn | 2,048 Kb |
Default Input, Textareas, Submits, and Buttons in iOS | Demersdesigns | 2,334 Kb |
Pink expansion tunnel | Vez | 1,738 Kb |
About Mazano | Kiti | 2,585 Kb |
Svg animation draw | SzymonDziewonski | 5,545 Kb |
Wave Lines | Mikehobizal | 4,023 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!