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
#include <iostream> | |
#include <string> | |
#include <vector> | |
struct range { | |
const char* start; | |
const char* end; | |
}; | |
/// Check if a range is palindromic. |
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
#!/bin/env python | |
"""Merge mutiple glTF 2.0 animations into one.""" | |
import json | |
import sys | |
def merge(gltf): | |
# Maps (node, path) to (input, output, interpolation) | |
target_to_sampler = {} | |
for animation in gltf.get('animations', []): | |
for channel in animation['channels']: |
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
#!/bin/env python | |
"""Generate a glTF like MetalRoughSpheres, but with factors instead of textures. | |
Output is written to MetalRoughFactorSpheres.gltf and MetalRoughFactorSpheres.bin. | |
""" | |
from math import sqrt | |
import base64 | |
import json | |
import struct |
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
{ | |
"scenes" : [ | |
{ | |
"nodes" : [ 0 ] | |
} | |
], | |
"nodes" : [ | |
{ | |
"mesh" : 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
#!/bin/env python | |
"""Generates MetalRoughSpheres. | |
Output is written to MetalRoughSpheres.gltf and MetalRoughSpheres.bin. | |
""" | |
from math import sqrt | |
import base64 | |
import json | |
import struct |
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
#include <stdio.h> | |
#include <stdint.h> | |
#include <math.h> | |
uint32_t f2i(float x) { return *(uint32_t*)(&x); } | |
float i2f(uint32_t x) { return *(float*)(&x); } | |
int main() { | |
uint32_t i = 0; | |
while (1) { |
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 bpy | |
for mat in bpy.data.materials: | |
mat.use_nodes = True | |
out_node = mat.node_tree.nodes[0] | |
mat_node = mat.node_tree.nodes[1] | |
mat_node.location = -140, 425 | |
mat_node.material = bpy.data.materials[mat.name] |
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
{ | |
"accessors": [ | |
{ | |
"bufferView": 0, | |
"componentType": 5126, | |
"count": 1728, | |
"type": "VEC3", | |
"byteOffset": 0, | |
"min": [ | |
-12.592718124389648, |
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
Notes on how IQM 2 animations work: | |
(see http://sauerbraten.org/iqm/iqm.txt) | |
There is just one global animation strip for the whole file. Each iqmanim is | |
defined by picking out one subrange of frames from this global strip. | |
Every joint has one iqmpose. Every iqmpose has ten channels for the ten TRS | |
properties (Tx Ty Tz Qx Qy Qz Qw Sx Sy Sz). Every channel maps a frame | |
number to the value of that TRS property at that frame. A channel can be | |
either constant or variable. |
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
extern crate crossbeam; | |
extern crate reqwest; | |
extern crate serde; | |
extern crate serde_json; | |
use crossbeam::atomic::AtomicCell; | |
use crossbeam::thread::scope; | |
use reqwest::Client; | |
use serde::Deserialize; |
OlderNewer