This file contains hidden or 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 struct | |
| import json | |
| import numpy as np | |
| from pathlib import Path | |
| from OpenGL.GL import * | |
| from OpenGL.GL.shaders import compileProgram, compileShader | |
| import glfw | |
| import time | |
| """ |
This file contains hidden or 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
| # GLB_3D_renderer_simple.py | |
| """ | |
| Simple GLB loader + animation player for intermediate Python/OpenGL users. | |
| Focuses on node TRS animation (translation, rotation quaternion, scale) and morph weights. | |
| Does not implement GPU skinning in full; hooks are provided for extension. | |
| Dependencies: pip install pygltflib numpy PyOpenGL glfw | |
| """ | |
| import json |
This file contains hidden or 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
| # GLB_3D_renderer.py | |
| """ | |
| Combined GLB loader + texture loader + animation player + renderer with GPU skinning. | |
| Requires: pygltflib, numpy, PyOpenGL, glfw, Pillow | |
| Run: python GLB_3D_renderer.py model.glb | |
| """ | |
| import os | |
| import sys | |
| import math |
This file contains hidden or 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
| <!doctype html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="utf-8" /> | |
| <title>Optimized WoW-style Canvas Tooltip</title> | |
| <meta name="viewport" content="width=device-width,initial-scale=1" /> | |
| <style> | |
| body { background: #0b0b0b; color: #ddd; font-family: Arial, Helvetica, sans-serif; padding: 18px; } | |
| h1 { font-size: 18px; margin: 6px 0 12px; color: #fff; } | |
| .row { display:flex; gap:20px; align-items:flex-start; flex-wrap:wrap; } |
This file contains hidden or 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
| <!doctype html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="utf-8" /> | |
| <title>WoW-style Item Tooltip — Canvas + CSS Example</title> | |
| <meta name="viewport" content="width=device-width,initial-scale=1" /> | |
| <style> | |
| /* ---------- DOM tooltip CSS (optional, for reference or fallback) ---------- */ | |
| :root{ | |
| --bg-1: rgba(17,17,17,0.96); |
This file contains hidden or 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 <bits/stdc++.h> | |
| using namespace std; | |
| /* | |
| A heuristic "auto-semicolon" preprocessor. | |
| Reads stdin or a file and writes to stdout. | |
| Inserts semicolons at newline boundaries when it appears a statement ended. | |
| Not a full C++ parser — best-effort for common constructs. | |
| */ |
This file contains hidden or 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
| // auto_semi_compiler.cpp | |
| // Compile: g++ -std=c++17 -O2 auto_semi_compiler.cpp -o auto_semi_compiler | |
| // | |
| // Usage: | |
| // ./auto_semi_compiler <all original clang++/g++ args...> | |
| // Example (transparent): | |
| // ./auto_semi_compiler -std=c++17 -O2 -c foo.nocpp -o foo.o | |
| // | |
| // By default it will try to run "clang++" as the real compiler. | |
| // Set REAL_CXX environment variable to point to another compiler (e.g. g++). |
This file contains hidden or 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
| // auto_semi_improved.cpp | |
| // Heuristic but improved auto-semicolon inserter. | |
| // Not a full C++ parser; still heuristic but handles many more edge cases. | |
| #include <bits/stdc++.h> | |
| using namespace std; | |
| enum class TokKind { | |
| IDENT, NUMBER, STRING, RAW_STRING, CHAR, PUNCT, OP, NEWLINE, SPACE, | |
| PREPROCESSOR, COMMENT_LINE, COMMENT_BLOCK, END |
This file contains hidden or 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
| # glb_player_glfw.py | |
| import time, ctypes, math | |
| import numpy as np | |
| import glfw | |
| from OpenGL.GL import * | |
| from OpenGL.GL.shaders import compileProgram, compileShader | |
| import pyassimp | |
| # ---------------- math helpers ---------------- | |
| def identity4(): return np.eye(4, dtype=np.float32) |
This file contains hidden or 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
| # fps_demo.py | |
| """ | |
| Minimal FPS demo using PyGame + PyOpenGL + NumPy + Pillow. | |
| Features: | |
| - Camera with pitch, yaw, roll (mouse look & WASD movement) | |
| - Material + SamplerConfig to pick filters, wrap, anisotropy | |
| - PNG loading with alpha support, mipmaps, cached samplers | |
| - VAO/VBO-based meshes (plane + cube) | |
| - Grouped draws by material to minimize texture binds |