File tree Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ class CSS3DRenderer {
70
70
let _widthHalf , _heightHalf
71
71
72
72
const cache = {
73
- camera : { fov : 0 , style : '' } ,
73
+ camera : { style : '' } ,
74
74
objects : new WeakMap ( ) ,
75
75
}
76
76
@@ -101,11 +101,6 @@ class CSS3DRenderer {
101
101
this . render = function ( scene , camera ) {
102
102
const fov = camera . projectionMatrix . elements [ 5 ] * _heightHalf
103
103
104
- if ( cache . camera . fov !== fov ) {
105
- viewElement . style . perspective = camera . isPerspectiveCamera ? fov + 'px' : ''
106
- cache . camera . fov = fov
107
- }
108
-
109
104
if ( camera . view && camera . view . enabled ) {
110
105
// view offset
111
106
viewElement . style . transform = `translate( ${ - camera . view . offsetX * ( _width / camera . view . width ) } px, ${
@@ -143,8 +138,9 @@ class CSS3DRenderer {
143
138
'px)' +
144
139
getCameraCSSMatrix ( camera . matrixWorldInverse )
145
140
: `scale( ${ scaleByViewOffset } )` + 'translateZ(' + fov + 'px)' + getCameraCSSMatrix ( camera . matrixWorldInverse )
141
+ const perspective = camera . isPerspectiveCamera ? 'perspective(' + fov + 'px) ' : ''
146
142
147
- const style = cameraCSSMatrix + 'translate(' + _widthHalf + 'px,' + _heightHalf + 'px)'
143
+ const style = perspective + cameraCSSMatrix + 'translate(' + _widthHalf + 'px,' + _heightHalf + 'px)'
148
144
149
145
if ( cache . camera . style !== style ) {
150
146
cameraElement . style . transform = style
You can’t perform that action at this time.
0 commit comments