cesiumgs/cesiumjs-skills/cesiumjs-camera
Claude Code and agent skill by cesiumgs/cesiumjs-skills
- community
Checking that the SKILL.md file is still in the repository.
CesiumJS camera control - Camera, flyTo, lookAt, setView, ScreenSpaceCameraController, composable Controller camera controllers (1.144), CameraEventAggregator, flight animation. Use when positioning the camera, creating flyTo animations, constraining user navigation, adding custom or asset-inspection camera controllers, tracking entities, or converting between screen and world coordinates.
Install
npx vskill@latest install cesiumgs/cesiumjs-skills/cesiumjs-cameraSKILL.md
CesiumJS Camera & Navigation
Baseline: CesiumJS v1.144 -- ES module imports (import { ... } from "cesium";)
Camera Fundamentals
Access via viewer.camera. The camera has a position (Cartesian3 in world coords), orientation vectors (direction, up, right), and a frustum. All angles are radians.
Read-only computed properties: positionWC, positionCartographic, directionWC, upWC, rightWC, heading (0 = north, clockwise), pitch (negative = down), roll, transform, viewMatrix, inverseViewMatrix.
Events: moveStart / moveEnd fire when movement begins/ends. changed fires when the camera moves by more than percentageChanged (default 0.5).
City views are more realistic with 3D buildings. For production skyline,street-level, or urban panorama views, use a tileset that is actually availablein the target environment.Cesium.createOsmBuildingsAsync()and GooglePhotorealistic 3D Tiles are ion-entitlement-backed; avoid them in public orno-token examples unless the caller explicitly asks for those services. Forportable examples, use an OpenStreetMap/ArcGIS basemap, visible markers, publicURL-backed 3D Tiles, or a higher-altitude city overview.
Altitude & Orientation Guidelines
Choose altitude and pitch to match the scale of the feature you want to show:
| View type | Altitude (m) | Pitch (deg) | Notes | |
|---|---|---|---|---|
| Tourist / monument standoff | 50 -- 500 | -5 to -20 | Camera at near-ground level, offset laterally from the landmark. Subject fills the frame with sky visible above. Use lookAt with HeadingPitchRange pitch near -10°. Never place the camera directly overhead at this range. | |
| Landmark close-up | 500 -- 1,500 | -25 to -35 | Individual buildings/structures fill the frame. Use lookAt with appropriate range. | |
| City panoramic / skyline | 800 -- 1,500 | -10 to -20 | For viewing a skyline from across a river or bay. Position camera to the side, face the city. Use an available 3D Tiles source only when the environment provides one. | |
| City overview | 2,000 -- 5,000 | -35 to -50 | Urban grid, rivers, and parks clearly visible | |
| Metro / regional | 8,000 -- 20,000 | -60 to -90 | Entire metro area or geographic feature | |
| Canyon / cliff rim | 50 -- 300 above rim | -15 to -25 | Use steeper pitch to reveal depth below. Near-horizontal (-5) looks flat across terrain. Add wall/rim entity overlays and a river polyline to make canyon structure visible. | |
| Country / continent | 500,000 -- 5,000,000 | -90 | Political boundaries, coastlines |
When the prompt says "looking at [city]" or "start at [city]", default to city overview range (2,000-5,000 m) with pitch around -45 to -60 degrees and heading 0 (north). This produces a clear, recognizable view where the urban layout, rivers, and landmarks are identifiable.
Target intent vs. camera position: InsetViewandflyTo, a Cartesiandestinationis the camera's final position, not the point it should look at.For requests such as "fly to Los Angeles" or "show the Eiffel Tower", treatthe named coordinates as a target to frame. PreferviewBoundingSphereforan instant view orflyToBoundingSpherefor an animated flight.
Top-down views (pitch: -90) are best for geographic features (canyons, coastlines, rivers) where overhead perspective reveals the distinctive shape. For cities, prefer an angled view that shows the 3D skyline.
Gimbal lock: Never usepitch: -Math.PI/2exactly. Use-(Math.PI / 2 - 0.0001)for straight-down views to avoid singularity.
Ground-level views (altitude < 200 m) require 3D Tiles. Without them,CesiumJS shows only sky and flat ground. Suggest a higher-altitude fallback.
Skyline panoramics (across a river/bay): 800-1,500 m, pitch -10 to -20.Add an available 3D Tiles source for a true 3D silhouette; otherwise make thescreenshot goal honest by using a higher-altitude map/marker view. Pitch toohorizontal (-5) at moderate altitude shows a flat grid, not a skyline.
Public visual eval rule for landmarks: OpenStreetMap imagery alone doesnot render the Eiffel Tower, Empire State Building, Statue of Liberty, or askyline as recognizable 3D subjects. When a public/no-token scenario asks foran identifiable landmark or skyline, add an explicit visual surrogate at thetarget: a tall cylinder/box/polyline tower, colored mast, skyline bar cluster,or large labeled marker. Frame that surrogate so it is inspectable, roughlyone-third to two-thirds of the frame height for landmark views. Do not rely ona map label or 10 px point as the subject.
Canyon / cliff rim views: pitch -15 to -25. Near-horizontal pitch (-5 to-8) looks flat across terrain and misses the vertical drop. Always add entityoverlays (rim wall polygons, river polyline) so the canyon structure isvisible -- without entities the scene shows only a flat basemap regardlessof camera angle.
CRITICAL -- Never place the camera directly above a landmark when astandoff / perspective view is intended. Positioning the camera atCartesian3.fromDegrees(lon, lat, 1000)pointing straight down(pitch: -Math.PI/2) puts the camera overhead the subject (up_alignment=1)and fails landmark-view checks. Always offset the camera laterally:uselookAtwith a HeadingPitchRange pitch of -10° to -45°, or place thedestination500--2,000 m to the side of the landmark and aim the headingtoward it.
setView -- Instant Placement
Teleports the camera in a single frame -- no animation. Use for initial view, mode resets, constraint setup. destination: Cartesian3 or Rectangle. orientation: { heading, pitch, roll } or { direction, up }.
flyTo -- Animated Flight
Smoothly animates the camera. Returns nothing (not a Promise); use complete callback. Options: destination, orientation, duration (seconds), complete/cancel, maximumHeight, pitchAdjustHeight, flyOverLongitude.
Use flyTo when destination intentionally describes the camera's final position. For a named city, landmark, entity, or coordinate that must remain centered, use flyToBoundingSphere.
Altitude tip for tours: keep each stop at 600 m+ so tiles and imageryload. Below 400 m, expect blurry tiles on fast successive flights.
Control in-progress flights with completeFlight() (jumps to end state) and cancelFlight() (stays at current position).
flyHome
Fly to the default view. Override with Camera.DEFAULT_VIEW_RECTANGLE.
Limitation:flyHome()always produces a top-down, north-up view --no orientation control. Workaround: intercept `viewer.homeButton.viewModel.command.beforeExecute, cancel it, and callflyTo` with custom orientation.
lookAt -- Lock Camera to Target
Positions camera to look at a target from an offset (HeadingPitchRange or Cartesian3). Locks the camera until `lookAtTransform(Matrix4.IDENTITY)`.
Overhead trap with `lookAt`: AHeadingPitchRangepitch of-Math.PI/2positions the camera directly above the target (up_alignment ≈ 1), whichfails landmark-view checks. For any perspective or tourist view, use pitchbetween -10° and -45°. Only use pitch near -90° for intentional top-downmap views.
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/cesiumjs-camera/SKILL.md
Popularity
- Repository stars
- 44
- Repository forks
- 7
- 7-day trend score
- 19
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 20 May 2026, 5 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/cesiumgs/cesiumjs-skills/cesiumjs-camera)