Repository navigation
Scene nodes scale along their own axes (T·R·S); ARIADNE.md documents a node's transform - #1486
Merged
Merged
Conversation
A node's rotation is degrees about the parent's x, then y, then z (R = Rz Ry Rx), as scene_geometry, GraphicsNode and the view entries build it. Its scale applies along the parent's axes after the rotation (position + S R p), unlike a view entry's (position + R S p). At run time the pose is in position, rotation, scale and matrix (16 numbers, row-major); writing rotation sets the scale back to 1.
GraphicsNode::setScale scaled each row of the rotation (T S R), so a non-uniform scale on a turned node stretched along the parent's axes, while a view entry's transform:, the physics world's decompose and the conference statics all compose T R S: a turned, scaled box was drawn as one shape and collided as another, and physics warned it was skewed. Writing rotation also dropped the scale. GraphicsNode now keeps the rotation and scale it was last given and builds Rz Ry Rx S from them, so each keeps the other (a scale of 0 or below 0 included). After a whole matrix (setTransform, setPoseMatrix, the matrix key) they are read back from it on the next setRotation or setScale: column lengths as the scale, the last negative when it mirrors. scene_node_local_matrix scales columns to match. ARIADNE.md's Transforms paragraph says so. cvcgl_node_transform pins the matrix against scene_node_local_matrix, the view entry's build and realize_scene, and the keeping; the scene world tests pin the order and a turned, scaled body without skew.
transfix
enabled auto-merge (squash)
November 23, 2026 06:47
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.
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 scene node's
transform:now composes as T·Rz·Ry·Rx·S: a point is scaled along the node's own axes, turned, then moved. That is how glTF, USD and X3D compose a node, and how Ariadne already composed everything except the drawn node. ARIADNE.md now documents the transform, including the rotation order, which was never written down.What was wrong
The drawn node was the odd one out.
GraphicsNode::setScalescaled each row of the rotation (T·S·R): a non-uniform scale on a turned node stretched along the parent's axes. Three other places already assumed T·R·S:transform:(scene_views.cpp, vtkTransform's Translate, RotateZ/Y/X, Scale);decompose(scene_world.cpp), which divides out column lengths and calls non-orthogonal columns skew;holon_sync.cpp, which scale a box along its own axes and then turn it.So a turned box with
scale: [4, 1, 0.5]was drawn one shape and collided as another. The physics world also warned that its transform was skewed.Writing
rotationdropped the scale.setRotationand therotationkey handler copied a pure rotation over the matrix and kept only the translation.setScalerecovered the rotation by normalising rows, which loses it at a scale of 0 and loses which axis a negative scale was on.No shipped
.aridocument usesrotation:(0 of 184), and every non-uniformsetScalecall outside tests is the realizer's, so nothing shipped changes how it looks.What changes
GraphicsNodekeeps the rotation and scale it was last given, and builds the upper 3x3 as Rz·Ry·Rx·S through vtkTransform, asscene_views.cppdoes.setRotationkeeps the scale, a scale of 0 or below 0 included;setScalekeeps the rotation. Therotationandscalekey handlers call the same code instead of their own copies.After a whole matrix (
setTransform,setPoseMatrix, thematrixkey) the parts are marked stale. The nextsetRotationorsetScalereads them back from the matrix first: each column's length is the scale, the last made negative when the matrix mirrors, and what is left is the rotation, read back as Rz·Ry·Rx (with the pitched-straight-up case handled). The per-frame pose path does no extra work.scene_node_local_matrixscales columns instead of rows, so the physics world builds a turned, non-uniformly scaled node as a plain rigid body.Docs: ARIADNE.md §5.4 gets a "Transforms" paragraph covering:
position,rotation,scaleandmatrixkeys, and how each keeps the others.The §5.18 view-entry text now says it composes the same way.
Tests
ariadne_scene_world_test:LocalMatrixIsRotationThenRowScaleThenPositionbecomesLocalMatrixIsScaleThenRotationThenPosition;LocalMatrixTurnsAboutXThenYThenZ;ATurnedNodesScaleIsAlongItsOwnAxes: a box turned 30 degrees withscale: [4, 1, 0.5]is a rigid body with half extents (2, 0.5, 0.25), turned 30 degrees, and no skew warning.cvcgl_node_transform, headless:scene_node_local_matrixand the view entry's vtkTransform build, for four rotation/scale cases, in either call order, and throughrealize_scene;setTransform,setPoseMatrixor amatrixkey write, a rotation keeps the matrix's scale and a scale keeps its rotation, pitched straight up and mirrored included;rotationandscalekeys do what the setters do;resetTransformstarts both over.With the old
GraphicsNode.cppandscene_geometry.cppput back,cvcgl_node_transformfails 18 checks, andLocalMatrixIsScaleThenRotationThenPositionandATurnedNodesScaleIsAlongItsOwnAxes(the skew warning) fail. The rotation-order test passes either way, because that order didn't change.Verified locally
Windows, MSVC, with cvcGL (no examples, no pycvc), on 484ba6f: the full ctest suite, 8,349 tests.
cvcgl_clip_planes(non-uniform scales on turned nodes),cvcgl_pose_matrix,cvcgl_ariadne_realizeandcvcgl_ariadne_physics.AriadneFrames.AR03b_ProvidersPostToTheirGroup: failed once under-j 12and passed when run alone.cvcgl_contour_labandcvcgl_volume_grid_contours: this build has nocvc::planar(Clipper2/CDT).cvcgl_ari_golden: seven goldens differ on this machine (Intel Arc GPU, nomesh_laband nocvc::planar). I rebuilt with the old transform code and reran: the same seven goldens fail, with the same pixel counts.Not verified locally: Linux, macOS, wasm and pycvc.
Not done
matrixkey already takes an exact orientation, and keyframe interpolation can work on quaternions internally whatever form the keys are written in.