3D
3D- opt into a 3D camera and a depth buffer. You orbit aCamera3D(perspective or orthographic) and drawPointClouds as instanced disc splats. You can also draw a catalog of solid primitives (box, sphere, capsule, the Platonic solids, …) and parametric and profile shapes (supershape, extrude, lathe). Meshes load from file (.obj,.usdz/.stl/.ply,.gltf/.glb). Textured surfaces and a live webcam depth cloud draw too.Scenes-loadScenekeeps a glTF or USD file's structure instead of merging it. You get a tree of named nodes, drawn in place withdrawSceneand reached by name to animate (scene["lamp"]). The scene also gives you the authored camera and its punctual lights as readyCamera3D/Lightvalues, andapply(_:at:)plays the file's authored keyframe animations on the sketch clock.Instanced meshes- draw one mesh thousands of times in one call.drawMesh(_:instances:)takes a list ofMeshInstanceplacements (position, rotation, scale, tint), and the GPU applies one to each copy. It can take aComputeBufferinstead, which a kernel writes, so a simulation moves the copies without the CPU. The copies shade like solid meshes and cast into the shadow maps. A retainedMeshFieldscales this to a whole world drawn by one call, with each copy GPU-culled against the camera.The Hopf fibration- a sphere's worth of circles, where no two circles meet and every two are linked exactly once.hopfFibersreturns them as[Vector3]paths fordrawTube.hopfBasessupplies the structured base sets (rings of latitude, or a spiral) that make the linking easy to see.Sweeps and strips- a flatShapecarried along a path through space, sized and turned on the way, byMesh.sweep. The path is aCurve3D, whose frames turn with it and never twist about it, so a rider can face the way it runs.Mesh.stripis the ribbon between two lines, one color a rung, andPacewalks a curve given as a function at one speed, or a strip at one rate of area.Lines in 3D- a line between points in space, drawn through the camera with the 2D stroke's weight, joins, caps, and soft edge.drawLineanddrawPolylinetakeVector3points, and a color for each point if you like. Every point keeps its depth, so a solid hides the line where it covers it and the line hides what lies behind it.strokeWeight(_:in:)measures the weight on screen or in world units, anddrawAxesanddrawGridare built from the same lines.Hidden-line solids- a mesh drawn the way a draughtsman draws a solid: its faces in the fill, and over them only its creases, its boundary, and its silhouette in the stroke.featureEdges(creaseAngle:)turns it on. Near solids hide the edges of far ones, the weight holds on screen at every distance, and ten thousand copies take their edges in one more GPU draw.Strand fields- grass that a mesh pipeline grows inside the draw call itself.StrandField+drawStrandsdraw half a million bending, swaying blades with no vertex or instance buffer anywhere. The blades are tile-culled by the camera and graded in detail by distance, and they are shaded and receive shadows on the solid lit path.The ocean- a sea built the way the real ocean is measured.makeOceanFieldwrites a wave spectrum, and one inverse Fourier transform turns it into the moving surface.drawOceandraws that surface as water with no geometry anywhere.waveHeightis a measurement in world units, not a dial.Combining 3D features- the practical map of which 3D features work together. It says which geometry takes lights, materials, matcaps, and environment light, and which things cast, receive, and appear in shadows and reflections. It says when to use screen-space reflections and when to use ray-traced ones, and it ends with a step-by-step recipe for the most realistic scene.Camera control- move the camera by hand or play a ready-made cinematic move.cameraControl()gives you drag to orbit, scroll to dolly, and right-drag or modifier-drag to pan, all damped.cameraMove(_:)plays a turntable, push-in, tilt, orbit-and-rise, reveal, or handheld move. Both are opt-in, and both reuse the orbit pose.Caustics- the light that glass and metal focus.caustics()photon-traces the caster light through every transmissive and mirror-polished surface and draws where it lands. As a result, a glass sphere throws its bright spot into its own shadow, and a chrome ring concentrates reflected light beside itself.dispersion:fans out a prism's rainbow.caustics()needs a ray-tracing GPU.Lens flare- the light the camera adds by itself.lensFlare()works out the ghosts that a real lens prescription makes of each bright source. The prescription places and sizes each ghost, the iris blades give it its shape, and the anti-reflective coating gives it a color that runs from its middle to its rim. The glass puts a colored fringe where it ends, and the source's own size sets how soft that end is. It also draws the star on the source itself, and the star has as many arms as the iris has blades, frayed by the wear on them. Two lenses are bundled. All of it fades as something covers the source, instead of switching off.Line drawing- the scene as line work rather than a picture.lineDrawing(of:)returns 2D paths with what the surfaces hide taken out: the silhouette where a form turns away, the creases where faces meet at an angle, the boundary where a surface ends. Being paths, they plot: SVG, PDF, G-code, DXF.Atmosphere- make the air visible.fogfades surfaces with distance and pools low with a height falloff, using an exact closed-form transmittance.aerialPerspectivesplits the fade by wavelength and lights it with the sun, so far ridges take on a blue haze and blend into the sky.volumetricLightray-marches through the air, so spot cones, cookies, IES profiles, and cast shadows become visible beams and crepuscular shafts.Volumes- a cloud, smoke, fire, or ink placed in the scene. AVolumeis a box of density samples from a function, a list, or noise, anddrawVolumemarches it through the scene's depth with aMedium: how thickly it blocks light, the color it scatters the lights in, and its own glow. Solids inside it are veiled by what lies in front, the medium shades itself, and a solid's shadow falls through it.Depth compositing- place 2D drawing inside a 3D scene, so it can hide the geometry and the geometry can hide it. The calls aredepth(at:),project, andwithBillboard, which hides a 2D label when it swings behind the cloud.Record3D-import OllinRecord3Dto turn an iPhone's color-plus-depth into a 3D point cloud. The source is a recorded.r3dfile or the live USB stream of a tethered phone.RGBD-RGBDFrame(color + depth + intrinsics) is the one frame type that every depth source produces. From it you unproject a point cloud, lift a single image point to metric 3D, or lift a 2D body pose into space (Body.lifted(through:)).Phone-import OllinPhoneto read a tethered iPhone's live ARKit sensor stream over the USB cable. The stream comes from Ollin's own capture app, and ARKit runs on the phone. The stream carries a 3D body skeleton, a face mesh with expression blendshapes, world-facing rear-LiDAR depth, and device motion. The depth arrives as a metric point cloud with the camera's 6DoF pose.