3D Tools
How do I make an 3d tools?
What is a 3d tools? How do you make a 3d tools? This script and codes were developed by Sarah Cartwright on 05 December 2022, Monday.
3D Tools - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>3D Tools</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> This Pen does nothing on its own - it is used in other pens. <script src="js/index.js"></script>
</body>
</html>
3D Tools - Script Codes CSS Codes
body { padding: 10px; margin: 0px; background: #2e2e2e; color: #909090; font: 12px arial, sans-serif;
}
3D Tools - Script Codes JS Codes
var trig = new _trigCached();
function _trigCached(){ this.sine = [], this.cosine = []; //Create cached sin/cos values for(var a = 0; a < 36000; a++){ this.sine.push(Math.sin((a/100)/180*Math.PI)); this.cosine.push(Math.cos((a/100)/180*Math.PI)); }
}
//Square shaped explosions.
function newVector(shape){ // Something's wrong with my LFSR, using slow version of rand.... var vx = randomRealRangeSlow(shape.xMin, shape.xMax), vy = randomRealRangeSlow(shape.yMin, shape.yMax), vz = randomRealRangeSlow(shape.zMin, shape.zMax); var p = randomRealRangeSlow(shape.minPower, shape.maxPower); return {x: vx*p, y: vy*p, z: vz*p};
}
//A more rounded bang.
function newRoundVector(shape){ // Something's wrong with my LFSR, using slow version of rand.... var pitch = randomIntRangeSlow(0, 36000), yaw = randomIntRangeSlow(0, 36000); var vx = trig.sine[pitch] * trig.cosine[yaw], vy = trig.sine[pitch] * trig.sine[yaw], vz = trig.cosine[pitch]; /* var pitch = randomRealRangeSlow(0, 360) / 180 * Math.PI, yaw = randomRealRangeSlow(0, 360) / 180 * Math.PI; var vx = Math.sin(pitch) * Math.cos(yaw), vy = Math.sin(pitch) * Math.sin(yaw), vz = Math.cos(pitch); */ var p = randomRealRangeSlow(shape.minPower, shape.maxPower); return {x: vx*p, y: vy*p, z: vz*p};
}
function _3DPoint(){ this.x = 0; this.y = 0; this.z = 0; this.x2 = 0; this.y2 = 0; this.z2 = 0; this.xx = 0; this.yy = 0; this.zz = 0; this.xv = 0; this.yv = 0; this.zv = 0; this.screenX = 0; this.screenY = 0; this.scale = 0;
}
_3DPoint.prototype.updatePosition = function(){ this.x += this.xv; this.y += this.yv; this.z += this.zv;
}
_3DPoint.prototype.rotate = function(rotX, rotY, rotZ){ this.xx = this.x * trig.cosine[rotX] - this.y * trig.sine[rotX]; this.yy = this.x * trig.sine[rotX] + this.y * trig.cosine[rotX]; this.y2 = this.yy * trig.cosine[rotY] - this.z * trig.sine[rotY]; this.zz = this.yy * trig.sine[rotY] + this.z * trig.cosine[rotY]; this.x2 = this.xx * trig.cosine[rotZ] - this.zz * trig.sine[rotZ]; this.z2 = this.xx * trig.sine[rotZ] + this.zz * trig.cosine[rotZ];
}
_3DPoint.prototype.calculateScreenPosition = function(rotX, rotY, rotZ, cameraX, cameraY, cameraZ, perspective){ this.rotate(rotX, rotY, rotZ); this.x2 += cameraX; this.y2 += cameraY; this.z2 += cameraZ; this.scale = 350 / (this.z2 * perspective); this.screenX = (this.x2 * 400) * this.scale; this.screenY = (this.y2 * 400) * this.scale;
}
function dynamicSort(property) { var sortOrder = 1; if(property[0] === "-") { sortOrder = -1; property = property.substr(1); } return function (a,b) { var result = (a[property] < b[property]) ? -1 : (a[property] > b[property]) ? 1 : 0; return result * sortOrder; }
}
function compare(a, b) { if (a.point.z2 < b.point.z2) return 1; if (a.point.z2 > b.point.z2) return -1; return 0;
}
Developer | Sarah Cartwright |
Username | SarahC |
Uploaded | December 05, 2022 |
Rating | 3 |
Size | 2,502 Kb |
Views | 12,144 |
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 |
OLED Emulator - Sprites | 7,784 Kb |
Canvas view-type arrays | 3,013 Kb |
3D Fireworks | 5,096 Kb |
Iocaine Powder - by Dan Egnor | 5,731 Kb |
Bump Mapping Three.js | 2,570 Kb |
OLED Emulator - Horizontal bytes | 5,745 Kb |
Blue balls and fireflies. | 4,057 Kb |
Tinted image renderer | 2,176 Kb |
Date Words | 3,352 Kb |
Firework - Smoke types | 7,632 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 |
Client-side Email Validation | Collizo4sky | 1,538 Kb |
A Pen by Stan Williams | Stanssongs | 6,706 Kb |
JQuery FullScreen Overlay | _codemics | 2,252 Kb |
Tree growth tests | Orchard | 3,818 Kb |
Eunice A | Ejbronze | 2,203 Kb |
A Pen by Eka Risyana | Risyana | 3,705 Kb |
CSS3 Diamond | Rendro | 1,960 Kb |
Wikipedia Viewer | Codinger | 4,681 Kb |
Google Fonts Sass Mixin | HugoGiraudel | 4,237 Kb |
Responsive Minimal Blog Layout | Hackthevoid | 5,261 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!