Skip to content

Instantly share code, notes, and snippets.

@hyperlogic
hyperlogic / make_input.py
Last active September 20, 2023 17:00
Use ffmpeg to extract frames from multiple videos in preperation for 3d gaussian splatting.
#
# python make_input.py --fps 1 movie01 movie02
#
# Will create an input folder in the curren directory then
# invoke ffmpeg to extract frames from each video and copy
# the resulting frames into that input folder.
#
import argparse
import os
@hyperlogic
hyperlogic / rpm_render.py
Created November 22, 2021 20:51
ready player me render API test
# create a support video call channel for TribeXR users to join via the vr client or via the web.
import requests
from requests.adapters import HTTPAdapter
from requests.packages.urllib3.util.retry import Retry
import json
from urllib.parse import urlencode, quote_plus
import webbrowser
import time
(master)~/code/OpenXRSamples/build > cmake --version
cmake version 3.17.2
CMake suite maintained and supported by Kitware (kitware.com/cmake).
(master)~/code/OpenXRSamples/build > cmake .. -A x64
-- Building for: Visual Studio 16 2019
-- EZVCPKG v0.1 starting up
Website: https://github.com/jherico/ezvcpkg
-- EZVCPKG_BASEDIR envrionment variable not found and basedir not set, using default C:\msys64\home\ajthy/.ezvcpkg
-- EZVCPKG initializing
@hyperlogic
hyperlogic / sdf.c
Last active December 6, 2019 04:24
ctoy 2d sdf renderer
static struct m_image buffer = M_IMAGE_IDENTITY();
#include <math.h>
#include <m_math.h>
#include <m_raster.h>
typedef struct Prim_t {
int type; // 0 = sphere, 1 = box
float m[6];
float inv_m[6];
@hyperlogic
hyperlogic / record.js
Created November 19, 2019 00:46
High Fidelity Client Avatar Recording App
"use strict";
//
// record.js
//
// Created by David Rowe on 5 Apr 2017.
// Copyright 2017 High Fidelity, Inc.
//
// Distributed under the Apache License, Version 2.0.
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
var normalizedMousePos = {x: 0, y: 0};
function animHandler(props) {
props.lookAroundAlpha = {x: normalizedMousePos.x, y: -normalizedMousePos.y, z: 0};
return props;
}
Controller.mouseMoveEvent.connect(function (e) {
normalizedMousePos.x = ((2 * e.x) / Window.innerWidth) - 1;
normalizedMousePos.y = ((2 * e.y) / Window.innerHeight) - 1;
// click to sit, click again to stand
(function () {
var seated = false;
var entity;
this.preload = function(entityID) {
entity = entityID;
};
(function() { // BEGIN LOCAL_SCOPE
var TABLET_BUTTON_NAME = "BLENDSHAPE";
var HTML_URL = "https://hifi-public.s3.amazonaws.com/tony/html/blendshapetest_arkit.html?2";
var BLENDSHAPETEST_CHANNEL = "com.highfidelity.blendshapetest";
var IS_LOCAL = true;
var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system");
var tabletButton = tablet.addButton({
text: TABLET_BUTTON_NAME,
//
// blendshapetest-agent-client.js
//
/* eslint indent: ["error", 4, { "outerIIFEBody": 0 }] */
(function() { // BEGIN LOCAL_SCOPE
var TABLET_BUTTON_NAME = "BLENDSHAPE";
var HTML_URL = "https://hifi-public.s3.amazonaws.com/tony/html/blendshapetest_arkit.html";
var BLENDSHAPETEST_CHANNEL = "com.highfidelity.blendshapetest";
//
// blendshapetest-agent-server.js
//
/* eslint indent: ["error", 4, { "outerIIFEBody": 0 }] */
(function() { // BEGIN LOCAL_SCOPE
var BLENDSHAPETEST_CHANNEL = "com.highfidelity.blendshapetest";
Agent.isAvatar = true;
Avatar.skeletonModelURL = "https://hifi-public.s3.amazonaws.com/tony/avatars/arkit/arkit_facecap_avatar.fst";