Three test
How do I make an three test?
What is a three test? How do you make a three test? This script and codes were developed by Esambino Wei Cheng Hsieh on 07 January 2023, Saturday.
Three test - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>three test</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r58/three.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/dat-gui/0.5/dat.gui.min.js"></script> <script src="js/index.js"></script>
</body>
</html>
Three test - Script Codes CSS Codes
body { background-color: #111; margin: 0px auto; overflow: hidden; text-align: center;
}
Three test - Script Codes JS Codes
var SCREEN_WIDTH = window.innerWidth, SCREEN_HEIGHT = window.innerHeight, mouseX = 0, mouseY = 0, windowHalfX = window.innerWidth / 2, windowHalfY = window.innerHeight / 2, SEPARATION = 300, AMOUNTX = 10, AMOUNTY = 10, camera, scene, renderer; init(); animate(); function init() { var container, separation = 100, amountX = 50, amountY = 50, particles, particle; container = document.createElement('div'); document.body.appendChild(container); camera = new THREE.PerspectiveCamera( 75, SCREEN_WIDTH / SCREEN_HEIGHT, 1, 10000 ); camera.position.z = 1000; scene = new THREE.Scene(); renderer = new THREE.CanvasRenderer(); renderer.setSize( SCREEN_WIDTH, SCREEN_HEIGHT ); container.appendChild( renderer.domElement ); // particles var PI2 = Math.PI * 2; var material = new THREE.ParticleCanvasMaterial( { color: 0xffffff, program: function ( context ) { context.beginPath(); context.arc( 0, 0, 1, 0, PI2, true ); context.fill(); } } ); for ( var i = 0; i < 500; i ++ ) { particle = new THREE.Particle( material ); particle.position.x = Math.random() * 2 - 1; particle.position.y = Math.random() * 2 - 1; particle.position.z = Math.random() * 2 - 1; particle.position.normalize(); particle.position.multiplyScalar( Math.random() * 10 + 550 ); scene.add( particle ); } document.addEventListener( 'mousemove', onDocumentMouseMove, false ); document.addEventListener( 'touchstart', onDocumentTouchStart, false ); document.addEventListener( 'touchmove', onDocumentTouchMove, false ); // window.addEventListener( 'resize', onWindowResize, false ); } function onWindowResize() { windowHalfX = window.innerWidth / 2; windowHalfY = window.innerHeight / 2; camera.aspect = window.innerWidth / window.innerHeight; camera.updateProjectionMatrix(); renderer.setSize( window.innerWidth, window.innerHeight ); } // function onDocumentMouseMove(event) { mouseX = event.clientX - windowHalfX; mouseY = event.clientY - windowHalfY; } function onDocumentTouchStart( event ) { if ( event.touches.length > 1 ) { event.preventDefault(); mouseX = event.touches[ 0 ].pageX - windowHalfX; mouseY = event.touches[ 0 ].pageY - windowHalfY; } } function onDocumentTouchMove( event ) { if ( event.touches.length == 1 ) { event.preventDefault(); mouseX = event.touches[ 0 ].pageX - windowHalfX; mouseY = event.touches[ 0 ].pageY - windowHalfY; } } // function animate() { requestAnimationFrame( animate ); render(); } function render() { camera.position.x += ( mouseX - camera.position.x ) * .05; camera.position.y += ( - mouseY + 200 - camera.position.y ) * .05; camera.lookAt( scene.position ); renderer.render( scene, camera ); }
Developer | Esambino Wei Cheng Hsieh |
Username | Esambino |
Uploaded | January 07, 2023 |
Rating | 3 |
Size | 2,541 Kb |
Views | 8,096 |
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 |
Scroll | 6,259 Kb |
Tribute to Rorschach | 29,121 Kb |
My first gsap | 4,655 Kb |
Gdf | 3,884 Kb |
0000 | 3,281 Kb |
Css3 slider | 3,024 Kb |
Cafe Lakulaku | 3,580 Kb |
Blank | 5,630 Kb |
Practice hover | 1,919 Kb |
Apple iPhone 5s style scrolling | 5,971 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 |
A Pen by Malith Hettiarachchi | MalZiiirA | 5,531 Kb |
TheCalendar.js | The-teacher | 6,330 Kb |
After America | Jonathangarner | 2,686 Kb |
Easing | GreenSock | 2,043 Kb |
A form arranged using automatic placement. | Vikasford | 2,103 Kb |
Headroom.js demo | WickyNilliams | 3,982 Kb |
Cut and Paste Roll Link | BottomlineInteractive | 2,546 Kb |
A Pen by Paul Sullivan | Pwsm50 | 2,349 Kb |
The Fantastic Mr Fox | MalZiiirA | 10,435 Kb |
Fullscreen audio play button | 72 | 2,148 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!