import { Meta, StoryObj } from "@storybook/react";
import {
Cartesian3,
Ellipsoid,
HeadingPitchRange,
HeadingPitchRoll,
Math as CesiumMath,
Transforms,
} from "cesium";
import CameraLookAt from "../CameraLookAt";
import Globe from "../Globe";
import ScreenSpaceCameraController from "../ScreenSpaceCameraController";
import Viewer from "../Viewer";
import EquirectangularPanorama from "./EquirectangularPanorama";
const position = Cartesian3.fromDegrees(-122.4175, 37.655, 100);
const transform = Transforms.headingPitchRollToFixedFrame(
position,
new HeadingPitchRoll(CesiumMath.toRadians(10), CesiumMath.toRadians(-5), CesiumMath.toRadians(2)),
Ellipsoid.WGS84,
Transforms.eastNorthUpToFixedFrame,
);
// Public domain 360° interior panorama (Laon Cathedral, France — Wikimedia Commons)
const image =
"https://upload.wikimedia.org/wikipedia/commons/0/08/Laon_Cathedral_Interior_360x180%2C_Picardy%2C_France_-_Diliff.jpg";
const commonScene = (
<>
>
);
type Story = StoryObj;
export default {
title: "EquirectangularPanorama",
component: EquirectangularPanorama,
} as Meta;
// Toggle `show` in the controls panel to hide/reveal the panorama
export const Basic: Story = {
args: { show: true },
render: args => (
{commonScene}
),
};
// SmallRadius: camera positioned outside a 100m sphere so the panorama is visible as an object
// in the scene — clearly distinct from Basic where the camera is inside the default 100km sphere
export const SmallRadius: Story = {
render: () => (
{/* Keep the globe visible so the sphere is visible against the terrain */}
),
};
// repeatHorizontal / repeatVertical tile the image across the sphere — visually distinct from Basic
export const TextureRepeat: Story = {
render: () => (
{commonScene}
),
};