Skip to content

Instantly share code, notes, and snippets.

View SergeyMakeev's full-sized avatar
😉

Sergey Makeev SergeyMakeev

😉
View GitHub Profile
def quat_from_xform(ts):
return quat_normalize(
torch.where((ts[...,2,2] < 0.0)[...,None],
torch.where((ts[...,0,0] > ts[...,1,1])[...,None],
torch.cat([
(ts[...,2,1]-ts[...,1,2])[...,None],
(1.0 + ts[...,0,0] - ts[...,1,1] - ts[...,2,2])[...,None],
(ts[...,1,0]+ts[...,0,1])[...,None],
(ts[...,0,2]+ts[...,2,0])[...,None]], dim=-1),
@MaximumADHD
MaximumADHD / Animate.lua
Last active February 21, 2026 17:33
Rewrite of Roblox's Animate script to be more flexible/robust and easier to read.
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- Animate
-- maximum_adhd
-- September 21st, 2022
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
--!strict
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
@vassvik
vassvik / Simulation_Projection.md
Last active January 23, 2026 02:59
Realtime Fluid Simulation: Projection

Realtime Fluid Simulation: Projection

The core of most real-time fluid simulators, like the one in EmberGen, are based on the "Stable Fluids" algorithm by Jos Stam, which to my knowledge was first presented at SIGGRAPH '99. This is a post about one part of this algorithm that's often underestimated: Projection

MG4_F32.mp4

Stable Fluids

The Stable Fluids algorithm solves a subset of the famous "Navier Stokes equations", which describe how fluids interact and move. In particular, it typically solves what's called the "incompressible Euler equations", where viscous forces are often ignored.

@dwilliamson
dwilliamson / MarchingCubes.js
Last active February 13, 2026 16:00
Marching Cubes Lookup Tables
//
// Lookup Tables for Marching Cubes
//
// These tables differ from the original paper (Marching Cubes: A High Resolution 3D Surface Construction Algorithm)
//
// The co-ordinate system has the more convenient properties:
//
// i = cube index [0, 7]
// x = (i & 1) >> 0
// y = (i & 2) >> 1

A metatable in Lua defines various extraneous behaviors for a table when indexed, modified, interacted with, etc. They are Lua's core metaprogramming feature; most well known for being useful to emulate classes much like an OOP language.

Any table (and userdata) may be assigned a metatable. You can define a metatable for a table as such:

-- Our sample table
local tab = {}
-- Our metatable
local metatable = {
 -- This table is then what holds the metamethods or metafields
@svpino
svpino / neural-network-from-scratch.py
Last active December 13, 2024 20:19
An implementation of a neural network from scratch
import numpy as np
def sigmoid(x):
return 1 / (1 + np.exp(-x))
def neural_network(X, y):
learning_rate = 0.1
W1 = np.random.rand(2, 4)
W2 = np.random.rand(4, 1)
@toadative
toadative / HoverThickness.lua
Last active August 1, 2021 03:27
Shrinks the hover box in Roblox Studio when you get closer to it
local CoreGui = game:GetService("CoreGui")
local MIN_THICKNESS = 0.001
local MAX_THICKNESS = 0.04
local MIN_DIST = 2
local MAX_DIST = 10
game:GetService("RunService").Heartbeat:Connect(function()
local hoverBox = CoreGui:FindFirstChild("HoverBox")
if hoverBox and hoverBox:IsA("SelectionBox") then
local adornee = hoverBox.Adornee
string rpAsset = "";
if (GraphicsSettings.renderPipelineAsset != null)
rpAsset = GraphicsSettings.renderPipelineAsset.GetType().Name;
if (rpAsset.Equals("HDRenderPipelineAsset"))
renderPipeline = RenderPipeline.HDRP;
else if (rpAsset.Equals("UniversalRenderPipelineAsset"))
renderPipeline = RenderPipeline.URP;
else
renderPipeline = RenderPipeline.BuiltIn;
@jovannic
jovannic / MockTree.lua
Last active November 26, 2020 02:44
MockTree: A module for handling Welds and Motor6Ds outside of Workspace
local MockTree = {}
local function addJointEdge(joints, joint, me, other)
local edgeList = joints[me]
if not edgeList then
edgeList = {}
joints[me] = edgeList
end
table.insert(edgeList, {joint, other})
end
@raysan5
raysan5 / custom_game_engines_small_study.md
Last active May 1, 2026 19:01
A small state-of-the-art study on custom engines

CUSTOM GAME ENGINES: A Small Study

a_plague_tale

WARNING: Article moved to separate repo to allow users contributions: https://github.com/raysan5/custom_game_engines

A couple of weeks ago I played (and finished) A Plague Tale, a game by Asobo Studio. I was really captivated by the game, not only by the beautiful graphics but also by the story and the locations in the game. I decided to investigate a bit about the game tech and I was surprised to see it was developed with a custom engine by a relatively small studio. I know there are some companies using custom engines but it's very difficult to find a detailed market study with that kind of information curated and updated. So this article.

Nowadays lots of companies choose engines like [Unreal](https: