Skip to content

Instantly share code, notes, and snippets.

View truedat101's full-sized avatar
💭
vr / ai / iot

David J. Kordsmeier truedat101

💭
vr / ai / iot
View GitHub Profile
@Matt54
Matt54 / ModelIOLoader.swift
Last active October 14, 2025 07:33
PLY to RealityKit with Grid-Based Decimation (Example: HD Skeleton Scan)
import Foundation
import ModelIO
import simd
nonisolated func loadMeshWithModelIO(from url: URL) throws -> TriangleMesh {
let asset = MDLAsset(url: url)
guard asset.count > 0 else {
throw NSError(domain: "ModelIO", code: 1, userInfo: [NSLocalizedDescriptionKey: "No objects found in file"])
}
@Matt54
Matt54 / BranchSegment.swift
Last active July 12, 2025 08:30
RealityKit Growing/Shrinking Branch using LowLevelMesh
import Foundation
struct BranchSegment {
var startPosition: SIMD3<Float>
var endPosition: SIMD3<Float>
var radius: Float
init(startPosition: SIMD3<Float>, endPosition: SIMD3<Float>, radius: Float) {
self.startPosition = startPosition
self.endPosition = endPosition
@Matt54
Matt54 / MorphingSpherePlaneParams.h
Last active June 22, 2025 01:04
RealityKit LowLevelMesh Sphere to Rectangular Plane Morph with Metal Compute Shader
#ifndef MorphingSpherePlaneParams_h
#define MorphingSpherePlaneParams_h
struct MorphingSpherePlaneParams {
int latitudeBands;
int longitudeBands;
float radius;
float morphAmount;
};
import {
withAlpha,
withoutAlpha,
} from "SpectaclesInteractionKit.lspkg/Utils/color";
/**
* Enhanced 3D Line component with smooth spline interpolation
* Creates a 3D tube by extruding a circular cross-section along a path defined by scene objects.
*/
@component
@agrancini-sc
agrancini-sc / Spline from Line Render
Created May 28, 2025 23:07
Spline from Line Render
import {
withAlpha,
withoutAlpha,
} from "SpectaclesInteractionKit.lspkg/Utils/color";
import InteractorLineRenderer, {
VisualStyle,
} from "SpectaclesInteractionKit.lspkg/Components/Interaction/InteractorLineVisual/InteractorLineRenderer";
/**
* This class provides visual representation for a spline curve through a series of control points.
@agrancini-sc
agrancini-sc / DirectionalShadow.ts
Created April 23, 2025 16:00
Directional Shadow
// Import required modules
const WorldQueryModule = require("LensStudio:WorldQueryModule");
const EPSILON = 0.01;
/**
* DirectionalWorldQuery
*
* A utility that performs world queries in a direction defined by two scene objects.
* It can then project rays from a third object in that same direction.
@skang2-sc
skang2-sc / WebSocketConnection.ts
Created December 31, 2024 19:30
WebSocketConnection Helper
import Event from "SpectaclesInteractionKit/Utils/Event";
const HOST = "wss://[APP_NAME].herokuapp.com";
export class WebSocketConnection {
private remoteServiceModule: RemoteServiceModule = require("LensStudio:RemoteServiceModule");
private webSocket: WebSocket;
private onMessageEvent = new Event<WebSocketMessageEvent>();
public readonly onMessage = this.onMessageEvent.publicApi();
@digikar99
digikar99 / why-coalton-is-a-language.org
Last active April 15, 2025 08:57
An attempt at introducing Coalton to lispers without a background in ML-like languages

Coalton: Why is the interop not easier, and why might it be necessary for Coalton to be an entire language in itself?

If you came here searching for the context in which some reddit comments were written, you might want to check out this previous version of the article.

Several blog posts have been written about Coalton, about how it can be useful and what it brings to the table. However, to me, it hasn’t been clear why Coalton is the way to solve the problems that it does solve. Isn’t a simpler solution possible without making a full embedded language, and giving users the cognitive overhead of thinking about interop between normal lisp and coalton?

I have been thinking about this for a while as one of my pasttimes, and below I’ll summarize the better reasons why coalton might be the way it is. Perhaps, I couldn’t se

@edjdavid
edjdavid / file.md
Created October 13, 2022 12:45
Stream Windows webcam/desktop via RTSP

Can be used for streaming data (webcam or screen capture) from the Windows to WSL

Install

  1. Simple RTSP Server
  2. ffmpeg

Get the internal IP of WSL

Run from a WSL terminal

ip route list default | awk '{print $3}'
@vladak
vladak / sun-booklet.md
Last active September 4, 2025 00:27
Sun Microsystems - What we must do

Sun Microsystems - What we must do

A 2005 booklet with mission statement from Scott McNealy.


What we must do.

Participate or perish ?