Repository navigation
Ariadne: authored viewpoints for scene cameras - #1495
Merged
Merged
Conversation
A camera can say exactly where it looks from and with what lens. A named camera (scene: cameras:), a viewport's own camera and the main view (a cameras: entry named main) take position: and target: ([x, y, z], world), up:, fov:, near: and far:, and orthographic: with height:. - position and target set the orbit's own pose (centre, distance, azimuth, elevation), so a drag or the wheel goes on from it; a target alone turns the framed view to it, a position alone looks at what was framed; with mode: fly the eye stands at position facing target. - CameraController::lookAt(eye, target); setOrthographic (state settings.orthographic: parallel in Orbit, Fly and Track, as tall as the field of view at the focal point, so the wheel still zooms; Map and Slice take over and give it back); setClipRange (settings.clip_near/clip_far, a fixed range; 0, 0 fits it as before). All off by default. - read_scene_camera_viewpoint reads the keys for the loader and the viewport widget alike; frame_scene_camera frames any controller from a SceneCamera, which AriRuntime uses for the main view. - ARIADNE.md section 5.18: "Authored viewpoints", and the viewport key table. Tests: new cvcgl_camera_viewpoint (headless) and cvcgl_ariadne_viewpoints, ariadne_loader_test CameraViewpoints.
transfix
enabled auto-merge (squash)
November 23, 2026 15:09
transfix
added a commit
that referenced
this pull request
Nov 23, 2026
loader.cpp conflicted where master edited the inline schema this branch replaces (#1450's notifications: always); the closed schema already has it, so the branch's side stays. The schema gains the keys master now reads: - #1495 (merged): a camera's position, target, up, fov, near, far, orthographic and height; - #1491 (open): a scene node's on_pick.
transfix
added a commit
that referenced
this pull request
Nov 23, 2026
… into p9/volume-grid-segment INDEX.ari keeps both new entries (volume_grid_segmentation, http_cache). volume_grid_contours.png conflicted (#1450 re-rendered it for rows that flow); kept ours until CI renders the merged panel.
transfix
added a commit
that referenced
this pull request
Nov 23, 2026
src/cvcGL/CMakeLists.txt conflicted where this branch registers cvcgl_ariadne_node_pick and #1495 registers cvcgl_ariadne_viewpoints at the same place: both kept. ariadne.cpp (#1493's custom_scope around the custom widget call) and scene_views.cpp (#1493's key_scope, #1495's viewpoints) merged cleanly beside this branch's events.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A camera can now say exactly where it looks from and with what lens. Until now cameras were rigs:
mode:plusazimuth,elevationandzoomon a view framed automatically, so a document could not put the eye at a point, look at another, or pick a lens. This is item 4 of the Ariadne scene-format gap plan.The keys
A named camera (
scene: cameras:), a viewport's own camera and the main view all take the same keys. The main view reads them from acameras:entry namedmain. That entry isn't a named camera of its own, socamera: mainon a viewport still follows the main view.positionandtarget([x, y, z], world coordinates) are the eye and the point it looks at.azimuth,elevationandzoom.targetalone turns the framed view to look at it from the same angle and distance.positionalone looks from there at what the view framed.mode: fly, the eye stands atpositionfacingtarget.up: the world's up axis the camera turns about (+zby default).fov: the vertical field of view in degrees.nearandfar: fixed clipping distances. When unset, they are fitted every frame as before.orthographic: true: a parallel projection inorbit,flyandtrack.heightsets that height at the start.mapandsliceare parallel anyway; they take over and hand the projection back.Changes
CameraController, all opt-in with defaults unchanged:lookAt(eye, target)sets the current pose of every 3-D mode;setOrthographic(statesettings.orthographic);setClipRange(statesettings.clip_near/settings.clip_far; 0, 0 fits the range as before).applyNeededwatches the new settings.SceneCameragains the viewpoint fields.read_scene_camera_viewpoint(newscene_camera.cpp) reads them for both the loader and the viewport widget. A malformed vector, or anfovoutside 0 to 180, is ignored rather than half read.frame_scene_camera(scene_views.h) frames any controller from aSceneCamera, as viewports already did internally.AriRuntimeuses it for the main view.near:andfar:.Tests
cvcgl_camera_viewpoint, headless, 28 checks:lookAtputs the vtkCamera exactly at the eye looking at the target, as the orbit's pose in state; the wheel then zooms toward the same target from the same direction;lookAtstands at the eye facing the target; an eye on the target moves only the centre; a straight-down look keeps the target and the 89-degree limit;settings.orthographic = 0through state restores perspective;cvcgl_ariadne_viewpoints, offscreen, 15 checks:camera: main's position, target, fov, near and far;position,targetandfov;ariadne_loader_testCameraViewpoints: every key parsed, defaults kept, and bad vectors and an out-of-range fov ignored.Verified locally
Windows, MSVC, with cvcGL (no examples, no pycvc), on master a4c447c: the full ctest suite, 8,381 tests.
cvcgl_camera,cvcgl_camera_map,cvcgl_camera_slice,cvcgl_camera_idle,cvcgl_ariadne_pick,cvcgl_ariadne_slice_view,cvcgl_ariadne_volume_grid,cvcgl_room_view).cvcgl_contour_lab,cvcgl_volume_grid_contours: this build has nocvc::planar(Clipper2/CDT).cvcgl_ari_golden: the same seven goldens that fail on this machine without this change (Intel Arc GPU, nomesh_lab, nocvc::planar), with the same pixel counts.cvcgl_ariadne_swarm: failed 4 of 25 checks (streamed vehicles moving, the follow layer) while other heavy tests ran. The same binaries then passed 3 of 3, and after a rebuild 6 of 6 with the machine idle. The test drivesrealize_sceneandtick_scenedirectly, and none of the code this change touches runs there.-j 10(NavPlantConvergence.EnergyTrainedPolicyOnJolt,PlantLogPowerConvergence.FitsTheLedgerAndPredictsHeldOutSeeds): both pass rerun at-j 2(1,030 s and 1,327 s, past the 900 s cap).Not verified locally: Linux, macOS, wasm and pycvc.
Schema (#1464)
#1464, the closed
.arischema, lands last among the PRs that add loader keys and carries their keys, so this PR can merge first. #1464 needs, in$defs/camera:position,targetandup({"$ref": "#/$defs/vec3"}),fov,near,farandheight({"type": "number"}), andorthographic({"$ref": "#/$defs/flag"}). Viewport widgets are custom widgets there, so their keys are open already.Not done
upformapmode, which stays north-up as before.