Skip to content

Commit 4264949

Browse files
authored
Auto merge of #466 - nical:perspective-doc, r=kvark
Improve the documentation of Transform3D::perspective There was a bit of confusion about the formulation of the perspective transform in #465. This clarifies things.
2 parents 27b7a27 + a8dfc57 commit 4264949

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "euclid"
3-
version = "0.22.0"
3+
version = "0.22.1"
44
authors = ["The Servo Project Developers"]
55
edition = "2018"
66
description = "Geometry primitives"

src/transform3d.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,14 +425,16 @@ where
425425
)
426426
}
427427

428-
/// Create a simple perspective projection transform:
428+
/// Create a simple perspective transform, projecting to the plane `z = -d`.
429429
///
430430
/// ```text
431431
/// 1 0 0 0
432432
/// 0 1 0 0
433433
/// 0 0 1 -1/d
434434
/// 0 0 0 1
435435
/// ```
436+
///
437+
/// See <https://drafts.csswg.org/css-transforms-2/#PerspectiveDefined>.
436438
pub fn perspective(d: T) -> Self
437439
where
438440
T: Neg<Output = T> + Div<Output = T>,

0 commit comments

Comments
 (0)