Zernikalos
Quick Start

Loading a model (.zko)

Load packaged Zernikalos assets into your scene from Android assets, the iOS bundle, or the web.

A .zko file is the runtime package produced by Nest. Loading it returns a ZKo object: the graph you render is typically zko.root, and skeletal clips (if any) live in zko.actions — see Playing skeletal animations.

Where to put files

Copy .zko files into app/src/main/assets/. Open them with AssetManager and pass the bytes to loadFromProto.

Loading APIs

import zernikalos.loader.loadFromProto

val bytes = assets.open("Soldier0160.zko").use { it.readBytes() }
val zko = loadFromProto(bytes)
val root = zko.root // Often a ZGroup; add as child of ZScene

Attach the root to your scene

After loading, add zko.root to a ZScene and assign context.scene. You usually also set activeCamera and add at least one light so materials shade correctly.

val scene = ZScene()
scene.addChild(zko.root)
context.scene = scene

Finding the main mesh

Exported files often nest meshes under groups. Use the search helpers instead of hard-coding child indices:

import zernikalos.search.findFirstModel

val model = findFirstModel(scene!!)
model?.transform?.rotateDegrees(90f, 0f, 0f, 1f)

On this page