This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body { | |
margin: 0; | |
} | |
canvas { | |
display: block; | |
} | |
video { | |
display: none; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE > | |
<html> | |
<head> | |
<meta charset="UTF-8" /> | |
<style> | |
body { | |
margin: 0; | |
} | |
canvas { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function deCasteljauAlgorithm(points, t) { | |
if (t === 1) return points[points.length - 1]; | |
if (t === 0 || points.length === 1) return points[0]; | |
const calculatedPoints = []; | |
for (let i = 1; i < points.length; i++) { | |
const [p1X, p1Y] = points[i - 1]; | |
const [p2X, p2Y] = points[i]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Vector3 } from 'https://cdn.skypack.dev/three'; | |
const tempVector = new Vector3(); | |
function deCasteljauAlgorithm(vectors, t) { | |
if (t === 1) return vectors[vectors.length - 1]; | |
if (t === 0 || vectors.length === 1) return vectors[0]; | |
const calculatedVectors = []; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// rollup.config.js (builds src/api => api -- use `rollup -c` to build) | |
import { join } from 'path'; | |
import { mkdirSync, copyFileSync, statSync, readdirSync } from 'fs'; | |
import babel from '@rollup/plugin-babel'; | |
import resolve from '@rollup/plugin-node-resolve'; | |
const API_DIR = join(process.cwd(), 'src/api'); | |
const BUILD_DIR = join(process.cwd(), 'api'); | |
// Copy package.json to build dir |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as THREE from 'three' | |
import { Asset } from 'expo-asset' | |
/** | |
* Generates an asset based on input type. | |
*/ | |
const getAsset = (input) => { | |
if (input instanceof Asset) return input | |
switch (typeof input) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Constructs a WebGL FBO with MRT and multi-sampling. | |
*/ | |
export class WebGLFBO { | |
readonly gl: WebGL2RenderingContext | |
readonly width: number | |
readonly height: number | |
readonly count: number | |
readonly samples: number | |
readonly frameBuffer: WebGLFramebuffer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* react-native example using R3F v7. | |
* | |
* Dependencies: | |
* - @react-three/fiber 7.0.29 | |
* - react 17.0.1 | |
* - react-native 0.68.2 | |
* - expo-gl 11.3.0 | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as THREE from 'three' | |
import { Asset } from 'expo-asset' | |
/** | |
* Generates an asset based on input type. | |
*/ | |
const getAsset = (input) => { | |
if (input instanceof Asset) return input | |
switch (typeof input) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/node_modules/react-native/Libraries/Blob/BlobManager.js b/node_modules/react-native/Libraries/Blob/BlobManager.js | |
index 0d4cee7..9e39534 100644 | |
--- a/node_modules/react-native/Libraries/Blob/BlobManager.js | |
+++ b/node_modules/react-native/Libraries/Blob/BlobManager.js | |
@@ -14,6 +14,7 @@ const BlobRegistry = require('./BlobRegistry'); | |
import type {BlobData, BlobOptions, BlobCollector} from './BlobTypes'; | |
import NativeBlobModule from './NativeBlobModule'; | |
import invariant from 'invariant'; | |
+import { getBlobForArrayBuffer } from 'react-native-blob-jsi-helper'; | |
OlderNewer