Anonymous user
Catmull–Clark subdivision surface: Difference between revisions
m
no edit summary
(Added Rust as a translation of Python.) |
mNo edit summary |
||
Line 2,638:
{{trans|Python}}
<lang Rust>
pub struct Vector3 {pub x: f64, pub y: f64, pub z: f64, pub w: f64}
Line 2,662 ⟶ 2,661:
pub fn intersect_plane(plane_n: &Vector3, plane_p: &Vector3, line_start: &Vector3, line_end: &Vector3, mut t: f64) -> Vector3 {
let mut p_n = plane_n.copy();
p_n.normalize();
let plane_d = -Vector3::dot_product(&p_n, plane_p);
|