Skip to content

Instantly share code, notes, and snippets.

View mrbid's full-sized avatar

James William Fletcher mrbid

View GitHub Profile
@mrbid
mrbid / ptnpc.md
Last active May 6, 2024 11:05
Pre-Trained Neural Point Clouds (PT-NePC)

Pre-Trained Neural Point Clouds (PT-NePC)

Recalculate all objects origin, scale to unit sphere, project to Vertex Colors

  • bpy.ops.object.origin_set(type='GEOMETRY_ORIGIN', center='BOUNDS')
  • Normalise the scale in blender (ref).
  • The margin for a unit cube to fit in a unit sphere is to scale each component by 0.55 after -1 to +1 normalisation.
  • Convert to PLY with textures projected to Vertex Colors.

Possible filtering of meshes

@mrbid
mrbid / ffmpeg_screenshare.md
Last active February 2, 2026 13:51
FFmpeg Direct IP to IP screen sharing

Improved Linux Cast Screen

screenshare()
{
    ffmpeg -f x11grab -framerate 110 -i :0.0 -f mpegts -r 110 -b:v 20M -vcodec libx264 - \
    | python3 <(
        printf '%s\n' \
"from os import _exit" \
"from socket import *" \
"from sys import stdin" \
@mrbid
mrbid / mrbid-itch-mirror.md
Last active April 8, 2024 00:30
[Itch.io Mirror] Share your favourite sources of free 3D content for games.
@mrbid
mrbid / text-to-3d_manual_setup.txt
Last active March 13, 2024 03:09
manually configuring a text-to-3d pipeline
Zero123plus (https://github.com/SUDO-AI-3D/zero123plus) output views are a fixed set of camera poses:
Azimuth (relative to input view): 30, 90, 150, 210, 270, 330.
Elevation (absolute): 30, -20, 30, -20, 30, -20.
To generate the images from Zero123++ it's easier to just use:
https://huggingface.co/spaces/sudo-ai/zero123plus-demo-space
and enable both background removals
StableSAM is usually used to remove backgrounds:
@mrbid
mrbid / esAux6.h
Last active January 23, 2024 09:11
A simple helper library for OpenGL ES / WebGL applications.
/*
--------------------------------------------------
James William Fletcher (github.com/mrbid)
January 2024 - esAux6.h v6.0
--------------------------------------------------
A pretty good color converter: https://www.easyrgb.com/en/convert.php
Lambertian fragment shaders make a difference, but only if you normalise the
vertNorm in the fragment shader. Most of the time you won't notice the difference.
@mrbid
mrbid / ptf2.c
Last active May 16, 2024 18:18
Converts ASCII PLY file to C OpenGL buffers for esAux5.h and above.
/*
James William Fletcher (github.com/mrbid)
October 2022 - December 2023
Converts ASCII PLY (.ply) file to C OpenGL buffers.
This is specifically made for:
esAux5.h: https://gist.github.com/mrbid/34c1b23d292033eefd63cffe8a5a2e96
esAux6.h: https://gist.github.com/mrbid/8563c765116f2dce3d4461adea15fdd1
@mrbid
mrbid / esAux5.h
Last active January 10, 2024 19:05
A simple helper library for OpenGL ES / WebGL applications.
/*
--------------------------------------------------
James William Fletcher (github.com/mrbid)
January 2024 - esAux5.h v5.0
--------------------------------------------------
A pretty good color converter: https://www.easyrgb.com/en/convert.php
Lambertian fragment shaders make a difference, but only if you normalise the
vertNorm in the fragment shader. Most of the time you won't notice the difference.
@mrbid
mrbid / osc.c
Last active March 12, 2024 02:44
Additive Oscillators with Cutoff & Resonance
/*
James William Fletcher (github.com/mrbid)
April 2023
These are oscillators that have Cutoff and Resonance
as a pre/before-fact filter rather than a post/after-fact
filter.
We do this by constructing a Sawtooth or Squarewave from
additive synthesis of sinusoids. This allows us to get
@mrbid
mrbid / esAux4.h
Last active January 10, 2024 14:57
A simple helper library for OpenGL ES / WebGL applications.
/*
--------------------------------------------------
James William Fletcher (github.com/mrbid)
February 2023 - esAux4.h v4.0
--------------------------------------------------
A pretty good color converter: https://www.easyrgb.com/en/convert.php
Lambertian fragment shaders make a difference, but only if you normalise the
vertNorm in the fragment shader. Most of the time you won't notice the difference.
@mrbid
mrbid / rand_bench.c
Last active October 10, 2024 20:30
Favorite random functions and benchmark.
/*
James William Fletcher (github.com/mrbid)
Feb 2023
Bench of my favorite random functions.
Benching like this never reflects real world scenarios,
but it does give you a rough idea of the costs involved.
gcc rand_bench.c -lm -mrdrnd -mrdseed -Ofast -o rand