Camera Write Projects

From Echopedia


Usage[edit | edit source]

The game now has an API for changing camera position programmatically. To set the camera position, make a POST request to htpp://localhost:6721/camera_transform with a body containing the following json:

{
    "px": 0,
    "py": 0,
    "pz": 0,
    "qx": 0,
    "qy": 0,
    "qz": 0,
    "qw": 1,
    "fovy": 1
}

The port may be different from 6721 if the game was launched with a different port set through the -httpport flag, however the IP address will almost always be localhost, since the setting camera position only works in 2D spectator mode, which is only available on PC.

List of Projects/Algorithms[edit | edit source]

Below is a list of projects created using this API. Several of these were created using Graic's WriteAPI, which was available before the official API.

Keyframe animations[edit | edit source]

File:Spark camera write.png
Spark's camera write tab.

Spark contains an editor and playback mechanism for keyframe animations. Multiple animations are supported, and can be switched between with a dropdown. Hotkey support allows immediate playback of preset animations.

Waypoints[edit | edit source]

Spark has a list of saved waypoints. Waypoints can be access with a hotkey or a button.

Manual position sliders[edit | edit source]

Spark has sliders for setting the exact camera position and orientation. The camera pose is set in realtime as the slides are moved. The rotation is a quaternion, so this is more for debugging or setting exact positions.

Orbit Disc[edit | edit source]

This reads the disc position from the API, then sets the camera position to a constantly rotation position around the disc. The camera is always facing the disc. By nature of the delays introduced by first reading then writing with the API, there is significant jitter. This can be tuned with sliders for lag compensation (extrapolation based on velocity), and a smoothing factor. There are also adjustable parameters for orbit radius and speed.

3D Mouse Support[edit | edit source]

Joystick Support[edit | edit source]

X-Plane Support[edit | edit source]

VR Operator Interface[edit | edit source]