Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow top and bottom view by default #4916

Merged
merged 3 commits into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/model-viewer/src/features/controls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ const minCameraOrbitIntrinsics = (element: ModelViewerElementBase&
return {
basis: [
numberNode(-Infinity, 'rad'),
numberNode(Math.PI / 8, 'rad'),
numberNode(0, 'rad'),
numberNode(radius, 'm')
],
keywords: {auto: [null, null, null]}
Expand All @@ -185,7 +185,7 @@ const maxCameraOrbitIntrinsics = (element: ModelViewerElementBase) => {
return {
basis: [
numberNode(Infinity, 'rad'),
numberNode(Math.PI - Math.PI / 8, 'rad'),
numberNode(Math.PI, 'rad'),
numberNode(defaultRadius, 'm')
],
keywords: {auto: [null, null, null]}
Expand Down
4 changes: 2 additions & 2 deletions packages/model-viewer/src/three-components/SmoothControls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ export interface SmoothControlsOptions {
export const DEFAULT_OPTIONS = Object.freeze<SmoothControlsOptions>({
minimumRadius: 0,
maximumRadius: Infinity,
minimumPolarAngle: Math.PI / 8,
maximumPolarAngle: Math.PI - Math.PI / 8,
minimumPolarAngle: 0,
maximumPolarAngle: Math.PI,
minimumAzimuthalAngle: -Infinity,
maximumAzimuthalAngle: Infinity,
minimumFieldOfView: 10,
Expand Down
4 changes: 2 additions & 2 deletions packages/modelviewer.dev/data/docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,7 @@
"htmlName": "maxCameraOrbit",
"description": "Set the maximum orbital values of the camera. Takes values in the same form as camera-orbit, but does not support <span class='attribute'>env()</span>. Note \"Infinity\" is not an accepted keyword, but the default can still be obtained by passing \"auto\". The radius value for \"auto\" is the same as the <span class='attribute'>camera-orbit</span> radius \"auto\" value.",
"default": {
"default": "Infinity 157.5deg auto",
"default": "Infinity 180deg auto",
"options": "$theta $phi $radius"
}
},
Expand All @@ -627,7 +627,7 @@
"htmlName": "minCameraOrbit",
"description": "Set the minimum orbital values of the camera. Note \"Infinity\" is not an accepted keyword, but the default can still be obtained by passing \"auto\". The radius value for \"auto\" is a conservative value to ensure the camera never enters the model, so be careful when setting this to another value.",
"default": {
"default": "-Infinity 22.5deg auto",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are the legacy defaults, if anyone needs the old behavior.

"default": "-Infinity 0deg auto",
"options": "$theta $phi $radius"
}
},
Expand Down
2 changes: 1 addition & 1 deletion packages/render-fidelity-tools/test/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -795,7 +795,7 @@
"model": "../../../shared-assets/models/glTF-Sample-Assets/Models/RecursiveSkeletons/glTF-Binary/RecursiveSkeletons.glb",
"orbit": {
"radius": 120.0,
"phi": 5
"phi": 22.5
},
"target": {
"y": 95
Expand Down
Loading