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
// Smooth Follow from Standard Assets | |
// Converted to C# because I fucking hate UnityScript and it's inexistant C# interoperability | |
// If you have C# code and you want to edit SmoothFollow's vars ingame, use this instead. | |
using UnityEngine; | |
using System.Collections; | |
public class SmoothFollow : MonoBehaviour { | |
// The target we are following | |
public Transform target; |
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
using System; | |
using System.Threading; | |
static class Program { | |
static void Main() { | |
Console.Write("Performing some task... "); | |
using (var progress = new ProgressBar()) { | |
for (int i = 0; i <= 100; i++) { | |
progress.Report((double) i / 100); |
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
WebGl courses + tutorials | |
--------------------------------------- | |
1. Great GLSL course | |
https://thebookofshaders.com/ | |
https://thebookofshaders.com/?lan=ru (russian language) | |
2. WebGl basics | |
https://webglfundamentals.org | |
https://webglfundamentals.org/webgl/lessons/ru (russian language) |
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
let verts = new Float32Array( [ 0, 2, 0, -1, 0.2, 0, 1, 0.2, 0 ] ); | |
let v = base64_test( verts ); | |
function base64_test( fary ){ | |
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
// ENCODING TEST | |
console.log("Origin Data", fary ); | |
let uint = new Uint8Array( fary.buffer ); | |
console.log( "Convert F32 to Uint8 : Byte Length Test", fary.length * 4, uint.length ); |
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
# | |
# Skeleton for SDL2/OpenGL application in Python | |
# with fixed logic time step, rendering is going still at full speed. | |
# | |
# To turn debug logging messages on, run with -v parameter: | |
# python <script_name.py> -v | |
# | |
import argparse | |
import logging |
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 Ammo from 'ammojs-typed'; | |
export class AmmoProvider { | |
private static api: typeof Ammo; | |
public static async getApi() { | |
if (!AmmoProvider.api) { | |
AmmoProvider.api = await Ammo();; | |
} |
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
# Build: | |
# | |
# as -o hello.obj | |
# ld -o hello.exe hello.obj -L C:\\tools\\mingw64\\x86_64-w64-mingw32\\lib -lkernel32 | |
# | |
# Requires MinGW | |
.extern GetStdHandle | |
.extern WriteFile | |
.extern ExitProcess |
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
// $ em++ -lwebsocket.js -o index.html main.cpp | |
#include <emscripten/emscripten.h> | |
#include <emscripten/websocket.h> | |
#include <stdio.h> | |
EM_BOOL onopen(int eventType, const EmscriptenWebSocketOpenEvent *websocketEvent, void *userData) { | |
puts("onopen"); | |
EMSCRIPTEN_RESULT result; |