Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Molstar
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Michal Malý
Molstar
Commits
c3763621
Commit
c3763621
authored
2 years ago
by
Alexander Rose
Browse files
Options
Downloads
Patches
Plain Diff
expose fov camera param
parent
1f77b19c
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
CHANGELOG.md
+1
-0
1 addition, 0 deletions
CHANGELOG.md
src/mol-canvas3d/canvas3d.ts
+8
-1
8 additions, 1 deletion
src/mol-canvas3d/canvas3d.ts
with
9 additions
and
1 deletion
CHANGELOG.md
+
1
−
0
View file @
c3763621
...
@@ -10,6 +10,7 @@ Note that since we don't clearly distinguish between a public and private interf
...
@@ -10,6 +10,7 @@ Note that since we don't clearly distinguish between a public and private interf
-
Add custom labels to Confal pyramids
-
Add custom labels to Confal pyramids
-
Improve naming of some internal types in Confal pyramids extension coordinate
-
Improve naming of some internal types in Confal pyramids extension coordinate
-
Add example mmCIF file with categories necessary to display Confal pyramids
-
Add example mmCIF file with categories necessary to display Confal pyramids
-
Add Field of View camera parameter
## [v3.13.0] - 2022-07-24
## [v3.13.0] - 2022-07-24
...
...
This diff is collapsed.
Click to expand it.
src/mol-canvas3d/canvas3d.ts
+
8
−
1
View file @
c3763621
...
@@ -40,6 +40,7 @@ import { Passes } from './passes/passes';
...
@@ -40,6 +40,7 @@ import { Passes } from './passes/passes';
import
{
shallowEqual
}
from
'
../mol-util
'
;
import
{
shallowEqual
}
from
'
../mol-util
'
;
import
{
MarkingParams
}
from
'
./passes/marking
'
;
import
{
MarkingParams
}
from
'
./passes/marking
'
;
import
{
GraphicsRenderVariantsBlended
,
GraphicsRenderVariantsWboit
}
from
'
../mol-gl/webgl/render-item
'
;
import
{
GraphicsRenderVariantsBlended
,
GraphicsRenderVariantsWboit
}
from
'
../mol-gl/webgl/render-item
'
;
import
{
degToRad
,
radToDeg
}
from
'
../mol-math/misc
'
;
export
const
Canvas3DParams
=
{
export
const
Canvas3DParams
=
{
camera
:
PD
.
Group
({
camera
:
PD
.
Group
({
...
@@ -49,6 +50,7 @@ export const Canvas3DParams = {
...
@@ -49,6 +50,7 @@ export const Canvas3DParams = {
on
:
PD
.
Group
(
StereoCameraParams
),
on
:
PD
.
Group
(
StereoCameraParams
),
off
:
PD
.
Group
({})
off
:
PD
.
Group
({})
},
{
cycle
:
true
,
hideIf
:
p
=>
p
?.
mode
!==
'
perspective
'
}),
},
{
cycle
:
true
,
hideIf
:
p
=>
p
?.
mode
!==
'
perspective
'
}),
fov
:
PD
.
Numeric
(
45
,
{
min
:
10
,
max
:
130
,
step
:
1
},
{
label
:
'
Field of View
'
}),
manualReset
:
PD
.
Boolean
(
false
,
{
isHidden
:
true
}),
manualReset
:
PD
.
Boolean
(
false
,
{
isHidden
:
true
}),
},
{
pivot
:
'
mode
'
}),
},
{
pivot
:
'
mode
'
}),
cameraFog
:
PD
.
MappedStatic
(
'
on
'
,
{
cameraFog
:
PD
.
MappedStatic
(
'
on
'
,
{
...
@@ -303,7 +305,7 @@ namespace Canvas3D {
...
@@ -303,7 +305,7 @@ namespace Canvas3D {
position
:
Vec3
.
create
(
0
,
0
,
100
),
position
:
Vec3
.
create
(
0
,
0
,
100
),
mode
:
p
.
camera
.
mode
,
mode
:
p
.
camera
.
mode
,
fog
:
p
.
cameraFog
.
name
===
'
on
'
?
p
.
cameraFog
.
params
.
intensity
:
0
,
fog
:
p
.
cameraFog
.
name
===
'
on
'
?
p
.
cameraFog
.
params
.
intensity
:
0
,
clipFar
:
p
.
cameraClipping
.
far
fov
:
degToRad
(
p
.
camera
.
fov
),
},
{
x
,
y
,
width
,
height
},
{
pixelScale
:
attribs
.
pixelScale
});
},
{
x
,
y
,
width
,
height
},
{
pixelScale
:
attribs
.
pixelScale
});
const
stereoCamera
=
new
StereoCamera
(
camera
,
p
.
camera
.
stereo
.
params
);
const
stereoCamera
=
new
StereoCamera
(
camera
,
p
.
camera
.
stereo
.
params
);
...
@@ -658,6 +660,7 @@ namespace Canvas3D {
...
@@ -658,6 +660,7 @@ namespace Canvas3D {
mode
:
camera
.
state
.
mode
,
mode
:
camera
.
state
.
mode
,
helper
:
{
...
helper
.
camera
.
props
},
helper
:
{
...
helper
.
camera
.
props
},
stereo
:
{
...
p
.
camera
.
stereo
},
stereo
:
{
...
p
.
camera
.
stereo
},
fov
:
Math
.
round
(
radToDeg
(
camera
.
state
.
fov
)),
manualReset
:
!!
p
.
camera
.
manualReset
manualReset
:
!!
p
.
camera
.
manualReset
},
},
cameraFog
:
camera
.
state
.
fog
>
0
cameraFog
:
camera
.
state
.
fog
>
0
...
@@ -771,6 +774,10 @@ namespace Canvas3D {
...
@@ -771,6 +774,10 @@ namespace Canvas3D {
if
(
props
.
camera
&&
props
.
camera
.
mode
!==
undefined
&&
props
.
camera
.
mode
!==
camera
.
state
.
mode
)
{
if
(
props
.
camera
&&
props
.
camera
.
mode
!==
undefined
&&
props
.
camera
.
mode
!==
camera
.
state
.
mode
)
{
cameraState
.
mode
=
props
.
camera
.
mode
;
cameraState
.
mode
=
props
.
camera
.
mode
;
}
}
const
oldFov
=
Math
.
round
(
radToDeg
(
camera
.
state
.
fov
));
if
(
props
.
camera
&&
props
.
camera
.
fov
!==
undefined
&&
props
.
camera
.
fov
!==
oldFov
)
{
cameraState
.
fov
=
degToRad
(
props
.
camera
.
fov
);
}
if
(
props
.
cameraFog
!==
undefined
&&
props
.
cameraFog
.
params
)
{
if
(
props
.
cameraFog
!==
undefined
&&
props
.
cameraFog
.
params
)
{
const
newFog
=
props
.
cameraFog
.
name
===
'
on
'
?
props
.
cameraFog
.
params
.
intensity
:
0
;
const
newFog
=
props
.
cameraFog
.
name
===
'
on
'
?
props
.
cameraFog
.
params
.
intensity
:
0
;
if
(
newFog
!==
camera
.
state
.
fog
)
cameraState
.
fog
=
newFog
;
if
(
newFog
!==
camera
.
state
.
fog
)
cameraState
.
fog
=
newFog
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment