Jump to content

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();
https://www.youtube.com/watch?v=QuqNwts5mc0&list=PLydfMPb3IeEPQFtfUO_WN7I_86_7WXWvQ&index=15
p_n.normalize();
let plane_d = -Vector3::dot_product(&p_n, plane_p);
Cookies help us deliver our services. By using our services, you agree to our use of cookies.