🍦🚌 Model Viewer: GLB + UV Models

Drag to rotate, wheel to zoom

← Home

Status

Loading...

Controls

Theory: GLB Layout

Header (12 bytes): magic "glTF" | version 2 | total length Chunk 0: length | type "JSON" | scene description Chunk 1: length | type "BIN\0" | vertex, index and image bytes Every chunk is padded to a 4-byte boundary.

Theory: Accessors

accessor -> type (VEC3), componentType (FLOAT), count bufferView -> byteOffset, byteLength, byteStride buffer -> the BIN chunk element i, component c lives at viewOffset + accOffset + i·stride + c·size

Theory: Scene Graph

world = parent · T · R · S (or node.matrix) The loader bakes each node's world matrix into its vertices, then centers the bounding box and scales it to fit the view.

Theory: Materials

baseColor = factor · sRGBtoLinear(texture(uv)) glTF UV (0,0) is the top-left of the image, so no flip. doubleSided: culling off, N flipped when !gl_FrontFacing.