feat: add autoZoom param to GIF/MP4 renderers

Adjusts camera distance multiplier from 1.5 to 1.25 when enabled,
reducing empty space around character while leaving room for cosmetics.
This commit is contained in:
devilreef 2026-01-23 01:51:07 +06:00
parent f8947fdcc4
commit fcc495c06f
7 changed files with 29 additions and 13 deletions

View file

@ -9,7 +9,7 @@ import (
)
// RenderPNG renders a GLB model to PNG with the given parameters
func RenderPNG(glbBytes []byte, atlas *texture.Atlas, rotation float64, background string, width, height int) ([]byte, error) {
func RenderPNG(glbBytes []byte, atlas *texture.Atlas, rotation float64, background string, width, height int, autoZoom bool) ([]byte, error) {
// Parse background color
bgColor, err := ParseHexColor(background)
if err != nil {
@ -26,7 +26,7 @@ func RenderPNG(glbBytes []byte, atlas *texture.Atlas, rotation float64, backgrou
}
// Render the scene
img := RenderScene(mesh, atlasImage, rotation, width, height, bgColor)
img := RenderScene(mesh, atlasImage, rotation, width, height, bgColor, autoZoom)
// Encode to PNG
var buf bytes.Buffer