Uber-vs-zadvorsky-1.0.0

Developer
Size
7,311 Kb
Views
6,072

How do I make an uber-vs-zadvorsky-1.0.0?

Attempting to replicate one of uber's luma examples, using the zadvorsky method. What is a uber-vs-zadvorsky-1.0.0? How do you make a uber-vs-zadvorsky-1.0.0? This script and codes were developed by Not Important on 04 January 2023, Wednesday.

Uber-vs-zadvorsky-1.0.0 Previews

Uber-vs-zadvorsky-1.0.0 - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>uber-vs-zadvorsky-1.0.0</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div id="js-app"></div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-polyfill/6.20.0/polyfill.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/84/three.min.js"></script>
<script src="https://threejs.org/examples/js/controls/OrbitControls.js"></script>
<script src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/292951/three.bas.js"></script>
<script>(function(){var script=document.createElement('script');script.onload=function(){var stats=new Stats();document.body.appendChild(stats.dom);requestAnimationFrame(function loop(){stats.update();requestAnimationFrame(loop)});};script.src='//rawgit.com/mrdoob/stats.js/master/build/stats.min.js';document.head.appendChild(script);})()</script> <script src="js/index.js"></script>
</body>
</html>

Uber-vs-zadvorsky-1.0.0 - Script Codes CSS Codes

body { margin: 0; padding: 0; background-color: #000;
}
canvas { display: block; margin: 0 auto;
}

Uber-vs-zadvorsky-1.0.0 - Script Codes JS Codes

'use strict';
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
setTimeout(function () { var boxRipple = new BoxRipple(256, 1.5, 2, 0); // size, cubeSize, duration, maxDelay new Simulation('js-app', [boxRipple], [28, 36, -64]); // domNode, entities, [cameraX, cameraY, cameraZ]
}, 0);
var BoxRipple = function (_THREE$Mesh) { _inherits(BoxRipple, _THREE$Mesh); BoxRipple.createMaterial = function createMaterial() { return new THREE.BAS.PhongAnimationMaterial({ shading: THREE.FlatShading, side: THREE.FrontSide, uniforms: { uTime: { value: 0 }, uDuration: { value: 0 } }, uniformValues: {}, varyingParameters: ['varying vec3 vColor;'], vertexFunctions: [THREE.BAS.ShaderChunk['quaternion_rotation'], THREE.BAS.ShaderChunk['ease_cubic_in_out']], vertexParameters: ['uniform float uTime;', 'uniform float uDuration;', 'attribute vec2 aDelayDuration;', 'attribute vec3 aVOffset;', 'attribute vec4 aRotation;', 'attribute vec3 aColor;'], vertexInit: ['float seed = 5625463739.0;', 'float time = mod(uTime, uDuration);', 'float tProgress = clamp(time - aDelayDuration.x, 0.0, aDelayDuration.y) / aDelayDuration.y;', // 'tProgress = easeCubicInOut(tProgress);', 'vec4 tQuatOrient = quatFromAxisAngle(aRotation.xyz, aRotation.w * tProgress);'], vertexNormal: [], vertexPosition: ['transformed = rotateVector(tQuatOrient, transformed);', 'float delta = length(aVOffset);', 'transformed += aVOffset + vec3(0.0, sin(((uTime * 10.0) + delta) * 0.125) * 8.0, 0.0);'], vertexColor: ['vColor = aColor;'], fragmentFunctions: [], fragmentParameters: [], fragmentInit: [], fragmentMap: [], fragmentDiffuse: ['diffuseColor.xyz = vColor;'] }); }; BoxRipple.assignProps = function assignProps(geometry, duration, maxDelay) { var size = arguments.length <= 3 || arguments[3] === undefined ? 256 : arguments[3]; var cubeSize = arguments.length <= 4 || arguments[4] === undefined ? 1 : arguments[4]; var aDelayDuration = geometry.createAttribute('aDelayDuration', 2); var aColor = geometry.createAttribute('aColor', 3); var aRotation = geometry.createAttribute('aRotation', 4); var aVOffset = geometry.createAttribute('aVOffset', 3); for (var z = 0; z < size; z++) { var zPos = (-size + 1) * 3 / 2 + z * 3; for (var x = 0; x < size; x++) { var index = z * size + x; var xPos = (-size + 1) * 3 / 2 + x * 3; var position = new THREE.Vector3(xPos, 0, zPos); geometry.setPrefabData(aVOffset, index, position.toArray()); var color = new THREE.Vector3(Math.random() * 0.75 + 0.25, Math.random() * 0.75 + 0.25, Math.random() * 0.75 + 0.25); geometry.setPrefabData(aColor, index, color.toArray()); var rotation = new THREE.Vector3(Math.random() * 2 - 1, Math.random() * 2 - 1, Math.random() * 2 - 1); rotation.normalize(); // ew, not functional geometry.setPrefabData(aRotation, index, [].concat(rotation.toArray(), [Math.PI * 2])); var delay = Math.random() * maxDelay; var delayDuration = new THREE.Vector2(delay, duration); geometry.setPrefabData(aDelayDuration, index, delayDuration.toArray()); } } }; function BoxRipple(size, cubeSize, duration, maxDelay) { _classCallCheck(this, BoxRipple); var totalDuration = duration + maxDelay; var boxGeometry = new THREE.BoxGeometry(cubeSize, cubeSize, cubeSize); var geometry = new THREE.BAS.PrefabBufferGeometry(boxGeometry, size * size); geometry.computeVertexNormals(); geometry.bufferUvs(); BoxRipple.assignProps(geometry, duration, maxDelay, size, cubeSize); var material = BoxRipple.createMaterial(); material.uniforms.uDuration.value = totalDuration; // refactor, not the right place for this var _this = _possibleConstructorReturn(this, _THREE$Mesh.call(this, geometry, material)); _this.frustumCulled = false; return _this; } _createClass(BoxRipple, [{ key: 'time', get: function get() { return this.material.uniforms.uTime.value; }, set: function set(newTime) { this.material.uniforms.uTime.value = newTime; } }]); return BoxRipple;
}(THREE.Mesh);
var Simulation = function () { function Simulation(domId, entities, _ref) { var cameraX = _ref[0]; var cameraY = _ref[1]; var cameraZ = _ref[2]; _classCallCheck(this, Simulation); var camera = this.createCamera(55, cameraX, cameraY, cameraZ, window.innerWidth, window.innerHeight); camera.target = new THREE.Vector3(0, 0, 0); camera.lookAt(camera.target); var scene = new THREE.Scene(); this.createLights(scene); var renderer = this.createRenderer(0x000000); document.getElementById(domId).appendChild(renderer.domElement); var handleWindowResize = this.onWindowResize(camera, renderer); handleWindowResize(); window.addEventListener('resize', handleWindowResize, false); entities.map(function (e, i) { scene.add(e); }); var controls = null; // this.createControls(camera) this.animate(renderer, scene, camera, controls, entities, +new Date()); } Simulation.prototype.createControls = function createControls(camera) { var controls = new THREE.OrbitControls(camera); controls.enablePan = false; controls.minDistance = 3; controls.maxDistance = 2000; // controls.maxPolarAngle = Math.PI * 0.4 controls.target.set(0, 0, 0); return controls; }; Simulation.prototype.onWindowResize = function onWindowResize(camera, renderer) { return function (event) { var width = window.innerWidth; var height = window.innerHeight; camera.aspect = width / height; camera.updateProjectionMatrix(); renderer.setSize(width, height); }; }; Simulation.prototype.animate = function animate(renderer, scene, camera, controls, entities, lastTime) { var _this2 = this; var currentTime = +new Date(); var timeDelta = currentTime - lastTime; entities.forEach(function (e) { return e.time += timeDelta / 1000; }); requestAnimationFrame(function () { _this2.animate(renderer, scene, camera, controls, entities, currentTime); }); camera.position.x = Math.cos(currentTime * 0.00025) * 256 / 2 + 16; camera.position.y = (Math.sin(currentTime * 0.000175) + 1) * 256 / 2 + 5; camera.position.z = Math.sin(currentTime * 0.0003) * 256 / 2 + 12; camera.lookAt(new THREE.Vector3(0, 0, 0)); // controls.update() renderer.render(scene, camera); }; Simulation.prototype.createCamera = function createCamera(fov) { var x = arguments.length <= 1 || arguments[1] === undefined ? 0 : arguments[1]; var y = arguments.length <= 2 || arguments[2] === undefined ? 0 : arguments[2]; var z = arguments.length <= 3 || arguments[3] === undefined ? 0 : arguments[3]; var width = arguments[4]; var height = arguments[5]; var camera = new THREE.PerspectiveCamera(fov, width / height, 0.5, 30000); camera.position.x = x; camera.position.y = y; camera.position.z = z; return camera; }; Simulation.prototype.createLights = function createLights(scene) { scene.add(new THREE.AmbientLight(0x444444)); scene.add(new THREE.DirectionalLight(0xffffff)); /* const light = new THREE.DirectionalLight(0x00ffff) light.position.y = -1 scene.add(light) */ }; Simulation.prototype.createRenderer = function createRenderer() { var clearColor = arguments.length <= 0 || arguments[0] === undefined ? 0x000000 : arguments[0]; var renderer = new THREE.WebGLRenderer({ antialias: true, alpha: true }); renderer.setPixelRatio(window.devicePixelRatio); renderer.autoClear = false; renderer.setClearColor(clearColor, 0); return renderer; }; return Simulation;
}();
Uber-vs-zadvorsky-1.0.0 - Script Codes
Uber-vs-zadvorsky-1.0.0 - Script Codes
Home Page Home
Developer Not Important
Username clindsey
Uploaded January 04, 2023
Rating 4.5
Size 7,311 Kb
Views 6,072
Do you need developer help for Uber-vs-zadvorsky-1.0.0?

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!

Not Important (clindsey) Script Codes
Create amazing blog posts with AI!

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!