File tree Expand file tree Collapse file tree
crates/processing_render/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -303,11 +303,12 @@ pub fn mode_3d(
303303 let fov = std:: f32:: consts:: PI / 3.0 ; // 60 degrees
304304 let aspect = width / height;
305305 let camera_z = ( height / 2.0 ) / ( fov / 2.0 ) . tan ( ) ;
306- let near = camera_z / 10.0 ;
306+ // Processing4 uses near = camera_z / 10, but that clips anything closer
307+ // than ~camera_z/10 to the camera. Since `transform_set_position` lets the
308+ // user move the camera without recomputing the projection, a small fixed
309+ // near is safer and matches most engines' defaults.
310+ let near = 1.0 ;
307311 let far = camera_z * 10.0 ;
308-
309- // TODO: Setting this as a default, but we need to think about API around
310- // a user defined value
311312 let near_clip_plane = vec4 ( 0.0 , 0.0 , -1.0 , -near) ;
312313
313314 let mut projection = projections
You can’t perform that action at this time.
0 commit comments