Skip to content

Instantly share code, notes, and snippets.

@Lightnet
Lightnet / circle_ring_rope.gd
Created June 24, 2025 17:32
sample test rope circle uv texture.
@tool
extends MeshInstance3D
@export var rope_length: float = 5.0 # Total length of the rope
@export var segments: int = 20 # Number of segments
@export var radius: float = 0.1 # Thickness of the rope
@export var sides: int = 8 # Number of sides for the rope's cross-section
func _ready() -> void:
generate_rope()
@Lightnet
Lightnet / ring_texture3d03_working_uv.gd
Created June 23, 2025 05:35
circle uv test godot 4
@tool
extends MeshInstance3D
# this is for ImmediateMesh
# works uv align but scale does not work.
# Rope properties
@export var rope_width: float = 0.1 # Radius of the rope
@export var resoulution: int = 8 # Number of vertices around the rope's circumference
@export var uv_scale: Vector2 = Vector2(1.0, 1.0) # UV scaling factor
@export var texture_height_to_width: float = 1.0 # Texture aspect ratio (height/width)
@Lightnet
Lightnet / animation_actions03.py
Created May 24, 2025 04:48
action list test and armture pose bones.
bl_info = {
"name": "Test Build",
"category": "3D View",
"author": "lightnet",
"blender": (4, 4, 0),
"version": (0, 0, 1),
"description": "Test Script",
"doc_url": "",
"tracker_url": "",
}
@Lightnet
Lightnet / README.md
Last active May 21, 2025 18:59
node editor test.

Blender 4.4.x

Testing how node editor works. Trying to make simple as possible but the register and unregister has some bug to handle remove nodes.

@Lightnet
Lightnet / README.md
Created April 25, 2025 21:00
raylib c simple physics 3d test.

Simple physics collision 3d.

Raylib 5.5

W,A,S,D = movement. Space = jump.

Notes:

  • landing will off sets bug.
@Lightnet
Lightnet / raylib_collision3d.c
Last active April 25, 2025 17:37
refine physics collision but wall lag too many collisions. raylib.
#define WIN32_LEAN_AND_MEAN
#define _WINSOCK_DEPRECATED_NO_WARNINGS
#define NOGDI
#define NOUSER
#define MMNOSOUND
#include "raylib.h"
#include "raymath.h"
#include <stdio.h>
#include <stdlib.h>
@Lightnet
Lightnet / README.md
Last active April 24, 2025 21:55
c raylib collision3d test
@Lightnet
Lightnet / flecs_test.c
Created April 19, 2025 06:14
flecs_test.c
// parent
// https://www.flecs.dev/flecs/md_docs_2Relationships.html#iterate-all-children-for-a-parent
//
#include "flecs.h"
int main(){
// Initialize Flecs world
ecs_world_t *world = ecs_init();
ecs_entity_t parent = ecs_entity(world, {.name = "Parent"});
@Lightnet
Lightnet / server.js
Created April 15, 2025 15:11
very simple server throttle download file. Limit to 50 KiB/s
/*
Credits:
* https://github.com/juliangruber/stream
* https://gist.github.com/4poc/1454516
*/
import http from 'http';
import path from 'path';
import fs from 'fs';
import mime from 'mime';