Skip to content

Commit

Permalink
allow top and bottom view by default (#4916)
Browse files Browse the repository at this point in the history
* allow top and bottom view

* update docs

* update fidelity camera angle
  • Loading branch information
elalish authored Oct 23, 2024
1 parent 9b6779a commit e7e1865
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
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",
"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

0 comments on commit e7e1865

Please sign in to comment.