This commit is contained in:
2026-05-06 17:52:45 -07:00
parent 9fc3f35125
commit 1463c23334
402 changed files with 3758 additions and 0 deletions

View File

@ -0,0 +1,2 @@
#### Keyboard
`R T F G V B` to rotate suzanne

View File

@ -0,0 +1,36 @@
package lnx;
class MyTrait extends iron.Trait {
public function new() {
super();
notifyOnInit(function() {
// Retrieve camera object
var cam = cast(iron.Scene.active.getChild("Camera.001"), iron.object.CameraObject);
// Create render target for camera
cam.renderTarget = kha.Image.createRenderTarget(
640,
360,
kha.graphics4.TextureFormat.RGBA32,
kha.graphics4.DepthStencilFormat.NoDepthAndStencil
);
// Display camera output on this plane
var o = cast(object, iron.object.MeshObject);
o.materials[0].contexts[0].textures[0] = cam.renderTarget; // Override base color texture
notifyOnRender(function(g:kha.graphics4.Graphics) {
// Set as scene camera
var activeCamera = iron.Scene.active.camera;
iron.Scene.active.camera = cam;
// Update camera output
cam.renderFrame(g);
// Restore original camera
iron.Scene.active.camera = activeCamera;
});
});
}
}

Binary file not shown.