Skip to content

Instantly share code, notes, and snippets.

@wonglok
wonglok / index.html
Created Jun 14, 2022 — forked from BlueMagnificent/index.html
Javascript 3D Physics Snippet Four
View index.html
<html>
<head>
<meta charset="utf-8">
<title>JS 3D Physics</title>
<style>
body { margin: 0; }
</style>
</head>
<body>
<script src="js/three.js"></script>
View tryme.js
import { OrbitControls } from "@react-three/drei";
import { Canvas } from "@react-three/fiber";
import { Bloomer } from "../vfx-library/Bloomer";
import { ENLogicGraphAutoLoad } from "../vfx-runtime/ENLogicGraph";
export default function TryMe() {
let REPLACE_ME = `-MvpfxG3QZ37safQAPJS`;
return (
<Canvas dpr={3}>
{/* content-sphere */}
@wonglok
wonglok / effect node by you rules json.js
Last active Feb 14, 2022
effect node by you rules json
View effect node by you rules json.js
{
"rules": {
".read": true,
".write": false,
//
//
"profile": {
"$owner_user_id": {
".read": "true",
@wonglok
wonglok / AppExample.js
Last active Feb 12, 2022
Per-Pixel-Glow-Threejs with FXAA
View AppExample.js
<AppMiniAPI>
{({ api }) => {
return (
<Starter reducedDPI={2}>
<GLMiniAPI api={api}>
{({ gpi }) => {
return (
<LinkGLToDOMAPI
init={() => {
api.now.renderMode = "pixel"; // pixel, mesh, none
@wonglok
wonglok / fun fun face funz.js
Created Nov 22, 2021
ReadyPlayerMe + FaceCap App
View fun fun face funz.js
import { useFBX, useGLTF, OrbitControls as DOrbit } from "@react-three/drei";
import { useFrame, useLoader, useThree } from "@react-three/fiber";
import { Suspense, useEffect, useRef } from "react";
import {
AnimationMixer,
FileLoader,
NumberKeyframeTrack,
AnimationClip,
NormalAnimationBlendMode,
Audio,
View video.js
export const videoStuff = {
day1: {
lounge: {
screen1:
"https://res.cloudinary.com/loklok-keystone/video/upload/v1637548204/capitalcode-artbasel-2021/day1/screen1-day-1.mp4",
screen2:
"https://res.cloudinary.com/loklok-keystone/video/upload/v1637548203/capitalcode-artbasel-2021/day1/screen2-day-1.mp4",
screen3:
"https://res.cloudinary.com/loklok-keystone/video/upload/v1637548203/capitalcode-artbasel-2021/day1/screen3-day-1.mp4",
screen4:
View test.json
{
"day": 1,
"data": "abc",
"link":"http://google.com"
}
@wonglok
wonglok / facecap-adatpter.js
Created Nov 21, 2021
FaceCap App and ReadyPlayerMe
View facecap-adatpter.js
function FaceMomo() {
// ready-player-me
let glb = useGLTF(`/facecap/4cbc677b-3c53-4787-b62e-288d84f379a0.glb`);
let text = useLoader(
FileLoader,
// from facecap
`/facecap/FC_2021-11-18_11-4-48_testing.txt`
);
let render = useRef(() => {});
//
@wonglok
wonglok / shallow.js
Last active Sep 25, 2021
Shallow Store
View shallow.js
import { useEffect, useState } from "react";
export const getID = function () {
return (
"_" +
Math.random().toString(36).substr(2, 9) +
Math.random().toString(36).substr(2, 9)
);
};
View 3d-texture-Credit.txt
https://stackoverflow.com/questions/23006414/3d-texture-in-webgl-three-js-using-2d-texture-workaround/23040903#23040903