Warpspeed
How do I make an warpspeed?
What is a warpspeed? How do you make a warpspeed? This script and codes were developed by Khalkeus on 11 November 2022, Friday.
Warpspeed - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>warpspeed</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <script src='https://cdnjs.cloudflare.com/ajax/libs/three.js/84/three.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
Warpspeed - Script Codes CSS Codes
body, html{ margin: 0px; padding: 0px; overflow: hidden;
}
canvas{ width: 100%; height: 100%;
}
Warpspeed - Script Codes JS Codes
function randomFloat(a, b){ var r = (Math.random() * (b - a) + a); return r;
}
function Star(material, x, y, size){ this.size = size; this.obj = new THREE.Geometry(); this.obj.vertices.push(new THREE.Vector3(0, 0, 0)); this.obj.vertices.push(new THREE.Vector3(0, 0, -size)); this.obj = new THREE.Line(this.obj, material); this.speed = randomFloat(1, 20); this.refresh = function(x, y){ this.obj.position.z = randomFloat(0, -1000); this.obj.position.x = x; this.obj.position.y = y; } this.refresh(x, y);
}
function Starfield(size, width, height){ this.stars = []; this.obj = new THREE.Group(); this.size = size; this.width = width; this.height = height; this.material = new THREE.LineBasicMaterial({color: 0xffffff}); this.init = function(){ for(var i = 0; i < this.size; i++){ this.stars.push(new Star(this.material, randomFloat(-this.width, this.width), randomFloat(-this.width, this.width), randomFloat(5, 100))); this.obj.add(this.stars[i].obj); } scene.add(this.obj); } this.init(); this.update = function(){ this.obj.rotation = camera.rotation for(var i = 0; i < this.size; i++){ if(this.stars[i].obj.position.z > 50){ this.stars[i].refresh(randomFloat(-this.width, this.width), randomFloat(-this.width, this.width)); } this.stars[i].obj.position.z += this.stars[i].speed; } }
}
var camera, renderer, scene, game, mouse, mouseDelta;
mouse = [0, 0];
mouseDelta = [0, 0];
window.onload = function(){ init();
}
function init(){ renderer = new THREE.WebGLRenderer({antialias: false}); scene = new THREE.Scene(); camera = new THREE.PerspectiveCamera(20, window.innerWidth/window.innerHeight, 0.1, 1000); renderer.setSize(window.innerWidth, window.innerHeight); document.body.appendChild(renderer.domElement); camera.position.z = 50; scene.background = new THREE.Color(0x000000); canvas = document.querySelector('#b canvas'); stars = new Starfield(100, 20, 20); render();
}
window.onresize = function(){ camera.aspect = window.innerWidth/window.innerHeight; camera.updateProjectionMatrix(); renderer.setSize(window.innerWidth, window.innerHeight);
}
window.onmousemove = function(e){ mouseDelta = [mouse[0] - e.clientX, mouse[1] - e.clientY]; mouse = [e.clientX, e.clientY];
}
function render(){ renderer.render(scene, camera); stars.update(); requestAnimationFrame(render);
}
Developer | Khalkeus |
Username | khalkeus |
Uploaded | November 11, 2022 |
Rating | 4 |
Size | 2,409 Kb |
Views | 20,240 |
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 |
Flowers | 2,588 Kb |
Square loading icons | 2,249 Kb |
Particle smoke | 2,887 Kb |
Boids iii | 2,947 Kb |
Metaballs | 2,277 Kb |
Planet Generator | 2,984 Kb |
Capybaras | 2,775 Kb |
Live pixel sorting | 2,314 Kb |
Particle fire | 3,152 Kb |
Color Name Game | 3,245 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 |
Awesome | Samarthpd | 2,901 Kb |
RRC wrapSwitch | Pshrmn | 2,922 Kb |
Filtering with shuffle.js | Deyand | 2,712 Kb |
Opening Reveal Modal On Document Ready | Winghouchan | 1,787 Kb |
TheCalendar.js | The-teacher | 6,330 Kb |
Single element checkbox | Ivijaygupta | 1,996 Kb |
A Pen by utcwebdev | Utcwebdev | 2,856 Kb |
Print element on a page | Mrs_snow | 2,081 Kb |
A Pen by Jay | Jaycode | 3,784 Kb |
Sticky footer testing | 75th | 1,649 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!