Skip to content

Instantly share code, notes, and snippets.

View Markyparky56's full-sized avatar
💭
Hello, World!

Mark A. Ropper Markyparky56

💭
Hello, World!
View GitHub Profile
@Lightnet
Lightnet / Flecs 4 Documentation for Hierarchical 3D Transformation Systems.md
Last active March 22, 2026 19:55
Flecs 4.x Documentation for Hierarchical 3D Transformation Systems

Flecs 4.x Documentation for Hierarchical 3D Transformation Systems

This guide outlines how to set up a hierarchical 3D transformation system using Flecs 4.x, focusing on correct entity-component-system (ECS) configuration, transformation order, and parent-child relationships. It is tailored for AI agents and developers building 3D applications (e.g., with OpenGL or other rendering APIs) where entities have position, rotation, and scale, and transformations are propagated through a parent-child hierarchy.Key Concepts1. Flecs Basics

  • Entities: Unique identifiers representing objects (e.g., a cube in a 3D scene).
  • Components: Data structures attached to entities (e.g., Transform3D for position, rotation, scale).
  • Systems: Functions that operate on entities with specific components, executed in a defined order (e.g., EcsPreUpdate, EcsOnUpdate).
  • Pairs: Relationships between entities, used for hierarchies (e.g., (EcsChildOf, ParentEntity) to denote a child-parent relationship).
  1. Hierarchical Transformat
// https://www.shadertoy.com/view/dlfXDN
// 2023 myth0genesis
// 4D Simplex Noise Gradient
// I saw that Stefan Gustavson didn't seem to have published any shader
// with an analytic solution for the gradients of his variant
// of 4D simplex noise, so I thought I'd try solving it myself
// and publish it here for anyone who finds it useful.
// Compares the analytic solution to the numerically approximated one (for a sanity check)
// and shows the results of all four derivatives with respect to each dimension.
// Top : Analytic gradient | Bottom: Forward differences approximated gradient