#!/usr/bin/env python3 """ hybrid_render.py -- Path A rendering (hybrid): render the scene FLYK.EXE is running, from an in-scene camera, using the dpl3-revive pipeline. FLYK streams the scene GRAPH (camera projection, DCS transforms, instance placements, materials) over the VelociRender link, and animates it per-frame via action 0x1d (decoded by analyze_scene.py). The GEOMETRY is referenced by name and loaded from files -- exactly what dpl3-revive already parses. So we assemble the scene from files and view it from the camera FLYK uses (a diver inside the reef), producing the picture FLYK's dead i860 board would have drawn. python hybrid_render.py [showcase_index] [out.png] Default: SHARKS.SCN (the Hull-Pressure aquarium reef), interior camera on the shark. """ import sys, os HERE = os.path.dirname(os.path.abspath(__file__)) VIEWER = os.path.join(os.path.dirname(HERE), "viewer") sys.path.insert(0, VIEWER) sys.path.insert(0, os.path.join(os.path.dirname(HERE), "parser")) import bundle, render_preview # Interior cameras (eye, center, up) framing the animated content of each showcase scene. # For SHARKS the fish/sharks cluster near (-220, 225, -350) -- matches FLYK's live 0x1d # translations (y~230, z~-200), confirming the camera looks where FLYK animates. CAMS = { 2: {"eye": [450, 300, 250], "center": [-220, 225, -350], "up": [0, 1, 0]}, # SHARKS } def main(): idx = int(sys.argv[1]) if len(sys.argv) > 1 else 2 out = sys.argv[2] if len(sys.argv) > 2 else os.path.join(HERE, "flyk_render.png") md = bundle.build_model(bundle.SHOWCASE[idx]) render_preview.render(md, out, cam=CAMS.get(idx)) if __name__ == "__main__": main()