Revision: 06.08.2023, https://compute.toys/view/398
fn sdCircle(p: vec2f, r: f32) -> f32 {
return length(p) - r;
}| /* Ultra lightweight Github REST Client */ | |
| // original inspiration via https://gist.github.com/v1vendi/75d5e5dad7a2d1ef3fcb48234e4528cb | |
| const token = 'github-token-here' | |
| const githubClient = generateAPI('https://api.github.com', { | |
| headers: { | |
| 'User-Agent': 'xyz', | |
| 'Authorization': `bearer ${token}` | |
| } | |
| }) |
| const randomVectorInCone = (theta: number, target: THREE.Vector3) => { | |
| const z = remap(Math.random(), [0, 1], [Math.cos(theta), 1]) | |
| const phi = remap(Math.random(), [0, 1], [0, 2 * Math.PI]) | |
| target.set( | |
| Math.sqrt(1 - z * z) * Math.cos(phi), | |
| Math.sqrt(1 - z * z) * Math.sin(phi), | |
| z | |
| ) | |
| target.normalize() |
Revision: 06.08.2023, https://compute.toys/view/398
fn sdCircle(p: vec2f, r: f32) -> f32 {
return length(p) - r;
}Revision: 06.08.2023, https://compute.toys/view/407
fn sdSphere(p: vec3f, r: f32) -> f32 {
return length(p) - r;
}| /** | |
| * I needed a property wrapper that fulfilled the following four requirements: | |
| * | |
| * 1. Values are stored in UserDefaults. | |
| * 2. Properties using the property wrapper can be used with SwiftUI. | |
| * 3. The property wrapper exposes a Publisher to be used with Combine. | |
| * 4. The publisher is only called when the value is updated and not | |
| * when_any_ value stored in UserDefaults is updated. | |
| * | |
| * First I tried using SwiftUI's builtin @AppStorage property wrapper |
💡 These steps will become easier, less technical, and more accessible as more open tools begin to emerge around Hicetnunc pinning. The steps below assume macOS but should work similarly across other platforms. This gist can be seen as a working draft toward more polished documentation; if you see any issues please post a comment below.
Hicetnunc.xyz aims to be "decentralized" which means the OBJKTs are owned by the users, not the platform. So, in theory, if hicetnunc disappears, another marketplace could emerge on the same (user-owned) assets. But, this paradigm of decentralization means that you own the assets; so the responsibility to maintain them lies on the users, not the platform.
Of course, hicetnunc and some of its users will probably also make an effort to help maintain all the assets on its platform; but you should not rely purely on that, as it goes against the core ethos of dec
On Mac, SwiftUI's .onHover closure is not always called on mouse exit, particularly with high cursor velocity. A grid of targets or with finer target shapes will often have multiple targets falsely active after the mouse has moved on.
It is easy to run back to AppKit's safety. Below is a SwiftUI-like modifier for reliable mouse-tracking. You can easily adapt it for other mouse tracking needs.
import SwiftUIThe package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.
This means you have the following choices:
import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.await import(…) from CommonJS instead of require(…).| //MIT License | |
| //Copyright (c) 2021 Felix Westin | |
| //Source: https://github.com/Fewes/MinimalAtmosphere | |
| //Ported to GLSL by Marcin Ignac | |
| #ifndef ATMOSPHERE_INCLUDED | |
| #define ATMOSPHERE_INCLUDED | |
| // ------------------------------------- |
| /** | |
| * Use the Web Storage API to save camera position and target between page refreshes. | |
| * | |
| * @param {Object} options | |
| * @param {*} options.camera - The camera you want to store the position of. | |
| * @param {*} [options.controls] - A controls object with a `.target` property. | |
| * @param {String} [options.name="main"] - An optional label. Useful if you want to store multiple cameras. | |
| * @param {Boolean} [options.session=true] - Indicates if you want to use local or session storage. | |
| * See https://developer.mozilla.org/en-US/docs/Web/API/Storage | |
| */ |