dofdemo/src/VCam.cs
2024-11-29 13:06:28 -05:00

42 lines
No EOL
1.1 KiB
C#

using StereoKit;
namespace slash;
static class VCam
{
// [!] clear directory before recording
// or better yet just overwrite and then delete anything that wasn't overwritten at the end
// [!] write documentation for making a video
// for example a kdenlive project file that is preconfigured for 60fps VP9 transparent webm etc
public static float t = 0.0f; // use this to stage loops *start by rotating 360 degrees
public static int frame_index = 0;
public static bool recording = false;
public static Pose pose = new(0, 0, 0);
public static void Init()
{
}
public static void Frame()
{
if (Input.Key(Key.N).IsJustActive())
{
recording = !recording;
}
pose.position = Input.Head.position;
pose.orientation = Input.Head.orientation;
if (recording)
{
frame_index++;
Renderer.Screenshot(
$"_frames/test_{frame_index:D4}.png",
pose,
1280,
720
);
}
}
}