Skip to content
Closed
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: 0 additions & 4 deletions docs/examples/en/loaders/BasisTextureLoader.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,6 @@ <h2>Browser compatibility</h2>
<p>
Transcoding to PVRTC1 (for iOS) requires square power-of-two textures.
</p>
<p>
This loader relies on ES6 Promises and Web Assembly, which are not
supported in IE11.
</p>

<br>
<hr>
Expand Down
9 changes: 3 additions & 6 deletions docs/examples/en/loaders/DRACOLoader.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,9 @@ <h2>Example</h2>

<h2>Browser compatibility</h2>

<p>DRACOLoader relies on ES6 [link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise Promises],
which are not supported in IE11. To use the loader in IE11, you must
[link:https://github.com/stefanpenner/es6-promise include a polyfill]
providing a Promise replacement. DRACOLoader will automatically use
either the JS or the WASM decoding library, based on browser
capabilities.</p>
<p>
DRACOLoader will automatically use either the JS or the WASM decoding library, based on browser capabilities.
</p>

<br>
<hr>
Expand Down
7 changes: 0 additions & 7 deletions docs/examples/en/loaders/GLTFLoader.html
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,6 @@ <h2>Example</h2>

[example:webgl_loader_gltf]

<h2>Browser compatibility</h2>

<p>GLTFLoader relies on ES6 [link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise Promises],
which are not supported in IE11. To use the loader in IE11, you must
[link:https://github.com/stefanpenner/es6-promise include a polyfill]
providing a Promise replacement.</p>

<h2>Textures</h2>

<p>Textures containing color information (.map, .emissiveMap, and .specularMap) always use sRGB colorspace in
Expand Down
4 changes: 0 additions & 4 deletions docs/examples/zh/loaders/BasisTextureLoader.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,6 @@ <h2>Browser compatibility</h2>
<p>
Transcoding to PVRTC1 (for iOS) requires square power-of-two textures.
</p>
<p>
This loader relies on ES6 Promises and Web Assembly, which are not
supported in IE11.
</p>

<br>
<hr>
Expand Down
9 changes: 3 additions & 6 deletions docs/examples/zh/loaders/DRACOLoader.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,9 @@ <h2>Example</h2>

<h2>Browser compatibility</h2>

<p>DRACOLoader relies on ES6 [link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise Promises],
which are not supported in IE11. To use the loader in IE11, you must
[link:https://github.com/stefanpenner/es6-promise include a polyfill]
providing a Promise replacement. DRACOLoader will automatically use
either the JS or the WASM decoding library, based on browser
capabilities.</p>
<p>
DRACOLoader will automatically use either the JS or the WASM decoding library, based on browser capabilities.
</p>

<br>
<hr>
Expand Down
6 changes: 0 additions & 6 deletions docs/examples/zh/loaders/GLTFLoader.html
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,6 @@ <h2>示例</h2>

[example:webgl_loader_gltf]

<h2>浏览器兼容性</h2>

<p>GLTFLoader 依赖 ES6 [link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise Promises],
这一特性不支持IE11。若要在IE11中使用该加载器,你必须引入polyfill([link:https://github.com/stefanpenner/es6-promise include a polyfill])
来提供一个Promise的替代方案。</p>

<h2>纹理</h2>

<p>纹理中包含的颜色信息(.map, .emissiveMap, 和 .specularMap)在glTF中总是使用sRGB颜色空间,而顶点颜色和材质属性(.color, .emissive, .specular)
Expand Down
16 changes: 2 additions & 14 deletions docs/manual/en/introduction/Browser-support.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,14 @@ <h1>[name]</h1>
<h2>Overview</h2>
<div>
<p>
Three.js can use WebGL to render your scenes on all modern browsers. For older browsers, especially Internet Explorer 10 and below, you may have to fallback to one of the other [link:https://github.com/mrdoob/three.js/tree/master/examples/js/renderers renderers] (CSS2DRenderer, CSS3DRenderer, SVGRenderer). Additionally, you may have to include some polyfills, especially if you are using files from the [link:https://github.com/mrdoob/three.js/tree/master/examples /examples] folder.
</p>
<p>
Note: if you don't need to support these old browsers, then it is not recommended to use the other renderers as they are slower and support less features than the WebGLRenderer.
Three.js can use WebGL to render your scenes on all modern browsers. Additionally, you may have to include some polyfills, especially if you are using files from the [link:https://github.com/mrdoob/three.js/tree/master/examples /examples] folder.
</p>
</div>

<h2>Browsers that support WebGL</h2>
<div>
<p>
Google Chrome 9+, Firefox 4+, Opera 15+, Safari 5.1+, Internet Explorer 11 and Microsoft Edge. You can find which browsers support WebGL at [link:https://caniuse.com/#feat=webgl Can I use WebGL].
Google Chrome 9+, Firefox 4+, Opera 15+, Safari 5.1+ and Microsoft Edge. You can find which browsers support WebGL at [link:https://caniuse.com/#feat=webgl Can I use WebGL].
</p>
</div>

Expand Down Expand Up @@ -91,15 +88,6 @@ <h2>JavaScript Language Features or Web APIs Used in three.js</h2>
</div>

<h2>Polyfills</h2>
<div>
<p>Just import polyfills based on your requirements. Taking IE9 as an example, you need to polyfill at least these features:</p>
<ul>
<li>Typed Arrays</li>
<li>Blob</li>
</ul>
</div>

<h3>Suggested polyfills</h3>
<div>
<ul>
<li>
Expand Down
16 changes: 2 additions & 14 deletions docs/manual/zh/introduction/Browser-support.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,14 @@ <h1>浏览器支持([name])</h1>
<h2>总览</h2>
<div>
<p>
在所有现代浏览器中,Three.js可以使用WebGL来渲染场景。对于较旧的浏览器,特别是Internet Explorer 10或者更低版本浏览器,你将需要回落到其它[link:https://github.com/mrdoob/three.js/tree/master/examples/js/renderers renderers](CSS2DRenderer、CSS3DRenderer、SVGRenderer)。此外,你或许不得不包含一些额外的“填充物”来解决兼容性问题,特别是当你使用[link:https://github.com/mrdoob/three.js/tree/master/examples /examples]目录中的文件时。
</p>
<p>
注意:如果你并不需要支持较旧的浏览器,那就不推荐使用其他渲染器来进行渲染,因为与WebGLRenderer相比,其它渲染器渲染较慢,并且不支持WebGL的诸多特性。
在所有现代浏览器中,Three.js可以使用WebGL来渲染场景。此外,你或许不得不包含一些额外的“填充物”来解决兼容性问题,特别是当你使用[link:https://github.com/mrdoob/three.js/tree/master/examples /examples]目录中的文件时。
</p>
</div>

<h2>支持WebGL的浏览器</h2>
<div>
<p>
Google Chrome 9+、Firefox 4+、Opera 15+、Safari 5.1+、Internet Explorer 11 和 Microsoft Edge。你可以点击[link:https://caniuse.com/#feat=webgl Can I use WebGL]来查阅各个浏览器对WebGL的支持性。
Google Chrome 9+、Firefox 4+、Opera 15+、Safari 5.1+ 和 Microsoft Edge。你可以点击[link:https://caniuse.com/#feat=webgl Can I use WebGL]来查阅各个浏览器对WebGL的支持性。
</p>
</div>

Expand Down Expand Up @@ -93,15 +90,6 @@ <h2>
</div>

<h2>关于用于解决兼容性问题的“填充物”</h2>
<div>
<p>根据你的需求,引入相关的“填充物”即可。以IE9为例,你至少需要来使用“填充物”完成以下的功能。</p>
<ul>
<li>Typed Arrays</li>
<li>Blob</li>
</ul>
</div>

<h3>建议的“填充物”</h3>
<div>
<ul>
<li>
Expand Down
86 changes: 4 additions & 82 deletions examples/js/renderers/CSS3DRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,6 @@ THREE.CSS3DRenderer = function () {

domElement.appendChild( cameraElement );

var isIE = /Trident/i.test( navigator.userAgent );

this.getSize = function () {

return {
Expand Down Expand Up @@ -122,7 +120,7 @@ THREE.CSS3DRenderer = function () {

}

function getObjectCSSMatrix( matrix, cameraCSSMatrix ) {
function getObjectCSSMatrix( matrix ) {

var elements = matrix.elements;
var matrix3d = 'matrix3d(' +
Expand All @@ -144,15 +142,6 @@ THREE.CSS3DRenderer = function () {
epsilon( elements[ 15 ] ) +
')';

if ( isIE ) {

return 'translate(-50%,-50%)' +
'translate(' + _widthHalf + 'px,' + _heightHalf + 'px)' +
cameraCSSMatrix +
matrix3d;

}

return 'translate(-50%,-50%)' + matrix3d;

}
Expand All @@ -177,11 +166,11 @@ THREE.CSS3DRenderer = function () {
matrix.elements[ 11 ] = 0;
matrix.elements[ 15 ] = 1;

style = getObjectCSSMatrix( matrix, cameraCSSMatrix );
style = getObjectCSSMatrix( matrix );

} else {

style = getObjectCSSMatrix( object.matrixWorld, cameraCSSMatrix );
style = getObjectCSSMatrix( object.matrixWorld );

}

Expand All @@ -195,12 +184,6 @@ THREE.CSS3DRenderer = function () {

var objectData = { style: style };

if ( isIE ) {

objectData.distanceToCameraSquared = getDistanceToSquared( camera, object );

}

cache.objects.set( object, objectData );

}
Expand All @@ -221,57 +204,6 @@ THREE.CSS3DRenderer = function () {

}

var getDistanceToSquared = function () {

var a = new THREE.Vector3();
var b = new THREE.Vector3();

return function ( object1, object2 ) {

a.setFromMatrixPosition( object1.matrixWorld );
b.setFromMatrixPosition( object2.matrixWorld );

return a.distanceToSquared( b );

};

}();

function filterAndFlatten( scene ) {

var result = [];

scene.traverse( function ( object ) {

if ( object instanceof THREE.CSS3DObject ) result.push( object );

} );

return result;

}

function zOrder( scene ) {

var sorted = filterAndFlatten( scene ).sort( function ( a, b ) {

var distanceA = cache.objects.get( a ).distanceToCameraSquared;
var distanceB = cache.objects.get( b ).distanceToCameraSquared;

return distanceA - distanceB;

} );

var zMax = sorted.length;

for ( var i = 0, l = sorted.length; i < l; i ++ ) {

sorted[ i ].element.style.zIndex = zMax - i;

}

}

this.render = function ( scene, camera ) {

var fov = camera.projectionMatrix.elements[ 5 ] * _heightHalf;
Expand Down Expand Up @@ -312,7 +244,7 @@ THREE.CSS3DRenderer = function () {
var style = cameraCSSMatrix +
'translate(' + _widthHalf + 'px,' + _heightHalf + 'px)';

if ( cache.camera.style !== style && ! isIE ) {
if ( cache.camera.style !== style ) {

cameraElement.style.WebkitTransform = style;
cameraElement.style.transform = style;
Expand All @@ -323,16 +255,6 @@ THREE.CSS3DRenderer = function () {

renderObject( scene, camera, cameraCSSMatrix );

if ( isIE ) {

// IE10 and 11 does not support 'preserve-3d'.
// Thus, z-order in 3D will not work.
// We have to calc z-order manually and set CSS z-index for IE.
// FYI: z-index can't handle object intersection
zOrder( scene );

}

};

};
Loading