_dofile('cameracontrol.lua')clipz = 0pos = 1teapot, plane = _mf:createTeapot(), _mf:createPlane()plane.transform:setScaling(50, 50, 50)teapot.transform:setScaling(5, 5, 5)_rd.camera.eye = _Vector3.new(25, 25, 25)_rd:useLight(_AmbientLight.new())_rd:useLight(_SkyLight.new())mat = _Matrix3D.new()clipper = _Clipper.new():clipZNegative(0)font = _Font.new('Arial', 10)font.textColor = _Color.Yellowfunction newclipper() mat:setTranslation(0, 0, clipz) if pos == 0 then clipper:clipZPositive(clipz) else clipper:clipZNegative(clipz) endend_app:onKeyDown(function(key) if key == _System.KeyW then if clipz < 4 then clipz = clipz + 1 newclipper() end elseif key == _System.KeyS then if clipz > -5 then clipz = clipz - 1 newclipper() end elseif key == _System.Key1 then if pos == 0 then pos = 1 elseif pos == 1 then pos = 0 end newclipper() endend)_app:onIdle(function(e) font:drawText(0, 0, 'Press 1 to Switch Positive or Negative') font:drawText(0, 14, 'Press w to up') font:drawText(0, 28, 'Press s to down') _rd.wireframe = true _rd:pushMatrix3D(mat) plane:drawMesh() _rd:popMatrix3D() _rd.wireframe = false _rd:useClipper(clipper) teapot:drawMesh() _rd:popClipper()end)