Comment

Comment by Egorich42

A few months ago I started a task which I thought would take a week or two. You know, the classic “20-minute adventure – in and out!”

The goal: write a Python script to auto-scale any imported 3D model in a prepared .blend scene. Users could upload anything — a 300m spaceship, a 20m cannon, a 2m rifle, or even a 1cm coin — and the model had to be scaled so it filled the camera view with maximum detail, without clipping, and with consistent results.

At first it sounded easy. My first idea was to split a golden dataset (300+ models) into geometry types by dimensions — “cube”, “thin and tall”, “flat and wide” — then create dedicated bounding boxes for each type and fit the models accordingly.

But iteration after iteration, the task evolved into something much harder. It ended up taking me two months and led to a very different solution: a more flexible and adaptive approach, based on one complex custom collision shape, ray casting, and outer boundaries to fine-tune the final scale.

parent Egorich42 1 year ago

No comments yet

Be the first to share your thoughts.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton