godot-demo-projects/misc/matrix_transform
ShatteredReality b4c73f4888
Fix README links to asset library (#1078)
This updates all links to point to the 4.2 demos instead of the 3.5 ones.

Co-authored-by: A Thousand Ships (she/her) <96648715+AThousandShips@users.noreply.github.com>
2024-06-24 19:29:58 +02:00
..
marker Use static typing in all demos (#1063) 2024-06-01 12:12:18 +02:00
screenshots
2D.tscn
3D.tscn
README.md Fix README links to asset library (#1078) 2024-06-24 19:29:58 +02:00
default_env.tres Convert demos to Godot 4 using regular expressions in a script 2022-03-26 16:09:10 -05:00
icon.webp Use 128×128 WebP icons for all demos (#885) 2023-03-29 18:59:57 +02:00
icon.webp.import Use 128×128 WebP icons for all demos (#885) 2023-03-29 18:59:57 +02:00
project.godot Use static typing in all demos (#1063) 2024-06-01 12:12:18 +02:00

README.md

Matrix Transform

This demo project is a playground where you can visualize how transforms work.

Do not "run" this project. You are only meant to use it within the Godot editor.

For more information, see the Matrices and Transforms article.

Language: GDScript

Renderer: Compatibility

Check out this demo on the asset library: https://godotengine.org/asset-library/asset/2787

How does it work?

In both 2D and 3D, colored lines are drawn indicating the basis vectors as well as the origin vector. For 3D, this means cuboids. If you translate, rotate, scale, or shear the AxisMarker objects, you will be able to see how it affects the transform's component vectors, and all children objects are also appropriately transformed.

You are encouraged to manipulate the AxisMarker objects both in the main viewport and in the inspector. You are encouraged to duplicate them in the hierarchy and parent them any way you wish.

In 2D, red and green lines represent the X and Y axes, with blue representing the origin.

In 3D, red, green, and blue lines represent the X, Y, and Z axes, with cyan representing the origin.

One noteworthy implementation detail: to avoid jitter, the origin vector is a parent of a Node, and inherits the AxisMarker's parent's transform.

Screenshots

2D

3D