mirror of
https://github.com/Doodle3D/Doodle3D-Slicer.git
synced 2024-06-30 16:21:22 +02:00
235 lines
4.9 KiB
JavaScript
Executable File
235 lines
4.9 KiB
JavaScript
Executable File
/**
|
|
* @author mrdoob / http://mrdoob.com/
|
|
*/
|
|
|
|
var THREE = { REVISION: '71' };
|
|
|
|
// browserify support
|
|
|
|
if ( typeof module === 'object' ) {
|
|
|
|
module.exports = THREE;
|
|
|
|
}
|
|
|
|
// polyfills
|
|
|
|
if ( Math.sign === undefined ) {
|
|
|
|
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sign
|
|
|
|
Math.sign = function ( x ) {
|
|
|
|
return ( x < 0 ) ? - 1 : ( x > 0 ) ? 1 : +x;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
// set the default log handlers
|
|
THREE.log = function() { console.log.apply( console, arguments ); }
|
|
THREE.warn = function() { console.warn.apply( console, arguments ); }
|
|
THREE.error = function() { console.error.apply( console, arguments ); }
|
|
|
|
|
|
// https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent.button
|
|
|
|
THREE.MOUSE = { LEFT: 0, MIDDLE: 1, RIGHT: 2 };
|
|
|
|
// GL STATE CONSTANTS
|
|
|
|
THREE.CullFaceNone = 0;
|
|
THREE.CullFaceBack = 1;
|
|
THREE.CullFaceFront = 2;
|
|
THREE.CullFaceFrontBack = 3;
|
|
|
|
THREE.FrontFaceDirectionCW = 0;
|
|
THREE.FrontFaceDirectionCCW = 1;
|
|
|
|
// SHADOWING TYPES
|
|
|
|
THREE.BasicShadowMap = 0;
|
|
THREE.PCFShadowMap = 1;
|
|
THREE.PCFSoftShadowMap = 2;
|
|
|
|
// MATERIAL CONSTANTS
|
|
|
|
// side
|
|
|
|
THREE.FrontSide = 0;
|
|
THREE.BackSide = 1;
|
|
THREE.DoubleSide = 2;
|
|
|
|
// shading
|
|
|
|
THREE.NoShading = 0;
|
|
THREE.FlatShading = 1;
|
|
THREE.SmoothShading = 2;
|
|
|
|
// colors
|
|
|
|
THREE.NoColors = 0;
|
|
THREE.FaceColors = 1;
|
|
THREE.VertexColors = 2;
|
|
|
|
// blending modes
|
|
|
|
THREE.NoBlending = 0;
|
|
THREE.NormalBlending = 1;
|
|
THREE.AdditiveBlending = 2;
|
|
THREE.SubtractiveBlending = 3;
|
|
THREE.MultiplyBlending = 4;
|
|
THREE.CustomBlending = 5;
|
|
|
|
// custom blending equations
|
|
// (numbers start from 100 not to clash with other
|
|
// mappings to OpenGL constants defined in Texture.js)
|
|
|
|
THREE.AddEquation = 100;
|
|
THREE.SubtractEquation = 101;
|
|
THREE.ReverseSubtractEquation = 102;
|
|
THREE.MinEquation = 103;
|
|
THREE.MaxEquation = 104;
|
|
|
|
// custom blending destination factors
|
|
|
|
THREE.ZeroFactor = 200;
|
|
THREE.OneFactor = 201;
|
|
THREE.SrcColorFactor = 202;
|
|
THREE.OneMinusSrcColorFactor = 203;
|
|
THREE.SrcAlphaFactor = 204;
|
|
THREE.OneMinusSrcAlphaFactor = 205;
|
|
THREE.DstAlphaFactor = 206;
|
|
THREE.OneMinusDstAlphaFactor = 207;
|
|
|
|
// custom blending source factors
|
|
|
|
//THREE.ZeroFactor = 200;
|
|
//THREE.OneFactor = 201;
|
|
//THREE.SrcAlphaFactor = 204;
|
|
//THREE.OneMinusSrcAlphaFactor = 205;
|
|
//THREE.DstAlphaFactor = 206;
|
|
//THREE.OneMinusDstAlphaFactor = 207;
|
|
THREE.DstColorFactor = 208;
|
|
THREE.OneMinusDstColorFactor = 209;
|
|
THREE.SrcAlphaSaturateFactor = 210;
|
|
|
|
|
|
// TEXTURE CONSTANTS
|
|
|
|
THREE.MultiplyOperation = 0;
|
|
THREE.MixOperation = 1;
|
|
THREE.AddOperation = 2;
|
|
|
|
// Mapping modes
|
|
|
|
THREE.UVMapping = 300;
|
|
|
|
THREE.CubeReflectionMapping = 301;
|
|
THREE.CubeRefractionMapping = 302;
|
|
|
|
THREE.EquirectangularReflectionMapping = 303;
|
|
THREE.EquirectangularRefractionMapping = 304;
|
|
|
|
THREE.SphericalReflectionMapping = 305;
|
|
|
|
// Wrapping modes
|
|
|
|
THREE.RepeatWrapping = 1000;
|
|
THREE.ClampToEdgeWrapping = 1001;
|
|
THREE.MirroredRepeatWrapping = 1002;
|
|
|
|
// Filters
|
|
|
|
THREE.NearestFilter = 1003;
|
|
THREE.NearestMipMapNearestFilter = 1004;
|
|
THREE.NearestMipMapLinearFilter = 1005;
|
|
THREE.LinearFilter = 1006;
|
|
THREE.LinearMipMapNearestFilter = 1007;
|
|
THREE.LinearMipMapLinearFilter = 1008;
|
|
|
|
// Data types
|
|
|
|
THREE.UnsignedByteType = 1009;
|
|
THREE.ByteType = 1010;
|
|
THREE.ShortType = 1011;
|
|
THREE.UnsignedShortType = 1012;
|
|
THREE.IntType = 1013;
|
|
THREE.UnsignedIntType = 1014;
|
|
THREE.FloatType = 1015;
|
|
THREE.HalfFloatType = 1025;
|
|
|
|
// Pixel types
|
|
|
|
//THREE.UnsignedByteType = 1009;
|
|
THREE.UnsignedShort4444Type = 1016;
|
|
THREE.UnsignedShort5551Type = 1017;
|
|
THREE.UnsignedShort565Type = 1018;
|
|
|
|
// Pixel formats
|
|
|
|
THREE.AlphaFormat = 1019;
|
|
THREE.RGBFormat = 1020;
|
|
THREE.RGBAFormat = 1021;
|
|
THREE.LuminanceFormat = 1022;
|
|
THREE.LuminanceAlphaFormat = 1023;
|
|
// THREE.RGBEFormat handled as THREE.RGBAFormat in shaders
|
|
THREE.RGBEFormat = THREE.RGBAFormat; //1024;
|
|
|
|
// DDS / ST3C Compressed texture formats
|
|
|
|
THREE.RGB_S3TC_DXT1_Format = 2001;
|
|
THREE.RGBA_S3TC_DXT1_Format = 2002;
|
|
THREE.RGBA_S3TC_DXT3_Format = 2003;
|
|
THREE.RGBA_S3TC_DXT5_Format = 2004;
|
|
|
|
|
|
// PVRTC compressed texture formats
|
|
|
|
THREE.RGB_PVRTC_4BPPV1_Format = 2100;
|
|
THREE.RGB_PVRTC_2BPPV1_Format = 2101;
|
|
THREE.RGBA_PVRTC_4BPPV1_Format = 2102;
|
|
THREE.RGBA_PVRTC_2BPPV1_Format = 2103;
|
|
|
|
|
|
// DEPRECATED
|
|
|
|
THREE.Projector = function () {
|
|
|
|
THREE.error( 'THREE.Projector has been moved to /examples/js/renderers/Projector.js.' );
|
|
|
|
this.projectVector = function ( vector, camera ) {
|
|
|
|
THREE.warn( 'THREE.Projector: .projectVector() is now vector.project().' );
|
|
vector.project( camera );
|
|
|
|
};
|
|
|
|
this.unprojectVector = function ( vector, camera ) {
|
|
|
|
THREE.warn( 'THREE.Projector: .unprojectVector() is now vector.unproject().' );
|
|
vector.unproject( camera );
|
|
|
|
};
|
|
|
|
this.pickingRay = function ( vector, camera ) {
|
|
|
|
THREE.error( 'THREE.Projector: .pickingRay() is now raycaster.setFromCamera().' );
|
|
|
|
};
|
|
|
|
};
|
|
|
|
THREE.CanvasRenderer = function () {
|
|
|
|
THREE.error( 'THREE.CanvasRenderer has been moved to /examples/js/renderers/CanvasRenderer.js' );
|
|
|
|
this.domElement = document.createElement( 'canvas' );
|
|
this.clear = function () {};
|
|
this.render = function () {};
|
|
this.setClearColor = function () {};
|
|
this.setSize = function () {};
|
|
|
|
};
|