3D ZoomIn
This activity belongs to the GeoGebra Road Runner (beep, beep) book.
Contrary to what happens in the 2D view, when applying the ZoomIn(xmin, ymin, zmin, xmax, ymax, zmax) command, GeoGebra respects the scale between the axes xAxis, yAxis, zAxis, so that the opposite corners E1 and E7 of the orthoedron parallel to the axes do not take the values (xmin, ymin, zmin) and (xmax, ymax, zmax) respectively. If they did, the proportions of the represented objects could vary (spheres would look like ellipsoids, etc.).
This special behavior of the 3D view only occurs if the data entered as arguments in the ZoomIn command are numbers or numerical expressions (like 3+4), because if they are expressions that include a name (parameters, variables...), ZoomIn will behave as in the 2D view.
To maintain proportions, GeoGebra internally performs the following calculations (or equivalent operations), so that the result of executing ZoomIn(xmin, ymin, zmin, xmax, ymax, zmax), remembering that the six arguments must be numerical, is the orthoedron with opposite corners E1' and E7', as can be verified in the following construction (you can vary the height of the 3D view).
E1 = Corner(-1, 1)
E7 = Corner(-1, 7)
rt = x(E7-E1)/z(E7-E1) which is equal to "width : height" of the 3D view in pixels
xinc = xmax - xmin
yinc = ymax - ymin
zinc = zmax - zmin
m = Max(xinc, yinc) / zinc
v = 50/47 zinc Max(1, m/rt) (rt, rt, 1)
E1' = (xmin + xmax, ymin + ymax, zmin + zmax)/2 - v/2
E7' = (xmin + xmax, ymin + ymax, zmin + zmax)/2 + v/2
In the following constructions, we will perform ZoomIn on the 3D view. As we can see, this ZoomIn is sensitive to the dimensions of the 3D view, so changes in these dimensions (for example, when downloading the GGB from any of these pages) require us to readjust that window to reposition the origin (0, 0, 0), where the "surfing" point is located, to the desired position.
Author of the construction of GeoGebra: Rafael Losada